repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 30
values | content stringlengths 0 5.21M | token_count int64 0 3.8M |
|---|---|---|---|---|
hyperswitch-web | aws/hyperswitch_web_aws_setup.sh | .sh | #!/bin/bash
command_discovery() {
type $1 > /dev/null 2> /dev/null
if [[ $? != 0 ]]; then
echo "\`$1\` command not found"
exit 1
fi
}
command_discovery curl
command_discovery aws
echo "Please enter the URL where you have hosted Hyperswitch Backend (https://beta.hyperswitch.io/api) "
read HYPERSWITCH_SE... | 1,608 |
hyperswitch-web | aws/hyperswitch_web_aws_production_deployment.sh | .sh | #!/bin/bash
command_discovery() {
type $1 >/dev/null 2>/dev/null
if [[ $? != 0 ]]; then
echo "\`$1\` command not found"
exit 1
fi
}
command_discovery curl
command_discovery aws
echo "Installing Node Modules"
echo $( (npm install --force))
echo $( (npm run re:build))
echo "Starting AWS S... | 831 |
hyperswitch-web | src/Payment.res | .res | open CardUtils
open CardThemeType
open CardTheme
open LoggerUtils
open RecoilAtoms
let setUserError = message => {
Utils.postFailedSubmitResponse(~errortype="validation_error", ~message)
}
@react.component
let make = (~paymentMode, ~integrateError, ~logger) => {
let {localeString} = Recoil.useRecoilValueFromAtom(... | 3,882 |
hyperswitch-web | src/GlobalVars.res | .res | @val external repoName: string = "repoName"
@val external repoVersion: string = "repoVersion"
@val external repoPublicPath: string = "publicPath"
@val external backendEndPoint: string = "backendEndPoint"
@val external confirmEndPoint: string = "confirmEndPoint"
@val external sdkUrl: string = "sdkUrl"
@val external logE... | 226 |
hyperswitch-web | src/PaymentElementRendererLazy.res | .res | let make = React.lazy_(() => Js.import(PaymentElementRenderer.default))
| 16 |
hyperswitch-web | src/PaymentMethodCollectElement.res | .res | open PaymentMethodCollectTypes
open PaymentMethodCollectUtils
open RecoilAtoms
@react.component
let make = (~integrateError, ~logger) => {
open Promise
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom)
let keys = Recoil.useRecoilValueFromA... | 2,867 |
hyperswitch-web | src/FormViewJourney.res | .res | open PaymentMethodCollectTypes
open PaymentMethodCollectUtils
open RecoilAtoms
@react.component
let make = (
~availablePaymentMethods,
~availablePaymentMethodTypes,
~primaryTheme,
~handleSubmit,
~enabledPaymentMethodsWithDynamicFields: array<paymentMethodTypeWithDynamicFields>,
~journeyView,
~renderAddre... | 3,281 |
hyperswitch-web | src/LoaderController.res | .res | open Utils
@react.component
let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTimestamp) => {
open RecoilAtoms
let (configAtom, setConfig) = Recoil.useRecoilState(configAtom)
let (keys, setKeys) = Recoil.useRecoilState(keys)
let (paymentMethodList, setPaymentMethodList) = Recoil.useRe... | 4,855 |
hyperswitch-web | src/ThreeDSAuth.res | .res | open Utils
@react.component
let make = () => {
let (openModal, setOpenModal) = React.useState(_ => false)
let (loader, setloader) = React.useState(_ => true)
let threeDsAuthoriseUrl = React.useRef("")
let (expiryTime, setExpiryTime) = React.useState(_ => 600000.0)
let logger = HyperLogger.make(~source=Elem... | 1,168 |
hyperswitch-web | src/App.res | .res | @react.component
let make = () => {
open CardUtils
let url = RescriptReactRouter.useUrl()
let (integrateError, setIntegrateErrorError) = React.useState(() => false)
let setLoggerState = Recoil.useSetRecoilState(RecoilAtoms.loggerAtom)
let paymentMode = getQueryParamsDictforKey(url.search, "componentName")
... | 894 |
hyperswitch-web | src/NoTheme.res | .res | open CardThemeType
let noThemeValues = {
fontFamily: "",
fontSizeBase: "1rem",
colorPrimary: "",
colorBackground: "",
colorText: "",
colorDanger: "",
colorDangerText: "",
borderRadius: "",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: "10px",
fontWeightLight: "",
fontWeigh... | 373 |
hyperswitch-web | src/States.json | .json | {
"states": {
"AF": [
{ "name": "Badakhshan", "code": "BDS" },
{ "name": "Badghīs", "code": "BDG" },
{ "name": "Baghlan", "code": "BGL" },
{ "name": "Balkh", "code": "BAL" },
{ "name": "Bamyān", "code": "BAM" },
{ "name": "Daykundī", "code": "DAY" },
{ "name": "Farah", "c... | 98,478 |
hyperswitch-web | src/MidnightTheme.res | .res | open CardThemeType
let midnight = {
fontFamily: "Quicksand",
fontSizeBase: "1rem",
colorPrimary: "#85d996",
colorBackground: "#30313d",
colorText: "#e0e0e0",
colorDanger: "#fe87a1",
colorDangerText: "#fe87a1",
borderRadius: "10px",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: ... | 2,388 |
hyperswitch-web | src/RenderPaymentMethods.res | .res | open RecoilAtoms
@react.component
let make = (
~paymentType: CardThemeType.mode,
~cardProps,
~expiryProps,
~cvcProps,
~zipProps,
~handleElementFocus,
~blurState,
~isFocus,
) => {
let {showLoader} = Recoil.useRecoilValueFromAtom(configAtom)
let {themeObj, localeString} = Recoil.useRecoilValueFromAtom... | 1,035 |
hyperswitch-web | src/SingleLineCardPaymentLazy.res | .res | let make = React.lazy_(() => Js.import(SingleLineCardPayment.default))
| 17 |
hyperswitch-web | src/SingleLineCardPayment.resi | .resi | @react.component
let default: (
~paymentType: CardThemeType.mode,
~cardProps: CardUtils.cardProps,
~expiryProps: CardUtils.expiryProps,
~cvcProps: CardUtils.cvcProps,
~zipProps: CardUtils.zipProps,
~handleElementFocus: bool => unit,
~isFocus: bool,
) => React.element
| 83 |
hyperswitch-web | src/ThreeDSMethod.res | .res | open Utils
@react.component
let make = () => {
let logger = HyperLogger.make(~source=Elements(Payment))
let (stateMetadata, setStateMetadata) = React.useState(_ => Dict.make()->JSON.Encode.object)
let divRef = React.useRef(Nullable.null)
let observer = React.useRef(None)
let handleIframeContentLoaded = () ... | 1,168 |
hyperswitch-web | src/CollectWidget.res | .res | open CardUtils
open PaymentMethodCollectTypes
open PaymentMethodCollectUtils
open RecoilAtoms
@react.component
let make = (
~availablePaymentMethods,
~availablePaymentMethodTypes,
~primaryTheme,
~handleSubmit,
~formLayout: formLayout,
) => {
// Recoil states
let {config, constantString, localeString} = R... | 3,147 |
hyperswitch-web | src/PaymentManagement.res | .res | open PaymentType
open RecoilAtoms
@react.component
let make = () => {
let {savedPaymentMethods, displaySavedPaymentMethods} = Recoil.useRecoilValueFromAtom(optionAtom)
let (savedMethods, setSavedMethods) = React.useState(_ => [])
let (isLoading, setIsLoading) = React.useState(_ => false)
React.useEffect(() =>... | 325 |
hyperswitch-web | src/CharcoalTheme.res | .res | open CardThemeType
let charcoal = {
fontFamily: "Quicksand",
fontSizeBase: "1rem",
colorPrimary: "#000000",
colorBackground: "#f0f3f5",
colorText: "#000000",
colorDanger: "#df1b41",
colorDangerText: "#df1b41",
borderRadius: "10px",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: ... | 1,628 |
hyperswitch-web | src/CardTheme.res | .res | open CardThemeType
open Utils
open ErrorUtils
let getTheme = (val, logger) => {
switch val->String.toLowerCase {
| "default" => Default
| "brutal" => Brutal
| "midnight" => Midnight
| "charcoal" => Charcoal
| "soft" => Soft
| "bubblegum" => Bubblegum
| "none" => NONE
| str => {
str->unknownProp... | 3,022 |
hyperswitch-web | src/BrutalTheme.res | .res | open CardThemeType
let brutal = {
fontFamily: "Quicksand",
fontSizeBase: "1rem",
colorPrimary: "#f5fb1f",
colorBackground: "#ffffff",
colorText: "#000000",
colorDanger: "#ff1a1a",
colorDangerText: "#ff1a1a",
borderRadius: "6px",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: "11... | 1,814 |
hyperswitch-web | src/WalletElement.res | .res | @react.component
let make = (~paymentType) => {
let sessionsObj = Recoil.useRecoilValueFromAtom(RecoilAtoms.sessions)
let methodslist = Recoil.useRecoilValueFromAtom(RecoilAtoms.paymentMethodList)
let (sessions, setSessions) = React.useState(_ => Dict.make()->JSON.Encode.object)
let (walletOptions, setWalletOpt... | 374 |
hyperswitch-web | src/PaymentManagementLazy.res | .res | let make = React.lazy_(() => Js.import(PaymentManagement.default))
| 15 |
hyperswitch-web | src/PaymentElementRenderer.res | .res | open RecoilAtoms
@react.component
let make = (
~paymentType: CardThemeType.mode,
~cardProps: CardUtils.cardProps,
~expiryProps: CardUtils.expiryProps,
~cvcProps: CardUtils.cvcProps,
) => {
let _cardsToRender = width => {
(width - 40) / 110
}
let {showLoader} = Recoil.useRecoilValueFromAtom(configAtom)... | 241 |
hyperswitch-web | src/CardPattern.res | .res | type patterns = {
issuer: string,
pattern: Re.t,
cvcLength: array<int>,
length: array<int>,
maxCVCLength: int,
pincodeRequired: bool,
}
type card = {details: array<patterns>}
let defaultCardPattern = {
issuer: "",
pattern: %re("/^[0-9]/"),
cvcLength: [3, 4],
maxCVCLength: 4,
length: [13, 14, 15, 1... | 2,318 |
hyperswitch-web | src/Bank.res | .res | type bank = {
displayName: string,
hyperSwitch: string,
}
type bankList = array<bank>
let defaultEpsBank = {
displayName: "Ärzte- und Apothekerbank",
hyperSwitch: "arzte_und_apotheker_bank",
}
let defaultIdealBank = {
displayName: "ABN AMRO",
hyperSwitch: "abn_amro",
}
let defaultBank = {
displayName: "",... | 3,004 |
hyperswitch-web | src/FormViewTabs.res | .res | open PaymentMethodCollectTypes
open PaymentMethodCollectUtils
open RecoilAtoms
@react.component
let make = (
~availablePaymentMethodTypes,
~primaryTheme,
~handleSubmit,
~tabsView,
~defaultOptionsLimitInTabLayout=defaultOptionsLimitInTabLayout,
~renderAddressForm,
~renderPayoutMethodForm,
) => {
// Reco... | 2,898 |
hyperswitch-web | src/Redsys3ds.res | .res | open Utils
@react.component
let make = () => {
let logger = HyperLogger.make(~source=Elements(Payment))
let isCompleteAuthorizeCalledRef = React.useRef(false)
let timeoutRef = React.useRef(None)
let eventsToSendToParent = ["confirmParams", "poll_status", "openurl_if_required"]
let completeAuthorize = Payment... | 951 |
hyperswitch-web | src/Window.res | .res | type window
type parent
type document
type style
type eventData = {
elementType: string,
clickTriggered: bool,
ready: bool,
focus: bool,
blur: bool,
confirmTriggered: bool,
oneClickConfirmTriggered: bool,
}
type loaderEvent = {key: string, data: eventData}
type event = {key: string, data: string, origin: ... | 1,845 |
hyperswitch-web | src/PaymentDetails.res | .res | type paymentDetails = {
type_: string,
icon: option<React.element>,
displayName: string,
}
let defaultPaymentDetails = {
type_: "",
icon: None,
displayName: "",
}
let icon = (~size=22, ~width=size, name) => {
<Icon size width name />
}
let details = [
{
type_: "card",
icon: Some(icon("default-ca... | 758 |
hyperswitch-web | src/Country.res | .res | type windowsTimeZones = {
id: string,
name: string,
}
type timezoneType = {
isoAlpha3: string,
timeZones: array<string>,
countryName: string,
isoAlpha2: string,
}
let defaultTimeZone = {
isoAlpha3: "",
timeZones: [],
countryName: "-",
isoAlpha2: "",
}
let country = [
{
isoAlpha3: "AFG",
t... | 11,916 |
hyperswitch-web | src/ResizeObserver.res | .res | type observer = {observe: Dom.element => unit, disconnect: unit => unit}
type dimensions = {
height: float,
width: float,
}
type ele = {contentRect: dimensions}
@new external newResizerObserver: (array<ele> => unit) => observer = "ResizeObserver"
| 64 |
hyperswitch-web | src/PaymentElementRenderer.resi | .resi | @react.component
let default: (
~paymentType: CardThemeType.mode,
~cardProps: CardUtils.cardProps,
~expiryProps: CardUtils.expiryProps,
~cvcProps: CardUtils.cvcProps,
) => React.element
| 56 |
hyperswitch-web | src/CardSchemeComponent.res | .res | module CoBadgeCardSchemeDropDown = {
@react.component
let make = (~eligibleCardSchemes, ~setCardBrand) => {
<select
className="w-4"
onChange={ev => {
let target = ev->ReactEvent.Form.target
let value = target["value"]
setCardBrand(_ => value)
}}>
<option disabled=... | 475 |
hyperswitch-web | src/Index.res | .res | %%raw(`require("tailwindcss/tailwind.css")`)
%%raw("import './index.css'")
Sentry.initiateSentry(~dsn=GlobalVars.sentryDSN)
let app = switch ReactDOM.querySelector("#app") {
| Some(container) =>
let root = ReactDOM.Client.createRoot(container)
root->ReactDOM.Client.Root.render(
<div className="h-auto flex fle... | 149 |
hyperswitch-web | src/logo.svg | .svg | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6... | 2,532 |
hyperswitch-web | src/PaymentOptions.res | .res | open RecoilAtoms
module TabLoader = {
@react.component
let make = (~cardShimmerCount) => {
let paymentMethodList = Recoil.useRecoilValueFromAtom(paymentMethodList)
let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom)
open PaymentType
open PaymentElementShimmer
switch paymentMethodList {
... | 1,591 |
hyperswitch-web | src/SoftTheme.res | .res | open CardThemeType
let soft = {
fontFamily: "Quicksand",
fontSizeBase: "1rem",
colorPrimary: "#7d8fff",
colorBackground: "#3c3d3e",
colorText: "#e0e0e0",
colorDanger: "#fe87a1",
colorDangerText: "#fe87a1",
borderRadius: "10px",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: "11... | 2,302 |
hyperswitch-web | src/CardUtils.res | .res | type cardIssuer =
| VISA
| MASTERCARD
| AMEX
| MAESTRO
| DINERSCLUB
| DISCOVER
| BAJAJ
| SODEXO
| RUPAY
| JCB
| CARTESBANCAIRES
| UNIONPAY
| INTERAC
| NOTFOUND
type cardProps = (
option<bool>,
(option<bool> => option<bool>) => unit,
option<bool>,
string,
JsxEvent.Form.t => unit,
... | 5,983 |
hyperswitch-web | src/DefaultTheme.res | .res | open CardThemeType
let default = {
fontFamily: "",
fontSizeBase: "1rem",
colorPrimary: "#006df9",
colorBackground: "#ffffff",
colorText: "#545454",
colorDanger: "#fd1717",
colorDangerText: "#fd1717",
borderRadius: "4px",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: "11px",
f... | 2,194 |
hyperswitch-web | src/BrowserSpec.res | .res | type navigator = {
userAgent: string,
language: string,
}
type date = {getTimezoneOffset: unit => float}
type screen = {colorDepth: int, height: int, width: int}
@val external navigator: navigator = "navigator"
@val external screen: screen = "screen"
@new external date: unit => date = "Date"
let checkIsSafari =... | 472 |
hyperswitch-web | src/PaymentElement.res | .res | open PaymentType
open Utils
let cardsToRender = (width: int) => {
let minWidth = 130
let noOfCards = (width - 40) / minWidth
noOfCards
}
@react.component
let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mode) => {
let divRef = React.useRef(Nullable.null)
let sessionsObj = Recoil.... | 5,361 |
hyperswitch-web | src/BubblegumTheme.res | .res | open CardThemeType
let bubblegum = {
fontFamily: "",
fontSizeBase: "1rem",
colorPrimary: "#f360a6",
colorBackground: "#ffffff",
colorText: "#545454",
colorDanger: "#fd1717",
colorDangerText: "#fd1717",
borderRadius: "2px",
fontVariantLigatures: "",
fontVariationSettings: "",
spacingUnit: "11px",
... | 2,297 |
hyperswitch-web | src/index.css | .css | /* Remove blue outline of input, button in firefox */
@-moz-document url-prefix() {
*:focus,
*:focus-visible,
*:focus-within,
*:active,
*:visited {
outline: none !important;
}
}
/* Remove contact and password icon in safari */
input::-webkit-credentials-auto-fill-button,
input::-webkit-contacts-auto-fi... | 93 |
hyperswitch-web | src/Icon.res | .res | @react.component
let make = (
~name,
~size=20,
~width=size,
~className=?,
~iconType="orca",
~onClick=?,
~style=ReactDOMStyle.make(),
~shouldMirrorIcon=false,
) => {
let otherClasses = switch className {
| Some(str) => str
| None => ""
}
<svg
?onClick
style
className={`fill-current... | 168 |
hyperswitch-web | src/TabCard.res | .res | open RecoilAtoms
@react.component
let make = (~paymentOption: PaymentMethodsRecord.paymentFieldsInfo, ~isActive: bool) => {
let {themeObj, localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let {readOnly, customMethodNames} = Recoil.useRecoilValueFromAtom(optionAtom)
let setSelectedOption = Recoil.useSetRe... | 360 |
hyperswitch-web | src/SingleLineCardPayment.res | .res | open RecoilAtoms
open CardUtils
@react.component
let make = (
~paymentType: CardThemeType.mode,
~cardProps,
~expiryProps,
~cvcProps,
~zipProps,
~handleElementFocus,
~isFocus,
) => {
let {iframeId} = Recoil.useRecoilValueFromAtom(keys)
let options = Recoil.useRecoilValueFromAtom(elementOptions)
let {... | 1,390 |
hyperswitch-web | src/Types/ElementType.res | .res | open ErrorUtils
type classes = {
base: string,
complete: string,
empty: string,
focus: string,
invalid: string,
webkitAutofill: string,
}
type rec styleClass = {
backgroundColor: string,
color: string,
fontFamily: string,
fontSize: string,
fontSmoothing: string,
fontStyle: string,
fontVariant:... | 1,856 |
hyperswitch-web | src/Types/PaymentConfirmTypes.res | .res | type achCreditTransfer = {
account_number: string,
bank_name: string,
routing_number: string,
swift_code: string,
}
let defaultACHCreditTransfer = {
account_number: "",
bank_name: "",
routing_number: "",
swift_code: "",
}
type bacsBankInstruction = {
sort_code: string,
account_number: string,
acc... | 1,220 |
hyperswitch-web | src/Types/PaymentMethodCollectTypes.res | .res | type paymentMethod =
| Card
| BankTransfer
| Wallet
type card = Credit | Debit
type bankTransfer = ACH | Bacs | Pix | Sepa
type wallet = Paypal | Venmo
type cardExpDate =
| CardExpMonth
| CardExpYear
type paymentMethodDataField =
// Cards
| CardNumber
| CardExpDate(cardExpDate)
| CardHolderName
//... | 4,339 |
hyperswitch-web | src/Types/PaymentModeType.res | .res | type payment =
| Klarna
| Card
| Sofort
| AfterPay
| Affirm
| GiroPay
| Ideal
| EPS
| CryptoCurrency
| ACHTransfer
| SepaTransfer
| InstantTransfer
| BacsTransfer
| ACHBankDebit
| SepaBankDebit
| BacsBankDebit
| BecsBankDebit
| BanContactCard
| GooglePay
| ApplePay
| SamsungPay... | 562 |
hyperswitch-web | src/Types/PaymentError.res | .res | open Utils
type error = {
type_: string,
code: string,
message: string,
}
type errorType = {error: error}
let defaultError = {
type_: "server_error",
code: "",
message: "Something went wrong",
}
let getError = (dict, str) => {
dict
->Dict.get(str)
->Option.flatMap(JSON.Decode.object)
->Option.map(js... | 158 |
hyperswitch-web | src/Types/PaypalSDKTypes.res | .res | type clientErr = bool
type clientInstance
type paypalCheckoutErr = {message: string}
type data
type order = {get: unit => promise<JSON.t>}
type actions = {order: order}
type err
type vault = {vault: bool}
type shipping = {
recipientName: option<string>,
line1: option<string>,
line2: option<string>,
city: option... | 1,405 |
hyperswitch-web | src/Types/SessionsType.res | .res | open Utils
type wallet = Gpay | Paypal | Klarna | ApplePay | SamsungPay | Paze | ClickToPay | NONE
type tokenCategory =
| ApplePayObject
| GooglePayThirdPartyObject
| SamsungPayObject
| PazeObject
| ClickToPayObject
| Others
type paymentType = Wallet | Others
type token = {
walletName: wallet,
token... | 1,427 |
hyperswitch-web | src/Types/RecoilAtomTypes.res | .res | type field = {
value: string,
isValid: option<bool>,
errorString: string,
countryCode?: string,
}
type load = Loading | Loaded(JSON.t) | LoadError
type paymentToken = {
paymentToken: string,
customerId: string,
}
type redirectionFlags = {
shouldUseTopRedirection: bool,
shouldRemoveBeforeUnloadEvents:... | 231 |
hyperswitch-web | src/Types/SamsungPayType.res | .res | type client = {
isReadyToPay: JSON.t => promise<JSON.t>,
createButton: JSON.t => Dom.element,
loadPaymentSheet: (JSON.t, JSON.t) => promise<Fetch.Response.t>,
notify: JSON.t => unit,
}
type env = {environment: string}
@new external samsung: env => client = "SamsungPay.PaymentClient"
type merchant = {
name:... | 252 |
hyperswitch-web | src/Types/ApplePayTypes.res | .res | open Utils
type token = {paymentData: JSON.t}
type billingContact = {
addressLines: array<string>,
administrativeArea: string,
countryCode: string,
familyName: string,
givenName: string,
locality: string,
postalCode: string,
}
type shippingContact = {
emailAddress: string,
phoneNumber: string,
add... | 1,343 |
hyperswitch-web | src/Types/ClickToPayHelpers.res | .res | open Promise
let scriptId = "mastercard-external-script"
let getScriptSrc = (isProd: bool) => {
let clickToPayMastercardBaseUrl = isProd
? "https://src.mastercard.com"
: "https://sandbox.src.mastercard.com"
clickToPayMastercardBaseUrl ++ "/srci/integration/2/lib.js"
}
let srcUiKitScriptSrc = "https://src.... | 6,435 |
hyperswitch-web | src/Types/GooglePayType.res | .res | open Utils
@val @scope("Object") external assign: (JSON.t, JSON.t, JSON.t) => JSON.t = "assign"
type transactionInfo = {
countryCode: string,
currencyCode: string,
totalPriceStatus: string,
totalPrice: string,
}
type merchantInfo = {merchantName: string}
type paymentDataRequest = {
mutable allowedPaymentMetho... | 1,347 |
hyperswitch-web | src/Types/ACHTypes.res | .res | type data = {
routingNumber: string,
accountNumber: string,
accountHolderName: string,
accountType: string,
iban: string,
sortCode: string,
requiredFieldsBody?: Dict.t<JSON.t>,
}
| 53 |
hyperswitch-web | src/Types/PostalCodeType.res | .res | type postalCodes = {
iso: string,
format: string,
regex: string,
}
let defaultPostalCode = {
iso: "",
format: "",
regex: "",
}
type themeDataModule = {default: array<postalCodes>}
@val
external importPostalCode: string => promise<themeDataModule> = "import"
| 74 |
hyperswitch-web | src/Types/CardThemeType.res | .res | type theme = Default | Brutal | Midnight | Soft | Charcoal | Bubblegum | NONE
type innerLayout = Spaced | Compressed
type showLoader = Auto | Always | Never
type mode =
| Card
| Payment
| CardNumberElement
| CardExpiryElement
| CardCVCElement
| PaymentMethodCollectElement
| GooglePayElement
| PayPalE... | 769 |
hyperswitch-web | src/Types/PaymentType.res | .res | type showTerms = Auto | Always | Never
type showType = Auto | Never
type layout = Accordion | Tabs
open Utils
open ErrorUtils
type showAddress = {
line1: showType,
line2: showType,
city: showType,
state: showType,
country: showType,
postal_code: showType,
}
type alias = {
paymentMethodName: string,
ali... | 8,650 |
hyperswitch-web | src/Types/ThemeImporter.res | .res | type themeDataModule = {
default: CardThemeType.themeClass,
defaultRules: CardThemeType.themeClass => JSON.t,
}
@val
external importTheme: string => promise<themeDataModule> = "import"
| 48 |
hyperswitch-web | src/Types/ConfirmType.res | .res | type confirmParams = {
return_url: string,
publishableKey: string,
redirect?: string,
}
type confirm = {
doSubmit: bool,
clientSecret: string,
confirmParams: confirmParams,
confirmTimestamp: float,
readyTimestamp: float,
}
open Utils
let defaultConfirm = {
return_url: "",
publishableKey: "",
redi... | 264 |
hyperswitch-web | src/libraries/DatePicker.res | .res | // * For reference - https://reactdatepicker.com/
type customHeaderProps = {
date: Date.t,
selectingDate: Date.t,
monthDate: Date.t,
increaseMonth: unit => unit,
decreaseMonth: unit => unit,
changeMonth: int => unit,
increaseYear: unit => unit,
decreaseYear: unit => unit,
changeYear: unit => unit,
... | 267 |
hyperswitch-web | src/libraries/recoil.js | .js | import {
RecoilRoot,
atom as recoilAtom,
selector,
useRecoilState,
useRecoilValue,
} from "recoil";
export function atom(key, defaultVal) {
return recoilAtom({ key, default: defaultVal });
}
| 56 |
hyperswitch-web | src/libraries/Recoil.res | .res | module RecoilRoot = {
@module("recoil") @react.component
external make: (~children: React.element) => React.element = "RecoilRoot"
}
type recoilAtom<'v> = RecoilAtom('v)
type recoilSelector<'v> = RecoilSelector('v)
@module("./recoil")
external atom: (string, 'v) => recoilAtom<'v> = "atom"
@module("recoil")
exter... | 337 |
hyperswitch-web | src/libraries/Promise.resi | .resi | type t<'a> = RescriptCore.Promise.t<'a>
type exn += JsError(RescriptCore.Exn.t)
@new
external make: ((@uncurry 'a => unit, 'e => unit) => unit) => t<'a> = "Promise"
@val @scope("Promise")
external resolve: 'a => t<'a> = "resolve"
@send external then: (t<'a>, @uncurry 'a => t<'b>) => t<'b> = "then"
@send
external thenRe... | 532 |
hyperswitch-web | src/libraries/Promise.res | .res | type t<+'a> = promise<'a>
exception JsError(Exn.t)
@new
external make: ((@uncurry 'a => unit, 'e => unit) => unit) => t<'a> = "Promise"
@val @scope("Promise")
external resolve: 'a => t<'a> = "resolve"
@send external then: (t<'a>, @uncurry 'a => t<'b>) => t<'b> = "then"
@send
external thenResolve: (t<'a>, @uncurry ... | 568 |
hyperswitch-web | src/libraries/Plaid.res | .res | // * For Documentation - https://plaid.com/docs/link/web/
type createArgs = {
token: string,
onSuccess: (string, JSON.t) => unit,
onLoad?: unit => unit,
onExit?: JSON.t => unit,
onEvent?: JSON.t => unit,
}
type createReturn = {
@as("open") open_: unit => unit,
exit: unit => unit,
destroy: unit => unit... | 143 |
hyperswitch-web | src/libraries/ua-parser-js/UAParser.res | .res | type browser = {name: option<string>, version: option<string>}
type os = {name: option<string>, version: option<string>}
type engine = {name: option<string>, version: option<string>}
type device = {model: option<string>, \"type": option<string>, vendor: option<string>}
type cpu = {architecture: option<string>}
type re... | 121 |
hyperswitch-web | src/libraries/ua-parser-js/ua-parser.js | .js | (function (window, undefined) {
"use strict";
var LIBVERSION = "2.0.0",
UA_MAX_LENGTH = 500,
USER_AGENT = "user-agent",
EMPTY = "",
UNKNOWN = "?",
FUNC_TYPE = "function",
UNDEF_TYPE = "undefined",
OBJ_TYPE = "object",
STR_TYPE = "string",
UA_BROWSER = "browser",
UA_CPU = "cp... | 17,291 |
hyperswitch-web | src/Components/ClickToPayLearnMore.res | .res | open Utils
@react.component
let make = () => {
let (openModal, setOpenModal) = React.useState(_ => false)
let (cardBrand, setCardBrand) = React.useState(_ => "")
let logger = HyperLogger.make(~source=Elements(Payment))
let closeClickToPayModal = () => {
setOpenModal(_ => false)
messageParentWindow([(... | 425 |
hyperswitch-web | src/Components/BillingNamePaymentInput.res | .res | open RecoilAtoms
open PaymentType
open Utils
@react.component
let make = (~paymentType, ~customFieldName=None, ~requiredFields as optionalRequiredFields=?) => {
let {config, localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let {fields} = Recoil.useRecoilValueFromAtom(optionAtom)
let loggerState = Recoil... | 581 |
hyperswitch-web | src/Components/Or.res | .res | @react.component
let make = () => {
let {localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
<div className="w-full w-max-[750px] relative flex flex-row my-4 " ariaHidden=true>
<div className="OrPayUsingLine relative top-[50%] h-[1px] bg-gray-400 w-full self-center" />
<div
classNam... | 175 |
hyperswitch-web | src/Components/SaveDetailsCheckbox.res | .res | let saveDetailsCssStyle = (themeObj: CardThemeType.themeClass) => {
`.container {
display: flex;
cursor: pointer;
position: relative;
}
.container input {
position: absolute;
transform: scale(0);
}
.container input:checked ~ .checkmark {
transform: rotate(45deg);
height: 1em;
width: .4em;
border-c... | 674 |
hyperswitch-web | src/Components/PoweredBy.res | .res | @react.component
let make = (~className="pt-4") => {
let {branding} = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom)
<RenderIf condition={branding == Auto}>
<div className={`text-xs text-center w-full flex justify-center ${className}`} ariaHidden=true>
<Icon size=18 width=130 name="powerd-by-hyper"... | 101 |
hyperswitch-web | src/Components/VpaIdPaymentInput.res | .res | open RecoilAtoms
open Utils
@react.component
let make = (~paymentType) => {
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom)
let (vpaId, setVpaId) = Recoil.useLoggedRecoilState(userVpaId, "vpaId", loggerState)
let vpaIdRef = React.useRe... | 452 |
hyperswitch-web | src/Components/CardElementShimmer.res | .res | @react.component
let make = () => {
<div className="shine w-full h-12 rounded">
<div className="flex flex-row my-auto">
<div className=" w-10 h-5 rounded-full m-3 bg-white bg-opacity-70 " />
<div className=" my-auto w-24 h-2 rounded m-3 bg-white bg-opacity-70 " />
</div>
</div>
}
| 98 |
hyperswitch-web | src/Components/ClickToPayAuthenticate.res | .res | open ClickToPayHelpers
open Promise
open Utils
@react.component
let make = (
~consumerIdentity,
~loggerState,
~savedMethods,
~setShowFields,
~setIsCTPAuthenticateNotYouClicked,
~setIsShowClickToPayNotYou,
~isClickToPayAuthenticateError,
~setIsClickToPayAuthenticateError,
~loadSavedCards,
~setPaymen... | 1,202 |
hyperswitch-web | src/Components/InfoElement.res | .res | @react.component
let make = () => {
let {themeObj, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let selectedOption =
Recoil.useRecoilValueFromAtom(RecoilAtoms.selectedOptionAtom)->PaymentModeType.paymentMode
<div
className="InfoElement flex flex-row w-full pr-3 gap-3"
style={
... | 228 |
hyperswitch-web | src/Components/ErrorOccured.res | .res | @react.component
let make = () => {
<div className="flex justify-center font-bold text-lg text-red-600">
{React.string("Error occurred")}
</div>
}
| 42 |
hyperswitch-web | src/Components/SavedMethodItem.res | .res | @react.component
let make = (~brandIcon, ~paymentItem: PaymentType.customerMethods, ~handleDelete) => {
let {themeObj, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let {hideExpiredPaymentMethods} = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom)
let isCard = paymentItem.paymentMetho... | 830 |
hyperswitch-web | src/Components/AccordionContainer.res | .res | open RecoilAtoms
module Loader = {
@react.component
let make = (~cardShimmerCount) => {
let paymentMethodList = Recoil.useRecoilValueFromAtom(paymentMethodList)
let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom)
let {layout} = Recoil.useRecoilValueFromAtom(optionAtom)
let layoutClass = CardU... | 1,691 |
hyperswitch-web | src/Components/Loader.res | .res | @react.component
let make = (~branding="auto", ~showText=true) => {
let arr = ["hyperswitch-triangle", "hyperswitch-square", "hyperswitch-circle"]
<div className="flex flex-col gap-10 justify-center items-center">
<div className="flex flex-row gap-10">
<RenderIf condition={branding === "auto"}>
{... | 463 |
hyperswitch-web | src/Components/Surcharge.res | .res | @react.component
let make = (
~paymentMethod,
~paymentMethodType,
~cardBrand=CardUtils.NOTFOUND,
~isForWallets=false,
) => {
let paymentMethodListValue = Recoil.useRecoilValueFromAtom(PaymentUtils.paymentMethodListValue)
let getPaymentMethodTypes = paymentMethodType => {
PaymentMethodsRecord.getPaymentM... | 679 |
hyperswitch-web | src/Components/PhoneNumberPaymentInput.res | .res | @react.component
let make = () => {
open RecoilAtoms
open PaymentType
open Utils
let phoneRef = React.useRef(Nullable.null)
let {fields} = Recoil.useRecoilValueFromAtom(optionAtom)
let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom)
let showDetails = getShowDetails(~billingDetails=fields.billingD... | 808 |
hyperswitch-web | src/Components/FullScreenDivDriver.res | .res | @react.component
let make = () => {
React.useEffect0(() => {
Utils.messageParentWindow([("driverMounted", true->JSON.Encode.bool)])
None
})
<div />
}
| 44 |
hyperswitch-web | src/Components/Block.res | .res | @react.component
let make = (~topElement=?, ~bottomElement=?, ~padding="p-5", ~className="") => {
let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let topBlock = switch topElement {
| Some(ele) => ele
| None => React.null
}
let actionBlock = switch bottomElement {
| Some(ele) => ele
... | 236 |
hyperswitch-web | src/Components/PortalCapture.res | .res | @react.component
let make = React.memo((~name: string) => {
let (_, setPortalNodes) = Recoil.useRecoilState(RecoilAtoms.portalNodes)
let setDiv = React.useCallback((elem: Nullable.t<Dom.element>) => {
setPortalNodes(
prevDict => {
let clonedDict =
prevDict
->Dict.toArray
... | 183 |
hyperswitch-web | src/Components/PaymentElementShimmer.res | .res | module Shimmer = {
@react.component
let make = (~children, ~classname="") => {
<div
className={`relative
${classname}
before:absolute before:inset-0
before:-translate-x-full
before:animate-[shimmer_1s_infinite]
before:bg-gradient-to-r
before:px-1
before: rounded
before:fr... | 830 |
hyperswitch-web | src/Components/FullScreenPortal.res | .res | open Utils
@val @scope(("window", "parent", "frames", `"fullscreen"`, "document"))
external getElementById: string => Dom.element = "getElementById"
@react.component
let make = (~children) => {
let (fullScreenIframeNode, setFullScreenIframeNode) = React.useState(() => Nullable.null)
React.useEffectOnEveryRender((... | 272 |
hyperswitch-web | src/Components/Terms.res | .res | @react.component
let make = (~mode: PaymentModeType.payment, ~styles: JsxDOMStyle.t={}) => {
open RecoilAtoms
let {localeString, themeObj} = Recoil.useRecoilValueFromAtom(configAtom)
let {customMessageForCardTerms, business, terms} = Recoil.useRecoilValueFromAtom(optionAtom)
let cardTermsValue =
customMessa... | 301 |
hyperswitch-web | src/Components/SavedMethods.res | .res | @react.component
let make = (
~paymentToken: RecoilAtomTypes.paymentToken,
~setPaymentToken,
~savedMethods: array<PaymentType.customerMethods>,
~loadSavedCards: PaymentType.savedCardsLoadState,
~cvcProps,
~paymentType,
~sessions,
~isClickToPayAuthenticateError,
~setIsClickToPayAuthenticateError,
) => ... | 3,236 |
hyperswitch-web | src/Components/Radio.res | .res | @react.component
let make = (
~checked,
~height="15px",
~padding="36%",
~className="default",
~marginTop="0",
~opacity="100%",
~border="2px solid currentColor",
) => {
let class = checked ? "active" : "inactive"
let nonActiveOpacity = checked ? "100%" : opacity
let css = `
input[type="radio"] {
... | 299 |
hyperswitch-web | src/Components/Input.res | .res | open RecoilAtoms
@react.component
let make = (
~isValid=None,
~id="",
~setIsValid=?,
~value,
~onChange,
~onBlur=?,
~onKeyDown=?,
~onFocus=?,
~rightIcon=React.null,
~errorString=?,
~fieldName="",
~type_="text",
~maxLength=?,
~pattern=?,
~placeholder="",
~className="",
~inputRef,
) => {
... | 677 |
hyperswitch-web | src/Components/SurchargeUtils.res | .res | type oneClickWallets = {
paymentMethodType: string,
displayName: string,
}
let oneClickWallets = [
{paymentMethodType: "apple_pay", displayName: "ApplePay"},
{paymentMethodType: "samsung_pay", displayName: "SamsungPay"},
{paymentMethodType: "paypal", displayName: "Paypal"},
{paymentMethodType: "google_pay",... | 1,055 |
hyperswitch-web | src/Components/CryptoCurrencyNetworks.res | .res | @react.component
let make = () => {
open DropdownField
let currencyVal = Recoil.useRecoilValueFromAtom(RecoilAtoms.userCurrency)
let {config, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let (cryptoCurrencyNetworks, setCryptoCurrencyNetworks) = Recoil.useRecoilState(
RecoilAtoms.cry... | 257 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.