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-client-core | src/types/ExternalThreeDsTypes.res | .res | type statusType = {
status: string,
message: string,
}
type sdkEphemeralKey = {
kty: string,
crv: string,
x: string,
y: string,
}
type sdkInformation = {
sdk_app_id: string,
sdk_enc_data: string,
sdk_ephem_pub_key: sdkEphemeralKey,
sdk_trans_id: string,
sdk_reference_number: string,
sdk_max_ti... | 560 |
hyperswitch-client-core | src/types/SdkTypes.res | .res | open Utils
type localeTypes =
| En
| He
| Fr
| En_GB
| Ar
| Ja
| De
| Fr_BE
| Es
| Ca
| Pt
| It
| Pl
| Nl
| NI_BE
| Sv
| Ru
| Lt
| Cs
| Sk
| Ls
| Cy
| El
| Et
| Fi
| Nb
| Bs
| Da
| Ms
| Tr_CY
type fontFamilyTypes = DefaultIOS | DefaultAndroid | CustomFont(st... | 7,441 |
hyperswitch-client-core | src/types/TabViewType.res | .res | type route = {
key: int,
icon?: string,
title: string,
accessible?: bool,
accessibilityLabel?: string,
testID?: string,
componentHoc: (
~isScreenFocus: bool,
~setConfirmButtonDataRef: React.element => unit,
) => React.element,
}
type scene = {route: route}
type navigationState = {
index: int... | 505 |
hyperswitch-client-core | src/types/PaymentMethodListType.res | .res | open Utils
type payment_experience_type = INVOKE_SDK_CLIENT | REDIRECT_TO_URL | NONE
type mandatePaymentType = {
amount: int,
currency: string,
confirm: bool,
customer_id: string,
authentication_type: string,
mandate_id: string,
off_session: bool,
business_country: string,
business_label: string,
}
t... | 3,687 |
hyperswitch-client-core | src/types/LoggerTypes.res | .res | type logType = DEBUG | INFO | ERROR | WARNING
type logCategory = API | USER_ERROR | USER_EVENT | MERCHANT_EVENT
type logComponent = MOBILE
type apiLogType = Request | Response | NoResponse | Err
type sdkVersionFetched =
| PACKAGE_JSON_NOT_STARTED
| PACKAGE_JSON_LOADING
| PACKAGE_JSON_REFERENCE_ERROR
| PACKAGE_J... | 550 |
hyperswitch-client-core | src/types/PlaidTypes.res | .res | type linkLogLevel = DEBUG | INFO | WARN | ERROR
type commonPlaidLinkOptions = {
logLevel?: linkLogLevel,
extras?: Js.Dict.t<Js.Json.t>,
}
type linkTokenConfiguration = {
token: string,
noLoadingState?: bool,
...commonPlaidLinkOptions,
}
type linkInstitution = {
id: string,
name: string,
}
type linkErr... | 226 |
hyperswitch-client-core | src/utility/libraries/ReactNativeSvg.res | .res | module Svg = {
@module("react-native-svg/src") @react.component
external make: (
~uri: string=?,
~width: float=?,
~viewBox: string=?,
~height: float=?,
~fill: string=?,
~onError: unit => unit=?,
~onLoad: unit => unit=?,
~children: React.element=?,
) => React.element = "Svg"
}
modu... | 832 |
hyperswitch-client-core | src/utility/libraries/RescriptCoreFuture.res | .res | module Dict = {
type key = string
let map = (mapper, dict) => {
dict
->Dict.toArray
->Array.map(entry => {
let (key, val) = entry
(key, mapper(val))
})
->Dict.fromArray
}
let fromList = list => {
Dict.fromArray(list->List.toArray)
}
}
module Nullable = {
external isNul... | 149 |
hyperswitch-client-core | src/utility/libraries/portal/PortalManager.res | .res | type portalItem = {
key: int,
children: React.element,
}
type portals = {
mount: (int, React.element) => unit,
update: (int, React.element) => unit,
unmount: int => unit,
}
@react.component
let make = React.forwardRef((ref: Js.Nullable.t<React.ref<Nullable.t<portals>>>) => {
let (portals, setPortals) = Re... | 319 |
hyperswitch-client-core | src/utility/libraries/portal/Portal.res | .res | @react.component
let make = (~children) => {
let portalManager = React.useContext(PortalContext.portalContext)
let currentPortalKey = React.useRef(null)
React.useEffect1(() => {
switch currentPortalKey.current->Nullable.toOption {
| Some(key) => portalManager.update(key, children)
| None => currentPo... | 147 |
hyperswitch-client-core | src/utility/libraries/portal/PortalHost.res | .res | open ReactNative
open PortalContext
@react.component
let make = (~children) => {
let managerRef = React.useRef(null)
let nextKey = React.useRef(0)
let queue = React.useRef([])
React.useEffect1(() => {
switch managerRef.current->Nullable.toOption {
| Some(manager: PortalManager.portals) =>
while ... | 480 |
hyperswitch-client-core | src/utility/libraries/portal/PortalContext.res | .res | type operation =
| Mount({key: int, children: React.element})
| Unmount({key: int})
| Update({key: int, children: React.element})
type portalMethods = {
mount: React.element => int,
update: (int, React.element) => unit,
unmount: int => unit,
}
let defaultVal = {
mount: _ => 0,
unmount: _ => (),
upda... | 151 |
hyperswitch-client-core | src/utility/libraries/bsfetch/Fetch__Iterator.ml | .ml | module Next = struct
type 'a t
external done_ : _ t -> bool option = "done" [@@bs.get]
external value : 'a t -> 'a option = "value" [@@bs.get] [@@bs.return nullable]
end
type 'a t
external next : 'a t -> 'a Next.t = "next" [@@bs.send]
let rec forEach ~f t =
let item = next t in
match Next.(done_ item, val... | 170 |
hyperswitch-client-core | src/utility/libraries/bsfetch/Fetch__Iterator.mli | .mli | (** We need to bind to JavaScript Iterators for FormData functionality.
But ideally this binding should be moved into BuckleScript itself.
@see {{: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols}} *)
module Next : sig
type 'a t
external done_ : _ t -> bool option = ... | 190 |
hyperswitch-client-core | src/utility/libraries/bsfetch/Fetch.res | .res | type body
type bodyInit
type headers
type headersInit
type response
type request
type requestInit
type abortController
type signal
/* external */
type arrayBuffer /* TypedArray */
type bufferSource /* Web IDL, either an arrayBuffer or arrayBufferView */
type formData /* XMLHttpRequest */
type readableStream /* Streams... | 3,653 |
hyperswitch-client-core | src/utility/logics/PMLUtils.res | .res | let handleCustomerPMLResponse = (
~customerSavedPMData,
~sessions: AllApiDataContext.sessions,
~isPaymentMethodManagement,
~nativeProp: SdkTypes.nativeProp,
) => {
switch customerSavedPMData {
| Some(obj) => {
let spmData = obj->PaymentMethodListType.jsonToSavedPMObj
let isSamsungDevice = native... | 647 |
hyperswitch-client-core | src/utility/logics/ThreeDsUtils.res | .res | open ExternalThreeDsTypes
let getThreeDsNextActionObj = (
nextActionObj: option<PaymentConfirmTypes.nextAction>,
): PaymentConfirmTypes.nextAction => {
nextActionObj->Option.getOr({
redirectToUrl: "",
type_: "",
threeDsData: {
threeDsAuthenticationUrl: "",
threeDsAuthorizeUrl: "",
mess... | 683 |
hyperswitch-client-core | src/utility/logics/GZipUtils.res | .res | type options = {to: string}
@module("pako")
external inflate: (Fetch.arrayBuffer, options) => string = "inflate"
let extractZipFromResp = resp => {
resp
->Promise.then(response => response->Fetch.Response.arrayBuffer)
->Promise.then(async arrayBuffer =>
arrayBuffer->inflate({
to: "string",
})
)
... | 210 |
hyperswitch-client-core | src/utility/logics/PaymentUtils.res | .res | let checkIfMandate = (paymentType: PaymentMethodListType.mandateType) => {
paymentType == NEW_MANDATE || paymentType == SETUP_MANDATE
}
let showUseExisitingSavedCardsBtn = (
~isGuestCustomer,
~pmList,
~mandateType,
~displaySavedPaymentMethods,
) => {
!isGuestCustomer &&
pmList->Option.getOr([])->Array.le... | 1,547 |
hyperswitch-client-core | src/utility/logics/Utils.res | .res | let getProp = (str, dict) => {
dict->Dict.get(str)
}
let retOptionalStr = x => {
switch x {
| Some(c) => c->JSON.Decode.string
| None => None
}
}
let retOptionalFloat = x => {
switch x {
| Some(c) => c->JSON.Decode.float
| None => None
}
}
let getOptionString = (dict, key) => {
dict->Dict.get(key)... | 2,550 |
hyperswitch-client-core | src/utility/logics/Window.res | .res | type listener<'ev> = 'ev => unit
@val @scope("window") @val
external postMessage: (string, string) => unit = "postMessage"
@val @scope(("window", "parent")) @val
external postMessageToParent: (string, string) => unit = "postMessage"
@val @scope("window")
external addEventListener: (string, listener<'ev>) => unit = "... | 1,941 |
hyperswitch-client-core | src/utility/logics/LoggerUtils.res | .res | open LoggerTypes
let eventToStrMapper = (eventName: eventName) => {
(eventName :> string)
}
let sdkVersionRef = ref(PACKAGE_JSON_NOT_STARTED)
let logFileToObj = logFile => {
[
("timestamp", logFile.timestamp->JSON.Encode.string),
(
"log_type",
switch logFile.logType {
| DEBUG => "DEBUG"
... | 877 |
hyperswitch-client-core | src/utility/logics/UIUtils.res | .res | module RenderIf = {
@react.component
let make = (~condition, ~children) => {
if condition {
children
} else {
React.null
}
}
}
| 42 |
hyperswitch-client-core | src/utility/reusableCodeFromWeb/PostalCodes.res | .res | type postalCodes = {
@dead note: string,
@dead country: string,
iso: string,
@dead format: string,
regex: string,
}
let defaultPostalCode = {
note: "",
country: "",
iso: "",
format: "",
regex: "",
}
let postalCode = [
{
note: "The first two digits (ranging from 10–43) correspond to the provinc... | 14,693 |
hyperswitch-client-core | src/utility/reusableCodeFromWeb/ErrorUtils.res | .res | type errorType = Error | Warning
type errorStringType = Dynamic(string => string) | Static(string)
type errorTupple = (errorType, errorStringType)
type errorKey =
| INVALID_PK(errorTupple)
| INVALID_EK(errorTupple)
| DEPRECATED_LOADSTRIPE(errorTupple)
| REQUIRED_PARAMETER(errorTupple)
| UNKNOWN_KEY(errorTuppl... | 878 |
hyperswitch-client-core | src/utility/reusableCodeFromWeb/StatesAndCountry.json | .json | {"country":[{"isoAlpha2":"AF","value":"Afghanistan","timeZones":["Asia/Kabul"]},{"isoAlpha2":"AX","value":"Aland Islands","timeZones":["Europe/Mariehamn"]},{"isoAlpha2":"AL","value":"Albania","timeZones":["Europe/Tirane"]},{"isoAlpha2":"DZ","value":"Algeria","timeZones":["Africa/Algiers"]},{"isoAlpha2":"AS","value":"Am... | 68,064 |
hyperswitch-client-core | src/utility/reusableCodeFromWeb/Validation.res | .res | type cardIssuer =
| VISA
| MASTERCARD
| AMEX
| MAESTRO
| DINERSCLUB
| DISCOVER
| BAJAJ
| SODEXO
| RUPAY
| JCB
| CARTESBANCAIRES
| NOTFOUND
let toInt = val => val->Int.fromString->Option.getOr(0)
let cardType = val => {
switch val->String.toUpperCase {
| "VISA" => VISA
| "MASTERCARD" => M... | 5,183 |
hyperswitch-client-core | src/utility/reusableCodeFromWeb/Bank.res | .res | type bank = {
displayName: string,
hyperSwitch: string,
}
let bankNameConverter = (var: array<string>) => {
let final = var->Array.map(item => {
let x =
item
->String.split("_")
->Array.map(w => {
w->String.charAt(0)->String.toUpperCase ++ w->String.sliceToEnd(~start=1)
})
... | 120 |
hyperswitch-client-core | src/utility/reusableCodeFromWeb/ErrorHooks.res | .res | let useShowErrorOrWarning = () => {
let customAlert = AlertHook.useAlerts()
(inputKey: ErrorUtils.errorKey, ~dynamicStr="", ()) => {
let (type_, str) = switch inputKey {
| INVALID_PK(var) => var
| INVALID_EK(var) => var
| DEPRECATED_LOADSTRIPE(var) => var
| REQUIRED_PARAMETER(var) => var
| U... | 671 |
hyperswitch-client-core | src/utility/constants/GlobalVars.res | .res | type envType = INTEG | SANDBOX | PROD
let checkEnv = publishableKey => {
if publishableKey != "" && publishableKey->String.startsWith("pk_prd_") {
PROD
} else {
SANDBOX
}
}
let isValidPK = (env: envType, publishableKey) => {
switch (env, publishableKey) {
| (_, "") => false
| (PROD, pk) => pk->Str... | 154 |
hyperswitch-client-core | src/utility/constants/GlobalHooks.res | .res | let useGetBaseUrl = () => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
() => {
switch nativeProp.customBackendUrl {
| Some(url) => url
| None =>
switch nativeProp.env {
| PROD => "https://api.hyperswitch.io"
| SANDBOX => "https://sandbox.hyperswitch.io"... | 415 |
hyperswitch-client-core | src/utility/constants/SdkStatusMessages.res | .res | type statusMessages = {
successMsg: string,
errorMsg: string,
apiCallFailure: string,
}
let retrievePaymentStatus = {
successMsg: "payment successful",
errorMsg: "payment failed",
apiCallFailure: "retrieve failure, cannot fetch the status of payment",
}
let pollingCallStatus = {
successMsg: "polling sta... | 293 |
hyperswitch-client-core | src/utility/config/next/NextImpl.native.res | .res | 1 | |
hyperswitch-client-core | src/utility/test/TestUtils.res | .res | let cardNumberInputTestId = "CardNumberInputTestId"
let cvcInputTestId = "CVCInputTestId"
let expiryInputTestId = "ExpiryInputTestId"
let payButtonTestId = "PayButtonTestId"
| 45 |
hyperswitch-client-core | src/contexts/CountryStateDataContext.res | .res | type data =
| Localdata(CountryStateDataHookTypes.countryStateData)
| FetchData(CountryStateDataHookTypes.countryStateData)
| Loading
let countryStateDataContext = React.createContext((Loading, () => ()))
module Provider = {
let make = React.Context.provider(countryStateDataContext)
}
module WrapperProvider ... | 763 |
hyperswitch-client-core | src/contexts/PaymentScreenContext.res | .res | type paymentScreenType = PAYMENTSHEET | SAVEDCARDSCREEN
let dafaultVal = SAVEDCARDSCREEN
let paymentScreenTypeContext = React.createContext((dafaultVal, (_: paymentScreenType) => ()))
module Provider = {
let make = React.Context.provider(paymentScreenTypeContext)
}
@react.component
let make = (~children) => {
let... | 130 |
hyperswitch-client-core | src/contexts/LocaleStringDataContext.res | .res | type data =
| Loading
| Some(LocaleDataType.localeStrings)
let localeDataContext = React.createContext((Loading, (_: data => data) => ()))
module Provider = {
let make = React.Context.provider(localeDataContext)
}
@react.component
let make = (~children) => {
let (state, setState) = React.useState(_ => Loadin... | 406 |
hyperswitch-client-core | src/contexts/AllApiDataContext.res | .res | type retryObject = {
processor: string,
redirectUrl: string,
}
type additionalPMLData = {
retryEnabled: option<retryObject>,
redirect_url: option<string>,
mandateType: PaymentMethodListType.mandateType,
paymentType: option<string>,
merchantName: option<string>,
requestExternalThreeDsAuthentication: opt... | 508 |
hyperswitch-client-core | src/contexts/CardDataContext.res | .res | type cardData = {
cardNumber: string,
expireDate: string,
cvv: string,
zip: string,
isCardNumberValid: option<bool>,
isCardBrandSupported: option<bool>,
isExpireDataValid: option<bool>,
isCvvValid: option<bool>,
isZipValid: option<bool>,
cardBrand: string,
selectedCoBadgedCardBrand: option<string>... | 254 |
hyperswitch-client-core | src/contexts/NativePropContext.res | .res | let defaultValue: SdkTypes.nativeProp = SdkTypes.nativeJsonToRecord(JSON.Encode.null, 1)
let defaultSetter = (_: SdkTypes.nativeProp) => ()
let nativePropContext = React.createContext((defaultValue, defaultSetter))
module Provider = {
let make = React.Context.provider(nativePropContext)
}
@react.component
let mak... | 185 |
hyperswitch-client-core | src/contexts/LoggerContext.res | .res | let defaultSetter = (_: Dict.t<float>) => ()
let loggingContext = React.createContext((Dict.make(), defaultSetter))
module Provider = {
let make = React.Context.provider(loggingContext)
}
@react.component
let make = (~children) => {
let (state, setState) = React.useState(_ => Dict.make())
let setState = React.us... | 104 |
hyperswitch-client-core | src/contexts/ThemeContext.res | .res | type appObj = SdkTypes.appearance
type themeType = Light(appObj) | Dark(appObj)
let defaultValue: themeType = Light(SdkTypes.defaultAppearance)
let defaultSetter = (_: themeType) => ()
let themeContext = React.createContext((defaultValue, defaultSetter))
module Provider = {
let make = React.Context.provider(themeCo... | 221 |
hyperswitch-client-core | src/contexts/LoadingContext.res | .res | type processingPayments = {showOverlay: bool}
type sdkPaymentState =
| FillingDetails
| ProcessingPayments(option<processingPayments>)
| PaymentSuccess
| PaymentCancelled
let defaultSetter = (_: sdkPaymentState) => ()
let loadingContext = React.createContext((FillingDetails, defaultSetter))
module Provider = {... | 176 |
hyperswitch-client-core | src/contexts/ViewportContext.res | .res | type viewPortContants = {
windowHeight: float,
windowWidth: float,
screenHeight: float,
screenWidth: float,
navigationBarHeight: float,
maxPaymentSheetHeight: float,
}
let defaultNavbarHeight = 25.
let windowHeight = ReactNative.Dimensions.get(#window).height
let windowWidth = ReactNative.Dimensions.get(#w... | 326 |
hyperswitch-client-core | src/icons/ChevronIcon.res | .res | open ReactNative
open Style
@react.component
let make = (~width=20., ~height=16., ~fill="#ffffff") => {
<Icon
style={viewStyle(~transform=[rotate(~rotate=270.->deg)], ())}
name="back"
height
width
fill
/>
}
| 75 |
hyperswitch-client-core | src/icons/Icon.res | .res | let card = `<svg class="p-Icon p-Icon--card Icon p-Icon--md p-TabIcon TabIcon p-TabIcon--selected TabIcon--selected" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 4a2 2 0 012-2h12a2 2 0 012 2H0zm0 2v6a2 2 0 002 2h12a2 2 0 002-2V6H0zm3 5a1 ... | 29,456 |
hyperswitch-client-core | src/headless/Headless.res | .res | open SdkTypes
open HeadlessUtils
open HeadlessNative
let reRegisterCallback = ref(() => ())
let registerHeadless = headless => {
let headlessModule = initialise(headless)
let getDefaultPaymentSession = error => {
headlessModule.getPaymentSession(
error->Utils.getJsonObjectFromRecord,
error->Utils... | 4,139 |
hyperswitch-client-core | src/headless/HeadlessUtils.res | .res | open SdkTypes
let sendLogs = (logFile, customLogUrl, env: GlobalVars.envType) => {
let uri = switch customLogUrl {
| Some(url) => url
| None =>
switch env {
| PROD => "https://api.hyperswitch.io/logs/sdk"
| _ => "https://sandbox.hyperswitch.io/logs/sdk"
}
}
if WebKit.platform != #next {
l... | 3,905 |
hyperswitch-client-core | src/headless/HeadlessNative.res | .res | open ReactNative
type headlessModule = {
initialisePaymentSession: (JSON.t => unit) => unit,
getPaymentSession: (JSON.t, JSON.t, JSON.t, JSON.t => unit) => unit,
exitHeadless: string => unit,
}
let getFunctionFromModule = (dict: Dict.t<'a>, key: string, default: 'b): 'b => {
switch dict->Dict.get(key) {
| S... | 310 |
hyperswitch-client-core | src/components/modules/SamsungPayModule.res | .res | open ExternalThreeDsTypes
type module_ = {
checkSamsungPayValidity: (string, statusType => unit) => unit,
presentSamsungPayPaymentSheet: (
(statusType, option<SamsungPayType.addressCollectedFromSpay>) => unit
) => unit,
isAvailable: bool,
}
@val external require: string => module_ = "require"
let (checkS... | 163 |
hyperswitch-client-core | src/components/modules/ScanCardModule.res | .res | type scanCardData = {
pan: string,
expiryMonth: string,
expiryYear: string,
}
type scanCardReturnType = {
status: string,
data: scanCardData,
}
type scanCardReturnStatus = Succeeded(scanCardData) | Failed | Cancelled | None
type module_ = {launchScanCard: (scanCardReturnType => unit) => unit, isAvailable: boo... | 308 |
hyperswitch-client-core | src/components/modules/KountModule.res | .res | type module_ = {launchKount: (string, Dict.t<JSON.t> => unit) => unit}
@val external require: string => module_ = "require"
let launchKountMod = switch try {
require("react-native-hyperswitch-kount")->Some
} catch {
| _ => None
} {
| Some(mod) => mod.launchKount
| None => (_, _) => ()
}
let launchKountIfAvailable ... | 163 |
hyperswitch-client-core | src/components/modules/KlarnaModule.res | .res | type params = {
@dead
authorized: bool,
approved: bool,
authToken: option<string>,
errorMessage: option<string>,
}
type event = {nativeEvent: params}
type element = {
initialize: (string, option<string>) => unit,
load: unit => unit,
authorize: unit => unit,
}
type moduleProps = {
key: string,
cate... | 304 |
hyperswitch-client-core | src/components/modules/ErrorBoundary.res | .res | let defaultFallback = (fallbackArg: Sentry.fallbackArg, level, rootTag) => {
<FallBackScreen error=fallbackArg level rootTag />
}
@react.component
let make = (~children, ~renderFallback=defaultFallback, ~level, ~rootTag) => {
<Sentry.ErrorBoundary fallback={e => renderFallback(e, level, rootTag)}>
children
<... | 89 |
hyperswitch-client-core | src/components/modules/ReactModule.res | .res | @module("react")
external useEffect: (unit => option<unit => unit>) => unit = "useEffect"
| 24 |
hyperswitch-client-core | src/components/modules/HyperModule.res | .res | type hyperModule = {
sendMessageToNative: string => unit,
launchApplePay: (string, Dict.t<JSON.t> => unit) => unit,
startApplePay: (string, Dict.t<JSON.t> => unit) => unit,
presentApplePay: (string, Dict.t<JSON.t> => unit) => unit,
launchGPay: (string, Dict.t<JSON.t> => unit) => unit,
exitPaymentsheet: (int... | 1,531 |
hyperswitch-client-core | src/components/modules/PaypalModule.res | .res | type module_ = {launchPayPal: (string, Dict.t<JSON.t> => unit) => unit}
@val external require: string => module_ = "require"
let payPalModule = try {
require("react-native-hyperswitch-paypal")->Some
} catch {
| _ => None
}
let launchPayPalMod = switch payPalModule {
| Some(mod) => mod.launchPayPal
| None => (_, _)... | 136 |
hyperswitch-client-core | src/components/modules/Sentry.res | .res | type integration = unit
type instrumentation = unit
type sentryInitArg = {
dsn: string,
environment: string,
integrations?: array<integration>,
tracesSampleRate: float,
tracePropagationTargets?: array<string>,
replaysSessionSampleRate?: float,
replaysOnErrorSampleRate?: float,
deactivateStacktraceMergi... | 615 |
hyperswitch-client-core | src/components/modules/Netcetera3dsModule.res | .res | open ExternalThreeDsTypes
type module_ = {
initialiseNetceteraSDK: (string, string, statusType => unit) => unit,
generateAReqParams: (string, string, (statusType, aReqParams) => unit) => unit,
recieveChallengeParamsFromRN: (
string,
string,
string,
string,
statusType => unit,
option<strin... | 264 |
hyperswitch-client-core | src/components/modules/ApplePayButtonView/ApplePayButtonView.res | .res | open ReactNative
type props = {
buttonType?: SdkTypes.applePayButtonType,
buttonStyle?: SdkTypes.applePayButtonStyle,
cornerRadius?: float,
style?: Style.t,
}
@module("./ApplePayButtonViewImpl")
external make: React.component<props> = "make"
| 65 |
hyperswitch-client-core | src/components/modules/ApplePayButtonView/ApplePayButtonViewImpl.web.res | .res | open ReactNative
@react.component
let make = (~cornerRadius: float, ~style: Style.t) => {
let styleDict =
style
->JSON.stringifyAny
->Option.getOr("")
->Js.Json.parseExn
->Utils.getDictFromJson
let height =
styleDict
->Utils.getOptionFloat("height")
->Option.getOr(100.)
->Float... | 243 |
hyperswitch-client-core | src/components/modules/ApplePayButtonView/ApplePayButtonViewImpl.android.res | .res | type props
let make: React.component<props> = _ => React.null
| 17 |
hyperswitch-client-core | src/components/modules/ApplePayButtonView/ApplePayButtonViewImpl.ios.res | .res | open ReactNative
type props = {
buttonType?: SdkTypes.applePayButtonType,
buttonStyle?: SdkTypes.applePayButtonStyle,
cornerRadius?: float,
style?: Style.t,
}
let make: React.component<props> = NativeModules.requireNativeComponent("ApplePayView")
| 63 |
hyperswitch-client-core | src/components/modules/GooglePayButtonView/GooglePayButtonViewImpl.android.res | .res | type props = {
buttonType?: SdkTypes.googlePayButtonType,
borderRadius?: float,
buttonStyle?: ReactNative.Appearance.t,
style?: ReactNative.Style.t,
allowedPaymentMethods?: string,
}
let make: React.component<props> = ReactNative.NativeModules.requireNativeComponent(
"GooglePayButton",
)
| 69 |
hyperswitch-client-core | src/components/modules/GooglePayButtonView/GooglePayButtonViewImpl.web.res | .res | open ReactNative
@react.component
let make = (~borderRadius: float, ~style: Style.t) => {
<View nativeID="google-wallet-button-container" style={style}>
<style>
{React.string(`
.gpay-card-info-container.black, .gpay-card-info-animation-container.black {
background-color: #000 !importa... | 125 |
hyperswitch-client-core | src/components/modules/GooglePayButtonView/GooglePayButtonView.res | .res | type props = {
buttonType?: SdkTypes.googlePayButtonType,
borderRadius?: float,
buttonStyle?: ReactNative.Appearance.t,
style?: ReactNative.Style.t,
allowedPaymentMethods?: string,
}
@module("./GooglePayButtonViewImpl")
external make: React.component<props> = "make"
| 66 |
hyperswitch-client-core | src/components/modules/GooglePayButtonView/GooglePayButtonViewImpl.ios.res | .res | type props = {
buttonType?: SdkTypes.googlePayButtonType,
borderRadius?: float,
buttonStyle?: ReactNative.Appearance.t,
style?: ReactNative.Style.t,
allowedPaymentMethods?: string,
}
let make: React.component<props> = _ => React.null
| 59 |
hyperswitch-client-core | src/components/modules/Plaid/PlaidImpl.android.res | .res | /**
Checks if native modules for sdk have been imported as optional dependency
*/
let isAvailable =
Dict.get(ReactNative.NativeModules.nativeModules, "PlaidAndroid")
->Option.flatMap(JSON.Decode.object)
->Option.isSome
| 49 |
hyperswitch-client-core | src/components/modules/Plaid/PlaidImpl.ios.res | .res | /**
Checks if native modules for sdk have been imported as optional dependency
*/
let isAvailable =
Dict.get(ReactNative.NativeModules.nativeModules, "RNLinksdk")
->Option.flatMap(JSON.Decode.object)
->Option.isSome
| 49 |
hyperswitch-client-core | src/components/modules/Plaid/PlaidImpl.web.res | .res | /**
Checks if native modules for sdk have been imported as optional dependency.
Not available in web via plaid-link-sdk.
*/
let isAvailable = false
| 31 |
hyperswitch-client-core | src/components/modules/Plaid/Plaid.res | .res | open PlaidTypes
type module_ = {
create: linkTokenConfiguration => unit,
@as("open") open_: linkOpenProps => promise<unit>,
dismissLink: unit => unit,
}
@module("./PlaidImpl")
external isAvailable: bool = "isAvailable"
@val external require: string => module_ = "require"
/**
Plaid Link React Native SDK
*/
let... | 194 |
hyperswitch-client-core | src/components/elements/ModalHeader.res | .res | open ReactNative
open Style
@react.component
let make = (~onModalClose) => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
let {iconColor} = ThemebasedStyle.useThemeBasedStyle()
let (paymentScreenType, _) = React.useContext(PaymentScreenContext.paymentScreenTypeContext)
let (allAp... | 555 |
hyperswitch-client-core | src/components/elements/CardElement.res | .res | open Validation
type cardFormType = {isZipAvailable: bool}
type viewType = PaymentSheet | CardForm(cardFormType)
@react.component
let make = (
~setIsAllValid,
~viewType=PaymentSheet,
~reset: bool,
~keyToTrigerButtonClickError=0,
~cardNetworks=?,
) => {
let isZipAvailable = switch viewType {
| CardForm(ca... | 1,954 |
hyperswitch-client-core | src/components/elements/PaymentSheetUi.res | .res | open ReactNative
open Style
open Validation
@react.component
let make = (
~cardNumber,
~cvv,
~expireDate,
~onChangeCardNumber,
~onChangeCardExpire,
~onChangeCvv,
~isCardNumberValid,
~isExpireDataValid,
~isCardBrandSupported,
~isCvvValid,
~onScanCard,
~keyToTrigerButtonClickError,
~cardNetwork... | 2,335 |
hyperswitch-client-core | src/components/elements/TubeSpinner.res | .res | open ReactNative
open Style
open ReactNativeSvg
@react.component
let make = (~loaderColor=?, ~size=?) => {
let {iconColor} = ThemebasedStyle.useThemeBasedStyle()
let iconColor = switch loaderColor {
| Some(color) => color
| None => iconColor
}
let size = switch size {
| Some(size) => size
| None => 18... | 635 |
hyperswitch-client-core | src/components/elements/HyperSwitchBranding.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
<UIUtils.RenderIf condition={!nativeProp.hyperParams.disableBranding}>
<Space />
<View style={viewStyle(~alignItems=#center, ())}>
<View
style={viewStyle(... | 247 |
hyperswitch-client-core | src/components/elements/CardFormUi.res | .res | open ReactNative
open Style
open Validation
@react.component
let make = (
~cardNumber,
~cvv,
~expireDate,
~isZipAvailable=false,
~zip,
~onChangeCardNumber,
~onChangeCardExpire,
~onChangeCvv,
~onChangeZip,
~isCardNumberValid,
~isExpireDataValid,
~isCvvValid,
~isZipValid,
) => {
let (nativePro... | 2,485 |
hyperswitch-client-core | src/components/elements/ScrollableCustomTopBar.res | .res | open ReactNative
open Style
module BottomTabList = {
@react.component
let make = (
~item: PMListModifier.hoc,
~index: int,
~indexInFocus: int,
~setIndexToScrollParentFlatList,
) => {
let isFocused = index == indexInFocus
let routeName = item.name
let isLoading = routeName == "loading"... | 928 |
hyperswitch-client-core | src/components/elements/Klarna.res | .res | open ReactNative
@react.component
let make = (
~launchKlarna: option<PaymentMethodListType.payment_method_types_pay_later>,
~return_url,
~klarnaSessionTokens: string,
~processRequest: (PaymentMethodListType.payment_method_types_pay_later, string) => unit,
) => {
let (_paymentViewLoaded, setpaymentViewLoaded)... | 621 |
hyperswitch-client-core | src/components/elements/FallBackScreen.res | .res | open ReactNative
open Style
type level = Top | Screen | Widget
@react.component
let make = (~error: Sentry.fallbackArg, ~level: level, ~rootTag) => {
let {simplyExit} = HyperModule.useExitPaymentsheet()
switch level {
| Top =>
<SafeAreaView style={viewStyle(~flex=1., ~alignItems=#center, ~justifyContent=#"... | 782 |
hyperswitch-client-core | src/components/elements/RedirectionText.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let {component} = ThemebasedStyle.useThemeBasedStyle()
let localeObject = GetLocale.useGetLocalObj()
<View style={viewStyle(~flexDirection=#row, ())}>
<Icon name="redirection" width=40. height=35. fill=component.color />
<Space width=10. />... | 135 |
hyperswitch-client-core | src/components/elements/ButtonElement.res | .res | open ReactNative
open Style
open PaymentMethodListType
type item = {
linearGradientColorTuple: option<ThemebasedStyle.buttonColorConfig>,
name: string,
iconName: string,
iconNameRight: option<string>,
}
@react.component
let make = (
~walletType: PaymentMethodListType.payment_method_types_wallet,
~sessionO... | 5,036 |
hyperswitch-client-core | src/components/elements/LoadingOverlay.res | .res | open ReactNative
open Style
switch UIManager.setLayoutAnimationEnabledExperimental {
| None => ()
| Some(setEnabled) => setEnabled(true)
}
@react.component
let make = () => {
let {bgColor, borderRadius} = ThemebasedStyle.useThemeBasedStyle()
let (loading, _) = React.useContext(LoadingContext.loadingContext)
let... | 536 |
hyperswitch-client-core | src/components/elements/CardSchemeComponent.res | .res | open ReactNative
open Style
module CardSchemeItem = {
@react.component
let make = (~onPress, ~item, ~index) => {
<CustomTouchableOpacity key={index->Int.toString} onPress>
<View
style={viewStyle(~flexDirection=#row, ~alignItems=#center, ~paddingVertical=5.->dp, ())}>
<Icon name={item} hei... | 1,139 |
hyperswitch-client-core | src/components/elements/ConfirmButton.res | .res | @react.component
let make = (
~loading: bool,
~isAllValuesValid: bool,
~handlePress: ReactNative.Event.pressEvent => unit,
~hasSomeFields=?,
~paymentMethod: string,
~paymentExperience=?,
~errorText=None,
) => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
let (allApiData... | 259 |
hyperswitch-client-core | src/components/elements/PaymentSheetProcessingElement.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let {component} = ThemebasedStyle.useThemeBasedStyle()
let (paymentProcessingText, setPaymentProcessingText) = React.useState(_ => ".")
React.useEffect1(() => {
let intervalId = setTimeout(() => {
let newState = switch paymentProcessingT... | 347 |
hyperswitch-client-core | src/components/common/Pager.res | .res | open ReactNative
open Style
let deadZone = 12.0
@get external getValue: ReactNative.Animated.Value.t => float = "_value"
@get external getOffset: ReactNative.Animated.Value.t => float = "_offset"
type defaultTransitionSpec = {
timing: (Animated.value<Animated.regular>, Animated.Value.Spring.config) => Animated.Ani... | 2,540 |
hyperswitch-client-core | src/components/common/SceneMap.res | .res | module SceneComponent = {
@react.component
let make = React.memo((
~component: (~route: TabViewType.route, ~position: int, ~jumpTo: int => unit) => React.element,
~route: TabViewType.route,
~jumpTo: int => unit,
~position: int,
) => component(~route, ~position, ~jumpTo))
}
let sceneMap = (
scen... | 199 |
hyperswitch-client-core | src/components/common/SceneMap.js | .js | import * as React from 'react';
const SceneComponent = React.memo(({
component,
...rest
}) => {
return React.createElement(component, rest);
}
);
export function SceneMap(scenes) {
return ({ route, jumpTo, position }) => (
<SceneComponent
key={route.key}
component={scenes[route.key]}
rou... | 97 |
hyperswitch-client-core | src/components/common/CustomButton.res | .res | open ReactNative
open Style
type buttonState = Normal | LoadingButton | Completed | Disabled
type buttonType = Primary
type iconType = CustomIcon(React.element) | NoIcon
@react.component
let make = (
~loadingText="Loading..",
~buttonState: buttonState=Normal,
~text=?,
~name as _=?,
~buttonType: buttonType=... | 1,072 |
hyperswitch-client-core | src/components/common/CustomInput.res | .res | open ReactNative
open Style
type iconType =
| NoIcon
| CustomIcon(React.element)
@react.component
let make = (
~state,
~setState,
~placeholder="Enter the text here",
~placeholderTextColor=None,
~width=100.->pct,
~height: float=46.,
~secureTextEntry=false,
~keyboardType=#default,
~iconLeft: iconT... | 1,887 |
hyperswitch-client-core | src/components/common/TextWithLine.res | .res | open ReactNative
open Style
@react.component
let make = (~text) => {
<View style={viewStyle(~alignItems=#center, ~justifyContent=#center, ~flexDirection=#row, ())}>
<View
style={viewStyle(
~height=1.->dp,
~marginHorizontal=10.->dp,
~backgroundColor="#CCCCCC",
~flex=1.,
... | 158 |
hyperswitch-client-core | src/components/common/ReImage.res | .res | open ReactNative
open Style
@react.component
let make = (~uri, ~style=viewStyle(~width=33.->dp, ~height=33.->dp, ())) => {
<Image style source={Image.Source.fromUriSource({uri: uri})} />
}
| 62 |
hyperswitch-client-core | src/components/common/CustomSelectBox.res | .res | @react.component
let make = (~initialIconName, ~updateIconName, ~isSelected, ~fillIcon) => {
let {primaryColor} = ThemebasedStyle.useThemeBasedStyle()
let fill = fillIcon ? Some(primaryColor) : None
switch updateIconName {
| None => <Icon name={initialIconName} height=18. width=18. ?fill />
| Some(updateIcon... | 202 |
hyperswitch-client-core | src/components/common/CustomView.res | .res | open ReactNative
open Style
type modalPosition = [#center | #top | #bottom]
@react.component
let make = (
~onDismiss=() => (),
~children,
~closeOnClickOutSide=true,
~modalPosition=#bottom,
~bottomModalWidth=100.->pct,
(),
) => {
let (viewPortContants, _) = React.useContext(ViewportContext.viewPortContext... | 728 |
hyperswitch-client-core | src/components/common/CustomRadioButton.res | .res | open ReactNative
open Style
@react.component
let make = (~size=18., ~selected, ~color="#006DF9") => {
<View
style={viewStyle(
~height=size->dp,
~width=size->dp,
~borderRadius=size /. 2.,
~borderWidth=1.,
~borderColor=selected ? color : "lightgray",
~alignItems=#center,
~j... | 171 |
hyperswitch-client-core | src/components/common/Space.res | .res | open ReactNative
open Style
@react.component
let make = (~width=15., ~height=15.) => {
<View style={viewStyle(~height=height->dp, ~width=width->dp, ())} />
}
| 53 |
hyperswitch-client-core | src/components/common/SceneView.res | .res | open ReactNative
open Style
type handleEnter = int => unit
@live
type timerFunctionType = {unsubscribe: option<int => int>, timer: option<timeoutId>}
@react.component
let make = (
~children: (~loading: bool) => React.element,
~position as _,
~jumpTo as _,
~indexInFocus,
~lazy_,
~layout: Event.ScrollEvent.... | 485 |
hyperswitch-client-core | src/components/common/Loadericon.res | .res | open ReactNative
open Style
@react.component
let make = (~iconColor=?, ~size=ActivityIndicator.Small) => {
let {component} = ThemebasedStyle.useThemeBasedStyle()
let loderColor = switch iconColor {
| Some(color) => color
| None => component.color
}
<ActivityIndicator
animating={true} size color=loderCo... | 102 |
hyperswitch-client-core | src/components/common/TextWrapper.res | .res | open ReactNative
open Style
type textType =
| HeadingBold
| Heading
| Subheading
| SubheadingBold
| ModalTextLight
| ModalText
| ModalTextBold
| PlaceholderText
| PlaceholderTextBold
| ErrorText
| ErrorTextBold
| ButtonText
| ButtonTextBold
| LinkText
| LinkTextBold
| CardTextBold
| C... | 1,205 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.