repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 23
values | content stringlengths 0 1.73M | token_count int64 0 724k | __index_level_0__ int64 0 10.8k |
|---|---|---|---|---|---|
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 | 10,329 |
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 | 10,330 |
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 | 10,331 |
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 | 10,332 |
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 | 10,333 |
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 | 10,334 |
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 | 10,335 |
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 | 10,337 |
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 | 10,338 |
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 | 10,339 |
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 | 10,340 |
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 | 10,341 |
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 | 10,342 |
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 | 10,343 |
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 | 10,344 |
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 | 10,345 |
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 | 10,346 |
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 | 10,347 |
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 | 10,348 |
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 | 10,349 |
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 | 10,350 |
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 | 10,351 |
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 | 10,352 |
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 | 10,353 |
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 | 10,354 |
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 | 10,355 |
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 | 10,356 |
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 | 10,357 |
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 | 10,358 |
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 | 10,359 |
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 | 10,360 |
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 | 10,361 |
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 | 10,362 |
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 | 10,363 |
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 | 10,364 |
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 | 10,365 |
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 | 10,366 |
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 | 10,367 |
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 | 10,368 |
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 | 10,369 |
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 | 10,370 |
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 | 10,371 |
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 | 10,372 |
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 | 10,373 |
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 | 10,374 |
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 | 10,375 |
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 | 10,376 |
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 | 10,377 |
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 | 10,378 |
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 | 10,379 |
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 | 10,380 |
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 | 10,381 |
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 | 10,382 |
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 | 10,383 |
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 | 10,384 |
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 | 10,385 |
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 | 10,386 |
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 | 10,387 |
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 | 10,388 |
hyperswitch-web | src/Components/FullScreenDivDriver.res | .res | @react.component
let make = () => {
React.useEffect0(() => {
Utils.messageParentWindow([("driverMounted", true->JSON.Encode.bool)])
None
})
<div />
}
| 44 | 10,389 |
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 | 10,390 |
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 | 10,391 |
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 | 10,392 |
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 | 10,393 |
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 | 10,394 |
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 | 10,395 |
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 | 10,396 |
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 | 10,397 |
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 | 10,398 |
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 | 10,399 |
hyperswitch-web | src/Components/PayNowButton.res | .res | @send external postMessage: (Window.window, JSON.t, string) => unit = "postMessage"
module Loader = {
@react.component
let make = () => {
let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
<div className=" w-8 h-8 animate-spin" style={color: themeObj.colorTextSecondary}>
<Icon siz... | 692 | 10,400 |
hyperswitch-web | src/Components/InputField.res | .res | open RecoilAtoms
@react.component
let make = (
~isValid,
~id="",
~setIsValid,
~value,
~onChange,
~onBlur,
~onKeyDown=?,
~onFocus=?,
~rightIcon=React.null,
~errorString=?,
~errorStringClasses=?,
~fieldName="",
~type_="text",
~paymentType: CardThemeType.mode,
~maxLength=?,
~pattern=?,
~p... | 1,117 | 10,401 |
hyperswitch-web | src/Components/PaymentShimmer.res | .res | @react.component
let make = (~showInBlock=true) => {
open PaymentElementShimmer
let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let bottomElement =
<Shimmer classname="opacity-50">
<div
className="w-full h-2 animate-pulse"
style={backgroundColor: themeObj.colorPrim... | 124 | 10,402 |
hyperswitch-web | src/Components/PaymentRequestButtomShimmer.res | .res | module Shimmer = {
@react.component
let make = (~children) => {
<div
className="relative
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:from-transparent before:via-slate-200... | 248 | 10,403 |
hyperswitch-web | src/Components/EmailPaymentInput.res | .res | open RecoilAtoms
open Utils
@react.component
let make = (~paymentType) => {
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom)
let (email, setEmail) = Recoil.useLoggedRecoilState(userEmailAddress, "email", loggerState)
let {fields} = Recoi... | 490 | 10,404 |
hyperswitch-web | src/Components/Spinner.res | .res | @react.component
let make = () => {
let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
<div className=" w-8 h-8 animate-spin" style={color: themeObj.colorTextSecondary}>
<Icon size=32 name="loader" />
</div>
}
| 73 | 10,405 |
hyperswitch-web | src/Components/ClickToPayDetails.res | .res | @react.component
let make = (
~isSaveDetailsWithClickToPay,
~setIsSaveDetailsWithClickToPay,
~clickToPayCardBrand,
~clickToPayRememberMe,
~setClickToPayRememberMe,
) => {
let clickToPayConfig = Recoil.useRecoilValueFromAtom(RecoilAtoms.clickToPayConfig)
let {themeObj} = Recoil.useRecoilValueFromAtom(Recoi... | 1,842 | 10,406 |
hyperswitch-web | src/Components/Modal.res | .res | let close = setOpenModal => {
setOpenModal(_ => false)
setTimeout(() => {
Utils.messageParentWindow([("fullscreen", false->JSON.Encode.bool)])
}, 450)->ignore
}
@react.component
let make = (
~children,
~closeCallback=?,
~loader=false,
~showClose=true,
~testMode=true,
~setOpenModal,
~openModal,
... | 766 | 10,407 |
hyperswitch-web | src/Components/AddBankAccount.res | .res | open RecoilAtoms
open Utils
module ToolTip = {
@react.component
let make = (~openTip, ~forwardRef, ~onclick) => {
let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom)
<RenderIf condition={openTip}>
<button
className="h-auto max-w-30 w-auto cursor-pointer absolute m-1 px-1 py-2 top-[-3rem... | 840 | 10,408 |
hyperswitch-web | src/Components/ClickToPayNotYou.res | .res | open ClickToPayHelpers
open Utils
@react.component
let make = (~setIsShowClickToPayNotYou, ~isCTPAuthenticateNotYouClicked, ~setConsumerIdentity) => {
let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let (clickToPayConfig, setClickToPayConfig) = Recoil.useRecoilState(RecoilAtoms.clickToPayCon... | 1,976 | 10,409 |
hyperswitch-web | src/Components/SavedPaymentManagement.res | .res | @react.component
let make = (~savedMethods: array<PaymentType.customerMethods>, ~setSavedMethods) => {
open CardUtils
open Utils
open RecoilAtoms
let {iframeId} = Recoil.useRecoilValueFromAtom(keys)
let {config} = Recoil.useRecoilValueFromAtom(configAtom)
let customPodUri = Recoil.useRecoilValueFromAtom(cu... | 501 | 10,410 |
hyperswitch-web | src/Components/WalletShimmer.res | .res | @react.component
let make = () => {
open PaymentElementShimmer
<Shimmer classname="opacity-70">
<div
className="animate-pulse w-full h-12 rounded bg-slate-200 flex justify-center items-center ">
<div className="w-24 h-3 rounded bg-white bg-opacity-70 self-center " />
</div>
</Shimmer>
}
| 92 | 10,411 |
hyperswitch-web | src/Components/PaymentField.res | .res | open RecoilAtoms
open RecoilAtomTypes
@react.component
let make = (
~setValue=?,
~value: RecoilAtomTypes.field,
~valueDropDown=?,
~setValueDropDown=?,
~dropDownFieldName=?,
~dropDownOptions=?,
~onChange,
~onBlur=?,
~rightIcon=React.null,
~fieldName="",
~name="",
~type_="text",
~paymentType: Ca... | 1,453 | 10,412 |
hyperswitch-web | src/Components/PaymentDropDownField.res | .res | open RecoilAtoms
@react.component
let make = (
~value: RecoilAtomTypes.field,
~setValue: (RecoilAtomTypes.field => RecoilAtomTypes.field) => unit,
~fieldName,
~options,
~disabled=false,
~className="",
) => {
let {config} = Recoil.useRecoilValueFromAtom(configAtom)
let {themeObj, localeString} = Recoil.u... | 1,220 | 10,413 |
hyperswitch-web | src/Components/DropdownField.res | .res | type optionType = {
value: string,
label?: string,
displayValue?: string,
}
let updateArrayOfStringToOptionsTypeArray = arrayOfString =>
arrayOfString->Array.map(item => {
value: item,
})
let defaultValue = {
value: "",
}
open RecoilAtoms
@react.component
let make = (
~appearance: CardThemeType.app... | 1,292 | 10,414 |
hyperswitch-web | src/Components/SavedCardItem.res | .res | module RenderSavedPaymentMethodItem = {
@react.component
let make = (~paymentItem: PaymentType.customerMethods, ~paymentMethodType) => {
switch paymentItem.paymentMethod {
| "card" =>
<div
className="flex flex-col items-start"
role="group"
ariaLabel={`Card ${paymentItem.card.ni... | 2,409 | 10,415 |
hyperswitch-web | src/Components/AddressPaymentInput.res | .res | open RecoilAtoms
open PaymentType
open Utils
type addressType = Line1 | Line2 | City | Postal | State | Country
type dataModule = {states: JSON.t}
@val
external importStates: string => promise<dataModule> = "import"
let getShowType = str => {
switch str {
| "auto" => Auto
| "never" => Never
| _ => Auto
}
... | 1,920 | 10,416 |
hyperswitch-web | src/Components/BlikCodePaymentInput.res | .res | open RecoilAtoms
open Utils
@react.component
let make = () => {
let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom)
let (blikCode, setblikCode) = Recoil.useLoggedRecoilState(userBlikCode, "blikCode", loggerState)
let blikCodeRef = React.useRef(Nullable.null)
let formatBSB = bsb => {
let formatted ... | 507 | 10,417 |
hyperswitch-web | src/Components/NicknamePaymentInput.res | .res | @react.component
let make = (~paymentType: CardThemeType.mode) => {
open RecoilAtoms
open Utils
let (nickName, setNickName) = Recoil.useRecoilState(userCardNickName)
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let validateNickname = val => {
let isValid = Some(val === "" || !(val->isD... | 348 | 10,418 |
hyperswitch-web | src/Components/PaymentLoader.res | .res | @react.component
let make = () => {
open Utils
let (branding, setBranding) = React.useState(_ => "auto")
React.useEffect0(() => {
messageParentWindow([("iframeMountedCallback", true->JSON.Encode.bool)])
let handle = (ev: Window.event) => {
let json = ev.data->safeParse
let dict = json->getDic... | 233 | 10,419 |
hyperswitch-web | src/Components/DynamicFields.res | .res | module DynamicFieldsToRenderWrapper = {
@react.component
let make = (~children, ~index, ~isInside=true) => {
let {themeObj} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
<RenderIf condition={children != React.null}>
<div
key={`${isInside ? "inside" : "outside"}-billing-${index->Int.... | 5,711 | 10,420 |
hyperswitch-web | src/Components/PaymentInputField.res | .res | open RecoilAtoms
@react.component
let make = (
~isValid=Some(true),
~setIsValid=?,
~height="",
~fieldWidth="100%",
~inputFieldClassName="",
~value,
~onChange,
~onBlur=?,
~rightIcon=React.null,
~errorString=?,
~fieldName="",
~name="",
~type_="text",
~paymentType: CardThemeType.mode,
~maxLen... | 1,170 | 10,421 |
hyperswitch-web | src/Components/RenderIf.res | .res | @react.component
let make = (~condition: bool, ~children: React.element) => {
if condition {
children
} else {
React.null
}
}
| 38 | 10,422 |
hyperswitch-web | src/Components/PixPaymentInput.res | .res | @react.component
let make = (~label="") => {
open RecoilAtoms
open Utils
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let (pixCNPJ, setPixCNPJ) = Recoil.useRecoilState(userPixCNPJ)
let (pixCPF, setPixCPF) = Recoil.useRecoilState(userPixCPF)
let (pixKey, setPixKey) = Recoil.useRecoilState(... | 1,391 | 10,423 |
hyperswitch-web | src/Components/Accordion.res | .res | open RecoilAtoms
@react.component
let make = (
~paymentOption: PaymentMethodsRecord.paymentFieldsInfo,
~isActive: bool,
~checkoutEle: React.element,
~borderBottom: bool,
~borderRadiusStyle,
) => {
let {themeObj, localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let {layout, customMethodNames} = Re... | 539 | 10,424 |
hyperswitch-web | src/Components/SessionPaymentWrapper.res | .res | @react.component
let make = (~children, ~type_: SessionsType.paymentType) => {
let sessions = Recoil.useRecoilValueFromAtom(RecoilAtoms.sessions)
let loader = switch type_ {
| Others => <PaymentShimmer />
| Wallet => <WalletShimmer />
}
switch sessions {
| Loading => loader
| _ => children
}
}
| 85 | 10,425 |
hyperswitch-web | src/Components/FullNamePaymentInput.res | .res | open RecoilAtoms
open PaymentType
open Utils
@react.component
let make = (~paymentType, ~customFieldName=None, ~optionalRequiredFields=None) => {
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
let {fields} = Recoil.useRecoilValueFromAtom(optionAtom)
let loggerState = Recoil.useRecoilValueFromAtom... | 661 | 10,426 |
hyperswitch-web | src/hyper-loader/Types.res | .res | type eventData = {
iframeMounted: bool,
focus: bool,
blur: bool,
ready: bool,
clickTriggered: bool,
completeDoThis: bool,
elementType: string,
classChange: bool,
newClassType: string,
confirmTriggered: bool,
oneClickConfirmTriggered: bool,
}
type event = {key: string, data: eventData, source: Dom.... | 1,645 | 10,427 |
hyperswitch-web | src/hyper-loader/PaymentSession.res | .res | open Types
let make = (
options,
~clientSecret,
~publishableKey,
~logger: option<HyperLogger.loggerMake>,
~ephemeralKey,
~redirectionFlags: RecoilAtomTypes.redirectionFlags,
) => {
let logger = logger->Option.getOr(HyperLogger.defaultLoggerConfig)
let customPodUri =
options
->JSON.Decode.object... | 239 | 10,428 |
hyperswitch-web | src/hyper-loader/LoaderPaymentElement.res | .res | open Types
open Utils
open EventListenerManager
open Identity
@val @scope(("navigator", "clipboard"))
external writeText: string => promise<'a> = "writeText"
let onCompleteDoThisUsed = ref(false)
let isPaymentButtonHandlerProvided = ref(false)
let make = (
componentType,
options,
setIframeRef,
iframeRef,
mo... | 3,085 | 10,429 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.