From 57ea1ed0483776df98abbbd83b0958674be6490c Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:56:26 +0530 Subject: [PATCH 01/14] fix: customer payment methods promise (#266) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/Components/SavedMethods.res | 17 +++- src/LoaderController.res | 100 ++++++++++++++------ src/LocaleString.res | 9 ++ src/PaymentElement.res | 55 +++++++---- src/Types/ConfirmType.res | 4 + src/Types/PaymentType.res | 2 +- src/orca-loader/Elements.res | 56 ++++++----- src/orca-loader/Hyper.res | 139 +++++++++++++++++----------- src/orca-log-catcher/OrcaLogger.res | 1 + 9 files changed, 254 insertions(+), 129 deletions(-) diff --git a/src/Components/SavedMethods.res b/src/Components/SavedMethods.res index faea4606f..be7812e29 100644 --- a/src/Components/SavedMethods.res +++ b/src/Components/SavedMethods.res @@ -14,10 +14,12 @@ let make = ( let (showFields, setShowFields) = Recoil.useRecoilState(RecoilAtoms.showCardFieldsAtom) let areRequiredFieldsValid = Recoil.useRecoilValueFromAtom(RecoilAtoms.areRequiredFieldsValid) let (requiredFieldsBody, setRequiredFieldsBody) = React.useState(_ => Dict.make()) + let loggerState = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom) let setUserError = message => { postFailedSubmitResponse(~errortype="validation_error", ~message) + loggerState.setLogError(~value=message, ~eventName=INVALID_FORMAT, ()) } - let loggerState = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom) + let intent = PaymentHelpers.usePaymentIntent(Some(loggerState), Card) let (token, _) = paymentToken let savedCardlength = savedMethods->Array.length @@ -81,6 +83,7 @@ let make = ( }) ->Array.get(0) ->Option.getOr(PaymentType.defaultCustomerMethods) + let isUnknownPaymentMethod = customerMethod.paymentMethod === "" let isCardPaymentMethod = customerMethod.paymentMethod === "card" let isCardPaymentMethodValid = !customerMethod.requiresCvv || (complete && !empty) @@ -108,7 +111,12 @@ let make = ( } if confirm.doSubmit { - if areRequiredFieldsValid && (!isCardPaymentMethod || isCardPaymentMethodValid) { + if ( + areRequiredFieldsValid && + !isUnknownPaymentMethod && + (!isCardPaymentMethod || isCardPaymentMethodValid) && + confirm.confirmTimestamp >= confirm.readyTimestamp + ) { intent( ~bodyArr=savedPaymentMethodBody ->Dict.fromArray @@ -121,7 +129,10 @@ let make = ( (), ) } else { - if cvcNumber === "" { + if isUnknownPaymentMethod || confirm.confirmTimestamp < confirm.readyTimestamp { + setUserError(localeString.selectPaymentMethodText) + } + if !isUnknownPaymentMethod && cvcNumber === "" { setCvcError(_ => localeString.cvcNumberEmptyText) setUserError(localeString.enterFieldsText) } diff --git a/src/LoaderController.res b/src/LoaderController.res index 1d354db58..3ad0797f5 100644 --- a/src/LoaderController.res +++ b/src/LoaderController.res @@ -131,7 +131,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime showCardFormByDefault && Utils.checkPriorityList(paymentMethodOrder) ? SemiLoaded : Loading | x => x } - let finalLoadLatency = Js.Date.now() -. launchTime + let finalLoadLatency = Date.now() -. launchTime switch updatedState { | Loaded(_) => logger.setLogInfo(~value="Loaded", ~eventName=LOADER_CHANGED, ~latency=finalLoadLatency, ()) @@ -165,14 +165,6 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime }, ) }) - React.useEffect(() => { - switch paymentlist { - | SemiLoaded => () - | Loaded(_val) => handlePostMessage([("ready", true->JSON.Encode.bool)]) - | _ => handlePostMessage([("ready", false->JSON.Encode.bool)]) - } - None - }, [paymentlist]) React.useEffect(() => { CardUtils.genreateFontsLink(config.fonts) @@ -365,7 +357,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime } if dict->getDictIsSome("paymentMethodList") { let list = dict->getJsonObjectFromDict("paymentMethodList") - let finalLoadlatency = Js.Date.now() -. launchTime + let finalLoadlatency = Date.now() -. launchTime let updatedState: PaymentType.loadType = list == Dict.make()->JSON.Encode.object ? LoadError(list) @@ -376,23 +368,44 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime list->Utils.getDictFromJson->Utils.getArray("payment_methods")->Array.length > 0 isNonEmptyPaymentMethodList ? Loaded(list) : LoadError(list) } - switch updatedState { - | Loaded(_) => - logger.setLogInfo( - ~value="Loaded", - ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, - (), - ) - | LoadError(x) => - logger.setLogError( - ~value="LoadError: " ++ x->JSON.stringify, - ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, - (), - ) - | _ => () + + let evalMethodsList = () => + switch updatedState { + | Loaded(_) => + logger.setLogInfo( + ~value="Loaded", + ~eventName=LOADER_CHANGED, + ~latency=finalLoadlatency, + (), + ) + | LoadError(x) => + logger.setLogError( + ~value="LoadError: " ++ x->JSON.stringify, + ~eventName=LOADER_CHANGED, + ~latency=finalLoadlatency, + (), + ) + | _ => () + } + + if !optionsPayment.displaySavedPaymentMethods { + evalMethodsList() + } else { + switch optionsPayment.customerPaymentMethods { + | LoadingSavedCards => () + | LoadedSavedCards(list, _) => + list->Array.length > 0 + ? logger.setLogInfo( + ~value="Loaded", + ~eventName=LOADER_CHANGED, + ~latency=finalLoadlatency, + (), + ) + : evalMethodsList() + | NoResult(_) => evalMethodsList() + } } + setList(_ => updatedState) } if dict->getDictIsSome("customerPaymentMethods") { @@ -401,6 +414,41 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime ...prev, customerPaymentMethods, }) + let finalLoadlatency = Date.now() -. launchTime + + let evalMethodsList = () => + switch paymentlist { + | Loaded(_) => + logger.setLogInfo( + ~value="Loaded", + ~eventName=LOADER_CHANGED, + ~latency=finalLoadlatency, + (), + ) + | LoadError(x) => + logger.setLogError( + ~value="LoadError: " ++ x->JSON.stringify, + ~eventName=LOADER_CHANGED, + ~latency=finalLoadlatency, + (), + ) + + | _ => () + } + + switch optionsPayment.customerPaymentMethods { + | LoadingSavedCards => () + | LoadedSavedCards(list, _) => + list->Array.length > 0 + ? logger.setLogInfo( + ~value="Loaded", + ~eventName=LOADER_CHANGED, + ~latency=finalLoadlatency, + (), + ) + : evalMethodsList() + | NoResult(_) => evalMethodsList() + } } if dict->Dict.get("applePayCanMakePayments")->Option.isSome { setIsApplePayReady(_ => true) diff --git a/src/LocaleString.res b/src/LocaleString.res index 25eaab7d5..da0de1ed9 100644 --- a/src/LocaleString.res +++ b/src/LocaleString.res @@ -49,6 +49,7 @@ type localeStrings = { cvcNumberEmptyText: string, enterFieldsText: string, enterValidDetailsText: string, + selectPaymentMethodText: string, card: string, surchargeMsgAmount: (string, string) => React.element, surchargeMsgAmountForCard: (string, string) => React.element, @@ -123,6 +124,7 @@ let defaultLocale = { cvcNumberEmptyText: "CVC Number cannot be empty", enterFieldsText: "Please enter all fields", enterValidDetailsText: "Please enter valid details", + selectPaymentMethodText: "Please select a payment method and try again", card: "Card", surchargeMsgAmount: (currency, str) => <> {React.string(`A surcharge amount of${Utils.nbsp}`)} @@ -207,6 +209,7 @@ let localeStrings = [ cvcNumberEmptyText: "CVC Number cannot be empty", enterFieldsText: "Please enter all fields", enterValidDetailsText: "Please enter valid details", + selectPaymentMethodText: "Please select a payment method and try again", card: "Card", surchargeMsgAmount: (currency, str) => <> {React.string(`A surcharge amount of${Utils.nbsp}`)} @@ -288,6 +291,7 @@ let localeStrings = [ cvcNumberEmptyText: `פרטי קוד ה-CVC אינם יכולים להיות ריקים`, enterFieldsText: `יש להזין את כל השדות`, enterValidDetailsText: `יש להזין פרטים תקינים`, + selectPaymentMethodText: `אנא בחר אמצעי תשלום ונסה שוב`, card: `כרטיס`, surchargeMsgAmount: (currency, str) => <> {React.string(`סכום היטל של${Utils.nbsp}`)} @@ -369,6 +373,7 @@ let localeStrings = [ cvcNumberEmptyText: `Le numéro CVC ne peut pas être vide`, enterFieldsText: `Veuillez saisir tous les champs`, enterValidDetailsText: `Veuillez saisir des informations valides`, + selectPaymentMethodText: `Veuillez sélectionner un mode de paiement et réessayer`, card: `Carte`, surchargeMsgAmount: (currency, str) => <> {React.string(`Un montant supplémentaire d'${Utils.nbsp}`)} @@ -450,6 +455,7 @@ let localeStrings = [ cvcNumberEmptyText: "CVC Number cannot be empty", enterFieldsText: "Please enter all fields", enterValidDetailsText: "Please enter valid details", + selectPaymentMethodText: `Please select a payment method and try again`, card: "Card", surchargeMsgAmount: (currency, str) => <> {React.string(`A surcharge amount of${Utils.nbsp}`)} @@ -531,6 +537,7 @@ let localeStrings = [ cvcNumberEmptyText: `لا يمكن أن يكون رقم التحقق من البطاقة (CVC) فارغًا`, enterFieldsText: `الرجاء إدخال كافة الحقول`, enterValidDetailsText: `الرجاء إدخال تفاصيل صالحة`, + selectPaymentMethodText: `الرجاء تحديد طريقة الدفع والمحاولة مرة أخرى`, card: `بطاقة`, surchargeMsgAmount: (currency, str) => <> {React.string(`سيتم تطبيق مبلغ إضافي من${Utils.nbsp}`)} @@ -612,6 +619,7 @@ let localeStrings = [ cvcNumberEmptyText: `CVC 番号を空にすることはできません`, enterFieldsText: `すべてのフィールドに入力してください`, enterValidDetailsText: `有効な詳細を入力してください`, + selectPaymentMethodText: `支払い方法を選択して、もう一度お試しください`, card: `カード`, surchargeMsgAmount: (currency, str) => <> {React.string(`この取引には${Utils.nbsp}`)} @@ -693,6 +701,7 @@ let localeStrings = [ cvcNumberEmptyText: `Die CVC-Nummer darf nicht leer sein`, enterFieldsText: `Bitte füllen Sie alle Felder aus`, enterValidDetailsText: `Bitte geben Sie gültige Daten ein`, + selectPaymentMethodText: `Bitte wählen Sie eine Zahlungsmethode aus und versuchen Sie es erneut`, card: `Karte`, surchargeMsgAmount: (currency, str) => <> {React.string(`Für diese Transaktion wird ein Zuschlag in Höhe von${Utils.nbsp}`)} diff --git a/src/PaymentElement.res b/src/PaymentElement.res index e942694c5..36855da07 100644 --- a/src/PaymentElement.res +++ b/src/PaymentElement.res @@ -1,5 +1,6 @@ open PaymentType open RecoilAtoms +open Utils let cardsToRender = (width: int) => { let minWidth = 130 @@ -27,7 +28,7 @@ let make = ( let isApplePayReady = Recoil.useRecoilValueFromAtom(isApplePayReady) let isGooglePayReady = Recoil.useRecoilValueFromAtom(isGooglePayReady) let methodslist = Recoil.useRecoilValueFromAtom(list) - let paymentOrder = paymentMethodOrder->Utils.getOptionalArr->Utils.removeDuplicate + let paymentOrder = paymentMethodOrder->getOptionalArr->removeDuplicate let (sessions, setSessions) = React.useState(_ => Dict.make()->JSON.Encode.object) let (paymentOptions, setPaymentOptions) = React.useState(_ => []) let (walletOptions, setWalletOptions) = React.useState(_ => []) @@ -124,7 +125,7 @@ let make = ( | Loaded(paymentlist) => let paymentOrder = paymentOrder->Array.length > 0 ? paymentOrder : PaymentModeType.defaultOrder - let plist = paymentlist->Utils.getDictFromJson->PaymentMethodsRecord.itemToObjMapper + let plist = paymentlist->getDictFromJson->PaymentMethodsRecord.itemToObjMapper let (wallets, otherOptions) = plist->PaymentUtils.paymentListLookupNew( ~order=paymentOrder, @@ -134,12 +135,12 @@ let make = ( ~areAllApplePayRequiredFieldsPrefilled, ) ( - wallets->Utils.removeDuplicate, - paymentOptions->Array.concat(otherOptions)->Utils.removeDuplicate, + wallets->removeDuplicate, + paymentOptions->Array.concat(otherOptions)->removeDuplicate, otherOptions, ) | SemiLoaded => - showCardFormByDefault && Utils.checkPriorityList(paymentMethodOrder) + showCardFormByDefault && checkPriorityList(paymentMethodOrder) ? ([], ["card"], []) : ([], [], []) | _ => ([], [], []) @@ -156,7 +157,7 @@ let make = ( React.useEffect(() => { switch methodslist { | Loaded(paymentlist) => - let plist = paymentlist->Utils.getDictFromJson->PaymentMethodsRecord.itemToObjMapper + let plist = paymentlist->getDictFromJson->PaymentMethodsRecord.itemToObjMapper setPaymentOptions(_ => { paymentOptionsList @@ -171,11 +172,11 @@ let make = ( ~logger=loggerState, (), ) - } else if !Utils.checkPriorityList(paymentMethodOrder) { + } else if !checkPriorityList(paymentMethodOrder) { ErrorUtils.manageErrorWarning( SDK_CONNECTOR_WARNING, ~dynamicStr=`'paymentMethodOrder' is ${Array.joinWith( - paymentMethodOrder->Utils.getOptionalArr, + paymentMethodOrder->getOptionalArr, ", ", )} . Please enable Card Payment as 1st priority to show it as default.`, ~logger=loggerState, @@ -186,7 +187,7 @@ let make = ( | LoadError(_) | SemiLoaded => setPaymentOptions(_ => - showCardFormByDefault && Utils.checkPriorityList(paymentMethodOrder) ? ["card"] : [] + showCardFormByDefault && checkPriorityList(paymentMethodOrder) ? ["card"] : [] ) | _ => () } @@ -219,15 +220,12 @@ let make = ( }, [cardsContainerWidth]) let submitCallback = React.useCallback((ev: Window.event) => { let json = ev.data->JSON.parseExn - let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper + let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper if confirm.doSubmit && selectedOption == "" { - Utils.postFailedSubmitResponse( - ~errortype="validation_error", - ~message="Select a payment method", - ) + postFailedSubmitResponse(~errortype="validation_error", ~message="Select a payment method") } }, [selectedOption]) - Utils.useSubmitPaymentData(submitCallback) + useSubmitPaymentData(submitCallback) React.useEffect(() => { setSelectedOption(prev => selectedOption !== "" @@ -237,7 +235,7 @@ let make = ( : switch methodslist { | SemiLoaded | LoadError(_) => - showCardFormByDefault && Utils.checkPriorityList(paymentMethodOrder) ? "card" : "" + showCardFormByDefault && checkPriorityList(paymentMethodOrder) ? "card" : "" | Loaded(_) => paymentOptions->Array.includes(selectedOption) && showCardFormByDefault ? selectedOption @@ -273,7 +271,7 @@ let make = ( let checkRenderOrComp = () => { walletOptions->Array.includes("paypal") || isShowOrPayUsing } - let dict = sessions->Utils.getDictFromJson + let dict = sessions->getDictFromJson let sessionObj = SessionsType.itemToObjMapper(dict, Others) let applePaySessionObj = SessionsType.itemToObjMapper(dict, ApplePayObject) let applePayToken = SessionsType.getPaymentSessionObj(applePaySessionObj.sessionsToken, ApplePay) @@ -286,7 +284,7 @@ let make = ( ) let loader = () => { - Utils.handlePostMessageEvents( + handlePostMessageEvents( ~complete=false, ~empty=false, ~paymentType=selectedOption, @@ -397,6 +395,27 @@ let make = ( optionAtomValue.paymentMethodsHeaderText } + React.useEffect(() => { + let evalMethodsList = () => + switch methodslist { + | SemiLoaded | Loaded(_) => handlePostMessage([("ready", true->JSON.Encode.bool)]) + | _ => () + } + if !displaySavedPaymentMethods { + evalMethodsList() + } else { + switch customerPaymentMethods { + | LoadingSavedCards => () + | LoadedSavedCards(list, _) => + list->Array.length > 0 + ? handlePostMessage([("ready", true->JSON.Encode.bool)]) + : evalMethodsList() + | NoResult(_) => evalMethodsList() + } + } + None + }, (methodslist, customerPaymentMethods)) + <> Option.isSome}>
diff --git a/src/Types/ConfirmType.res b/src/Types/ConfirmType.res index 6c16e6bcd..c7f38bcb6 100644 --- a/src/Types/ConfirmType.res +++ b/src/Types/ConfirmType.res @@ -7,6 +7,8 @@ type confirm = { doSubmit: bool, clientSecret: string, confirmParams: confirmParams, + confirmTimestamp: float, + readyTimestamp: float, } open Utils let defaultConfirm = { @@ -31,5 +33,7 @@ let itemToObjMapper = dict => { doSubmit: getBool(dict, "doSubmit", false), clientSecret: getString(dict, "clientSecret", ""), confirmParams: getConfirmParams(dict, "confirmParams"), + confirmTimestamp: getFloat(dict, "confirmTimestamp", 0.0), + readyTimestamp: getFloat(dict, "readyTimestamp", 0.0), } } diff --git a/src/Types/PaymentType.res b/src/Types/PaymentType.res index 98fc092a7..b37b182dc 100644 --- a/src/Types/PaymentType.res +++ b/src/Types/PaymentType.res @@ -272,7 +272,7 @@ let defaultSdkHandleConfirmPayment = { let defaultOptions = { defaultValues: defaultDefaultValues, business: defaultBusiness, - customerPaymentMethods: NoResult(true), + customerPaymentMethods: LoadingSavedCards, layout: ObjectLayout(defaultLayout), paymentMethodOrder: None, fields: defaultFields, diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 07ba34b0a..592bca90f 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -67,6 +67,14 @@ let make = ( ~logger, ) + let customerDetailsPromise = PaymentHelpers.fetchCustomerDetails( + ~clientSecret, + ~publishableKey, + ~endpoint, + ~switchToCustomPod, + ~optLogger=Some(logger), + ) + let sessionsPromise = PaymentHelpers.fetchSessions( ~clientSecret, ~publishableKey, @@ -86,14 +94,14 @@ let make = ( ->then(json => { let isApplePayPresent = PaymentMethodsRecord.getPaymentMethodTypeFromList( - ~list=json->Utils.getDictFromJson->PaymentMethodsRecord.itemToObjMapper, + ~list=json->getDictFromJson->PaymentMethodsRecord.itemToObjMapper, ~paymentMethod="wallet", ~paymentMethodType="apple_pay", )->Option.isSome let isGooglePayPresent = PaymentMethodsRecord.getPaymentMethodTypeFromList( - ~list=json->Utils.getDictFromJson->PaymentMethodsRecord.itemToObjMapper, + ~list=json->getDictFromJson->PaymentMethodsRecord.itemToObjMapper, ~paymentMethod="wallet", ~paymentMethodType="google_pay", )->Option.isSome @@ -110,7 +118,7 @@ let make = ( let trustPayScript = Window.createElement("script") trustPayScript->Window.elementSrc(trustPayScriptURL) trustPayScript->Window.elementOnerror(err => { - Utils.logInfo(Console.log2("ERROR DURING LOADING TRUSTPAY APPLE PAY", err)) + logInfo(Console.log2("ERROR DURING LOADING TRUSTPAY APPLE PAY", err)) }) Window.body->Window.appendChild(trustPayScript) logger.setLogInfo(~value="TrustPay Script Loaded", ~eventName=TRUSTPAY_SCRIPT, ()) @@ -128,13 +136,6 @@ let make = ( ->ignore } let fetchCustomerDetails = mountedIframeRef => { - let customerDetailsPromise = PaymentHelpers.fetchCustomerDetails( - ~clientSecret, - ~publishableKey, - ~endpoint, - ~switchToCustomPod, - ~optLogger=Some(logger), - ) open Promise customerDetailsPromise ->then(json => { @@ -204,7 +205,7 @@ let make = ( componentType == "" ? manageErrorWarning(REQUIRED_PARAMETER, ~dynamicStr="type", ~logger, ()) : () - let otherElements = componentType->Utils.isOtherElements + let otherElements = componentType->isOtherElements switch componentType { | "card" | "cardNumber" @@ -282,7 +283,7 @@ let make = ( switch dict->Dict.get("googlePayThirdPartyFlow") { | Some(googlePayThirdPartyOptSession) => { - let googlePayThirdPartySession = googlePayThirdPartyOptSession->Utils.getDictFromJson + let googlePayThirdPartySession = googlePayThirdPartyOptSession->getDictFromJson let baseDetails = { "apiVersion": 2, @@ -299,10 +300,9 @@ let make = ( paymentDataRequest->GooglePayType.jsonToPaymentRequestDataType( googlePayThirdPartySession, ) - let secrets = - googlePayThirdPartySession->Utils.getJsonFromDict("secrets", JSON.Encode.null) + let secrets = googlePayThirdPartySession->getJsonFromDict("secrets", JSON.Encode.null) - let payment = secrets->Utils.getDictFromJson->Utils.getString("payment", "") + let payment = secrets->getDictFromJson->getString("payment", "") try { let trustpay = trustPayApi(secrets) @@ -320,7 +320,7 @@ let make = ( resolve() }) ->catch(err => { - let exceptionMessage = err->Utils.formatException->JSON.stringify + let exceptionMessage = err->formatException->JSON.stringify logger.setLogInfo( ~value=exceptionMessage, ~eventName=GOOGLE_PAY_FLOW, @@ -336,7 +336,7 @@ let make = ( ->ignore } catch { | err => { - let exceptionMessage = err->Utils.formatException->JSON.stringify + let exceptionMessage = err->formatException->JSON.stringify logger.setLogInfo( ~value=exceptionMessage, ~eventName=GOOGLE_PAY_FLOW, @@ -502,7 +502,7 @@ let make = ( resolve() }) ->catch(err => { - let exceptionMessage = err->Utils.formatException->JSON.stringify + let exceptionMessage = err->formatException->JSON.stringify logger.setLogInfo( ~eventName=APPLE_PAY_FLOW, ~paymentMethod="APPLE_PAY", @@ -518,7 +518,7 @@ let make = ( } catch { | exn => { logger.setLogInfo( - ~value=exn->Utils.formatException->JSON.stringify, + ~value=exn->formatException->JSON.stringify, ~eventName=APPLE_PAY_FLOW, ~paymentMethod="APPLE_PAY", (), @@ -538,7 +538,7 @@ let make = ( ->Option.getOr(Dict.make()) ->Dict.get("payment_request_data") ->Option.getOr(Dict.make()->JSON.Encode.object) - ->Utils.transformKeys(Utils.CamelCase) + ->transformKeys(CamelCase) let ssn = applePaySession(3, paymentRequest) switch applePaySessionRef.contents->Nullable.toOption { @@ -560,7 +560,7 @@ let make = ( ->Option.getOr(Dict.make()) ->Dict.get("session_token_data") ->Option.getOr(Dict.make()->JSON.Encode.object) - ->Utils.transformKeys(Utils.CamelCase) + ->transformKeys(CamelCase) ssn.completeMerchantValidation(merchantSession) } @@ -574,19 +574,19 @@ let make = ( [("showApplePayButton", true->JSON.Encode.bool)]->Dict.fromArray mountedIframeRef->Window.iframePostMessage(msg) applePaySessionRef := Nullable.null - Utils.logInfo(Console.log("Apple Pay payment cancelled")) + logInfo(Console.log("Apple Pay payment cancelled")) } ssn.begin() } catch { | exn => { logger.setLogInfo( - ~value=exn->Utils.formatException->JSON.stringify, + ~value=exn->formatException->JSON.stringify, ~eventName=APPLE_PAY_FLOW, ~paymentMethod="APPLE_PAY", (), ) - Utils.logInfo(Console.error2("Apple Pay Error", exn)) + logInfo(Console.error2("Apple Pay Error", exn)) let msg = [("showApplePayButton", true->JSON.Encode.bool)]->Dict.fromArray @@ -726,8 +726,14 @@ let make = ( json->resolve }) ->ignore + if ( + newOptions + ->getDictFromJson + ->getBool("displaySavedPaymentMethods", true) + ) { + fetchCustomerDetails(mountedIframeRef) + } fetchPaymentsList(mountedIframeRef) - fetchCustomerDetails(mountedIframeRef) mountedIframeRef->Window.iframePostMessage(message) } diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index a3bb8dfc8..0ab0a3773 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -95,6 +95,23 @@ let make = (publishableKey, options: option, analyticsInfo: option { + let handleOnReady = (event: Types.event) => { + let json = event.data->eventToJson + let dict = json->getDictFromJson + if ( + dict + ->Dict.get("ready") + ->Option.getOr(JSON.Encode.bool(false)) + ->JSON.Decode.bool + ->Option.getOr(false) + ) { + resolve(Date.now()) + } + } + addSmartEventListener("message", handleOnReady, "handleOnReady") + }) + switch options { | Some(userOptions) => let customBackendUrl = @@ -244,6 +261,7 @@ let make = (publishableKey, options: option, analyticsInfo: option { + let confirmTimestamp = Date.now() let confirmParams = payload ->JSON.Decode.object @@ -264,67 +282,76 @@ let make = (publishableKey, options: option, analyticsInfo: optionOption.flatMap(JSON.Decode.string) ->Option.getOr("") - Promise.make((resolve, _) => { - let handleMessage = (event: Types.event) => { - let json = event.data->eventToJson - let dict = json->getDictFromJson - - switch dict->Dict.get("submitSuccessful") { - | Some(val) => - let message = [("submitSuccessful", val)]->Dict.fromArray - iframeRef.contents->Array.forEach(ifR => { - ifR->Window.iframePostMessage(message) - }) - logApi( - ~type_="method", - ~optLogger=Some(logger), - ~result=val, - ~paymentMethod="confirmPayment", - ~eventName=CONFIRM_PAYMENT, - (), - ) - let data = dict->Dict.get("data")->Option.getOr(Dict.make()->JSON.Encode.object) - let returnUrl = - dict->Dict.get("url")->Option.flatMap(JSON.Decode.string)->Option.getOr(url) - - if isOneClick { - iframeRef.contents->Array.forEach(ifR => { - // to unset one click button loader - ifR->Window.iframePostMessage( - [("oneClickDoSubmit", false->JSON.Encode.bool)]->Dict.fromArray, + let postSubmitMessage = message => { + iframeRef.contents->Array.forEach(ifR => { + ifR->Window.iframePostMessage(message) + }) + } + + Promise.make((resolve1, _) => { + let isReadyPromise = isReadyPromise + isReadyPromise + ->Promise.then(readyTimestamp => { + let handleMessage = (event: Types.event) => { + let json = event.data->eventToJson + let dict = json->getDictFromJson + switch dict->Dict.get("submitSuccessful") { + | Some(val) => + logApi( + ~type_="method", + ~optLogger=Some(logger), + ~result=val, + ~paymentMethod="confirmPayment", + ~eventName=CONFIRM_PAYMENT, + (), + ) + let data = dict->Dict.get("data")->Option.getOr(Dict.make()->JSON.Encode.object) + let returnUrl = + dict->Dict.get("url")->Option.flatMap(JSON.Decode.string)->Option.getOr(url) + + if isOneClick { + iframeRef.contents->Array.forEach( + ifR => { + // to unset one click button loader + ifR->Window.iframePostMessage( + [("oneClickDoSubmit", false->JSON.Encode.bool)]->Dict.fromArray, + ) + }, ) - }) - } + } - if val->JSON.Decode.bool->Option.getOr(false) && redirect === "always" { - Window.replace(returnUrl) - } else if !(val->JSON.Decode.bool->Option.getOr(false)) { - resolve(json) - } else { - resolve(data) + if val->JSON.Decode.bool->Option.getOr(false) && redirect === "always" { + Window.replace(returnUrl) + } else if !(val->JSON.Decode.bool->Option.getOr(false)) { + resolve1(json) + } else { + resolve1(data) + } + | None => () } - | None => () } - } - let message = isOneClick - ? [("oneClickDoSubmit", result->JSON.Encode.bool)]->Dict.fromArray - : [ - ("doSubmit", true->JSON.Encode.bool), - ("clientSecret", clientSecret.contents->JSON.Encode.string), - ( - "confirmParams", - [ - ("return_url", url->JSON.Encode.string), - ("publishableKey", publishableKey->JSON.Encode.string), - ] - ->Dict.fromArray - ->JSON.Encode.object, - ), - ]->Dict.fromArray - addSmartEventListener("message", handleMessage, "onSubmit") - iframeRef.contents->Array.forEach(ifR => { - ifR->Window.iframePostMessage(message) + let message = isOneClick + ? [("oneClickDoSubmit", result->JSON.Encode.bool)]->Dict.fromArray + : [ + ("doSubmit", true->JSON.Encode.bool), + ("clientSecret", clientSecret.contents->JSON.Encode.string), + ("confirmTimestamp", confirmTimestamp->JSON.Encode.float), + ("readyTimestamp", readyTimestamp->JSON.Encode.float), + ( + "confirmParams", + [ + ("return_url", url->JSON.Encode.string), + ("publishableKey", publishableKey->JSON.Encode.string), + ] + ->Dict.fromArray + ->JSON.Encode.object, + ), + ]->Dict.fromArray + addSmartEventListener("message", handleMessage, "onSubmit") + postSubmitMessage(message) + Promise.resolve(JSON.Encode.null) }) + ->ignore }) } diff --git a/src/orca-log-catcher/OrcaLogger.res b/src/orca-log-catcher/OrcaLogger.res index 7845c4ba1..b97a1829c 100644 --- a/src/orca-log-catcher/OrcaLogger.res +++ b/src/orca-log-catcher/OrcaLogger.res @@ -505,6 +505,7 @@ let make = ( DISPLAY_BANK_TRANSFER_INFO_PAGE, DISPLAY_QR_CODE_INFO_PAGE, SESSIONS_CALL, + RETRIEVE_CALL, ] arrayOfLogs ->Array.find(log => { From edb81178a9d62e4dc557605a9a0a887f7457cb71 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 2 Apr 2024 11:28:33 +0000 Subject: [PATCH 02/14] chore(release): 0.35.6 [skip ci] ## [0.35.6](https://github.com/juspay/hyperswitch-web/compare/v0.35.5...v0.35.6) (2024-04-02) ### Bug Fixes * customer payment methods promise ([#266](https://github.com/juspay/hyperswitch-web/issues/266)) ([57ea1ed](https://github.com/juspay/hyperswitch-web/commit/57ea1ed0483776df98abbbd83b0958674be6490c)) --- CHANGELOG.md | 7 ++ package-lock.json | 179 +++++++++++++++++++++++++++++++--------------- package.json | 2 +- 3 files changed, 129 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d90bc8c05..2409ede02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.35.6](https://github.com/juspay/hyperswitch-web/compare/v0.35.5...v0.35.6) (2024-04-02) + + +### Bug Fixes + +* customer payment methods promise ([#266](https://github.com/juspay/hyperswitch-web/issues/266)) ([57ea1ed](https://github.com/juspay/hyperswitch-web/commit/57ea1ed0483776df98abbbd83b0958674be6490c)) + ## [0.35.5](https://github.com/juspay/hyperswitch-web/compare/v0.35.4...v0.35.5) (2024-04-02) diff --git a/package-lock.json b/package-lock.json index 87b62e783..4eb12e8cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.35.5", + "version": "0.35.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2870,6 +2870,21 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2887,6 +2902,40 @@ "strip-ansi": "^7.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2896,6 +2945,23 @@ "ansi-regex": "^6.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } + } + }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2906,6 +2972,60 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } } } }, @@ -20852,17 +20972,6 @@ "strip-ansi": "^6.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -20954,15 +21063,6 @@ "ansi-regex": "^5.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -23530,43 +23630,6 @@ } } }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 174b3ef25..e11908492 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.35.5", + "version": "0.35.6", "main": "index.js", "private": true, "dependencies": { From ceab1614e80d8cfb96ac3eea04486ebd509e0770 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:58:53 +0530 Subject: [PATCH 03/14] feat(3ds): three DS SDK - adding logs to track milestone events (#265) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/ThreeDSAuth.res | 27 ++++- src/ThreeDSMethod.res | 52 +++++++--- src/Utilities/LoggerUtils.res | 18 +--- src/Utilities/PaymentHelpers.res | 154 ++++++++++++++++++++++------ src/orca-loader/Elements.res | 7 +- src/orca-loader/Hyper.res | 10 +- src/orca-log-catcher/OrcaLogger.res | 33 ++++-- 7 files changed, 224 insertions(+), 77 deletions(-) diff --git a/src/ThreeDSAuth.res b/src/ThreeDSAuth.res index 3f00fe92e..6fa130721 100644 --- a/src/ThreeDSAuth.res +++ b/src/ThreeDSAuth.res @@ -5,7 +5,7 @@ let make = () => { let (openModal, setOpenModal) = React.useState(_ => false) let (loader, setloader) = React.useState(_ => true) - let logger = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom) + let logger = OrcaLogger.make() React.useEffect0(() => { handlePostMessage([("iframeMountedCallback", true->JSON.Encode.bool)]) @@ -16,6 +16,9 @@ let make = () => { let metadata = dict->getJsonObjectFromDict("metadata") let metaDataDict = metadata->JSON.Decode.object->Option.getOr(Dict.make()) let paymentIntentId = metaDataDict->getString("paymentIntentId", "") + let publishableKey = metaDataDict->getString("publishableKey", "") + logger.setClientSecret(paymentIntentId) + logger.setMerchantId(publishableKey) let headersDict = metaDataDict ->getJsonObjectFromDict("headers") @@ -51,6 +54,14 @@ let make = () => { let ele = Window.querySelector("#threeDsAuthDiv") + LoggerUtils.handleLogging( + ~optLogger=Some(logger), + ~eventName=DISPLAY_THREE_DS_SDK, + ~value=transStatus, + ~paymentMethod="CARD", + (), + ) + switch ele->Nullable.toOption { | Some(elem) => if transStatus === "C" { @@ -63,13 +74,25 @@ let make = () => { form.appendChild(input) form.submit() } else { - let form1 = elem->OrcaUtils.makeForm(threeDsAuthoriseUrl, "3dsFrintionLess") + let form1 = elem->OrcaUtils.makeForm(threeDsAuthoriseUrl, "3dsFrictionLess") form1.submit() } | None => () } resolve(json) }) + ->catch(err => { + let exceptionMessage = err->Utils.formatException + LoggerUtils.handleLogging( + ~optLogger=Some(logger), + ~eventName=DISPLAY_THREE_DS_SDK, + ~value=exceptionMessage->JSON.stringify, + ~paymentMethod="CARD", + ~logType=ERROR, + (), + ) + JSON.Encode.null->resolve + }) ->ignore } } diff --git a/src/ThreeDSMethod.res b/src/ThreeDSMethod.res index 7255e39af..de218ada5 100644 --- a/src/ThreeDSMethod.res +++ b/src/ThreeDSMethod.res @@ -1,7 +1,7 @@ open Utils @react.component let make = () => { - let logger = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom) + let logger = OrcaLogger.make() let mountToInnerHTML = innerHTML => { let ele = Window.querySelector("#threeDsInvisibleIframe") @@ -40,25 +40,39 @@ let make = () => { ->Belt.Option.flatMap(JSON.Decode.object) ->Belt.Option.flatMap(x => x->Dict.get("three_ds_method_data")) ->Option.getOr(Dict.make()->JSON.Encode.object) + let paymentIntentId = metaDataDict->Utils.getString("paymentIntentId", "") + let publishableKey = metaDataDict->Utils.getString("publishableKey", "") let iframeId = metaDataDict->getString("iframeId", "") + logger.setClientSecret(paymentIntentId) + logger.setMerchantId(publishableKey) + open Promise PaymentHelpers.threeDsMethod(threeDsUrl, threeDsMethodData, ~optLogger=Some(logger)) ->then(res => { - mountToInnerHTML(res) - resolve(res) - }) - ->then(res => { - metadata->Utils.getDictFromJson->Dict.set("3dsMethodComp", "Y"->JSON.Encode.string) - handlePostMessage([ - ("fullscreen", true->JSON.Encode.bool), - ("param", `3dsAuth`->JSON.Encode.string), - ("iframeId", iframeId->JSON.Encode.string), - ("metadata", metadata), - ]) - resolve(res) + if res == "" { + Exn.raiseError("Empty response from threeDsMethod")->reject + } else { + LoggerUtils.handleLogging( + ~optLogger=Some(logger), + ~eventName=THREE_DS_METHOD_RESULT, + ~value="Y", + ~paymentMethod="CARD", + (), + ) + mountToInnerHTML(res) + metadata->Utils.getDictFromJson->Dict.set("3dsMethodComp", "Y"->JSON.Encode.string) + handlePostMessage([ + ("fullscreen", true->JSON.Encode.bool), + ("param", `3dsAuth`->JSON.Encode.string), + ("iframeId", iframeId->JSON.Encode.string), + ("metadata", metadata), + ]) + resolve(res) + } }) - ->catch(e => { + ->catch(err => { + let exceptionMessage = err->Utils.formatException metadata->Utils.getDictFromJson->Dict.set("3dsMethodComp", "N"->JSON.Encode.string) handlePostMessage([ ("fullscreen", true->JSON.Encode.bool), @@ -66,7 +80,15 @@ let make = () => { ("iframeId", iframeId->JSON.Encode.string), ("metadata", metadata), ]) - reject(e) + LoggerUtils.handleLogging( + ~optLogger=Some(logger), + ~eventName=THREE_DS_METHOD_RESULT, + ~value=exceptionMessage->JSON.stringify, + ~paymentMethod="CARD", + ~logType=ERROR, + (), + ) + reject(err) }) ->ignore diff --git a/src/Utilities/LoggerUtils.res b/src/Utilities/LoggerUtils.res index 36511b548..3e7c0737c 100644 --- a/src/Utilities/LoggerUtils.res +++ b/src/Utilities/LoggerUtils.res @@ -1,19 +1,8 @@ -type logType = Request | Response | NoResponse | Method | Err -let getLogtype = val => { - switch val { - | "request" => Request - | "response" => Response - | "no_response" => NoResponse - | "method" => Method - | "err" => Err - | _ => Err - } -} let logApi = ( ~eventName, ~statusCode="", ~data: JSON.t=Dict.make()->JSON.Encode.object, - ~type_, + ~apiLogType: OrcaLogger.apiLogType, ~url="", ~paymentMethod="", ~result: JSON.t=Dict.make()->JSON.Encode.object, @@ -22,8 +11,7 @@ let logApi = ( ~logCategory: OrcaLogger.logCategory=API, (), ) => { - let logtype = getLogtype(type_) - let (value, internalMetadata) = switch logtype { + let (value, internalMetadata) = switch apiLogType { | Request => ([("url", url->JSON.Encode.string)], []) | Response => ( [("url", url->JSON.Encode.string), ("statusCode", statusCode->JSON.Encode.string)], @@ -55,7 +43,7 @@ let logApi = ( ~internalMetadata=ArrayType(internalMetadata), ~logType, ~logCategory, - ~type_, + ~apiLogType, (), ) | None => () diff --git a/src/Utilities/PaymentHelpers.res b/src/Utilities/PaymentHelpers.res index 486e716c5..fa16ef0fe 100644 --- a/src/Utilities/PaymentHelpers.res +++ b/src/Utilities/PaymentHelpers.res @@ -21,7 +21,7 @@ let retrievePaymentIntent = (clientSecret, headers, ~optLogger, ~switchToCustomP logApi( ~optLogger, ~url=uri, - ~type_="request", + ~apiLogType=Request, ~eventName=RETRIEVE_CALL_INIT, ~logType=INFO, ~logCategory=API, @@ -44,7 +44,7 @@ let retrievePaymentIntent = (clientSecret, headers, ~optLogger, ~switchToCustomP ~url=uri, ~data, ~statusCode, - ~type_="err", + ~apiLogType=Err, ~eventName=RETRIEVE_CALL, ~logType=ERROR, ~logCategory=API, @@ -57,7 +57,7 @@ let retrievePaymentIntent = (clientSecret, headers, ~optLogger, ~switchToCustomP ~optLogger, ~url=uri, ~statusCode, - ~type_="response", + ~apiLogType=Response, ~eventName=RETRIEVE_CALL, ~logType=INFO, ~logCategory=API, @@ -77,8 +77,8 @@ let threeDsMethod = (url, threeDsMethodData, ~optLogger) => { logApi( ~optLogger, ~url, - ~type_="request", - ~eventName=RETRIEVE_CALL_INIT, + ~apiLogType=Request, + ~eventName=THREE_DS_METHOD_CALL_INIT, ~logType=INFO, ~logCategory=API, (), @@ -88,11 +88,50 @@ let threeDsMethod = (url, threeDsMethodData, ~optLogger) => { fetchApiWithNoCors(url, ~method=#POST, ~bodyStr=body, ()) ->then(res => { - res->Fetch.Response.text + let statusCode = res->Fetch.Response.status->Int.toString + if statusCode->String.charAt(0) !== "2" { + res + ->Fetch.Response.text + ->then(text => { + logApi( + ~optLogger, + ~url, + ~data=text->JSON.Encode.string, + ~statusCode, + ~apiLogType=Err, + ~eventName=THREE_DS_METHOD_CALL, + ~logType=ERROR, + ~logCategory=API, + (), + ) + ""->resolve + }) + } else { + logApi( + ~optLogger, + ~url, + ~statusCode, + ~apiLogType=Response, + ~eventName=THREE_DS_METHOD_CALL, + (), + ) + res->Fetch.Response.text + } }) - ->catch(e => { - Console.log2("Unable to call 3ds method ", e) - reject(e) + ->catch(err => { + let exceptionMessage = err->Utils.formatException + Console.log2("Unable to call 3ds method ", exceptionMessage) + logApi( + ~optLogger, + ~url, + ~eventName=THREE_DS_METHOD_CALL, + ~apiLogType=NoResponse, + ~data=exceptionMessage, + ~logType=ERROR, + ~logCategory=API, + (), + ) + reject(err) }) } @@ -115,17 +154,58 @@ let threeDsAuth = (~clientSecret, ~optLogger, ~threeDsMethodComp, ~headers) => { logApi( ~optLogger, ~url, - ~type_="request", - ~eventName=RETRIEVE_CALL_INIT, + ~apiLogType=Request, + ~eventName=AUTHENTICATION_CALL_INIT, ~logType=INFO, ~logCategory=API, (), ) fetchApi(url, ~method=#POST, ~bodyStr=body->JSON.stringify, ~headers=headers->Dict.fromArray, ()) - ->then(res => res->Fetch.Response.json) - ->catch(e => { - Console.log2("Unable to call 3ds auth ", e) - reject(e) + ->then(res => { + let statusCode = res->Fetch.Response.status->Int.toString + if statusCode->String.charAt(0) !== "2" { + res + ->Fetch.Response.json + ->then(data => { + logApi( + ~optLogger, + ~url, + ~data, + ~statusCode, + ~apiLogType=Err, + ~eventName=AUTHENTICATION_CALL, + ~logType=ERROR, + ~logCategory=API, + (), + ) + JSON.Encode.null->resolve + }) + } else { + logApi( + ~optLogger, + ~url, + ~statusCode, + ~apiLogType=Response, + ~eventName=AUTHENTICATION_CALL, + (), + ) + res->Fetch.Response.json + } + }) + ->catch(err => { + let exceptionMessage = err->Utils.formatException + Console.log2("Unable to call 3ds auth ", exceptionMessage) + logApi( + ~optLogger, + ~url, + ~eventName=AUTHENTICATION_CALL, + ~apiLogType=NoResponse, + ~data=exceptionMessage, + ~logType=ERROR, + ~logCategory=API, + (), + ) + reject(err) }) } @@ -184,7 +264,7 @@ let rec intentCall = ( logApi( ~optLogger, ~url=uri, - ~type_="request", + ~apiLogType=Request, ~eventName=initEventName, ~logType=INFO, ~logCategory=API, @@ -238,7 +318,7 @@ let rec intentCall = ( ~url=uri, ~data, ~statusCode, - ~type_="err", + ~apiLogType=Err, ~eventName, ~logType=ERROR, ~logCategory=API, @@ -274,7 +354,7 @@ let rec intentCall = ( ~optLogger, ~url=uri, ~statusCode, - ~type_="no_response", + ~apiLogType=NoResponse, ~data=exceptionMessage, ~eventName, ~logType=ERROR, @@ -338,7 +418,7 @@ let rec intentCall = ( ->then(data => { Promise.make( (resolve, _) => { - logApi(~optLogger, ~url=uri, ~statusCode, ~type_="response", ~eventName, ()) + logApi(~optLogger, ~url=uri, ~statusCode, ~apiLogType=Response, ~eventName, ()) let intent = PaymentConfirmTypes.itemToObjMapper(data->getDictFromJson) let paymentMethod = switch paymentType { | Card => "CARD" @@ -416,6 +496,7 @@ let rec intentCall = ( [ ("qrData", qrData->JSON.Encode.string), ("paymentIntentId", clientSecret->JSON.Encode.string), + ("publishableKey", confirmParam.publishableKey->JSON.Encode.string), ("headers", headerObj->JSON.Encode.object), ("expiryTime", expiryTime->Belt.Float.toString->JSON.Encode.string), ("url", url.href->JSON.Encode.string), @@ -462,11 +543,20 @@ let rec intentCall = ( [ ("threeDSData", threeDsData->JSON.Encode.object), ("paymentIntentId", clientSecret->JSON.Encode.string), + ("publishableKey", confirmParam.publishableKey->JSON.Encode.string), ("headers", headerObj->JSON.Encode.object), ("url", url.href->JSON.Encode.string), ("iframeId", iframeId->JSON.Encode.string), ]->Dict.fromArray + handleLogging( + ~optLogger, + ~value=do3dsMethodCall ? "Y" : "N", + ~eventName=THREE_DS_METHOD, + ~paymentMethod, + (), + ) + if do3dsMethodCall { handlePostMessage([ ("fullscreen", true->JSON.Encode.bool), @@ -600,7 +690,7 @@ let rec intentCall = ( ~optLogger, ~url=uri, ~eventName, - ~type_="no_response", + ~apiLogType=NoResponse, ~data=exceptionMessage, ~logType=ERROR, ~logCategory=API, @@ -911,7 +1001,7 @@ let fetchSessions = ( logApi( ~optLogger, ~url=uri, - ~type_="request", + ~apiLogType=Request, ~eventName=SESSIONS_CALL_INIT, ~logType=INFO, ~logCategory=API, @@ -935,7 +1025,7 @@ let fetchSessions = ( ~url=uri, ~data, ~statusCode, - ~type_="err", + ~apiLogType=Err, ~eventName=SESSIONS_CALL, ~logType=ERROR, ~logCategory=API, @@ -948,7 +1038,7 @@ let fetchSessions = ( ~optLogger, ~url=uri, ~statusCode, - ~type_="response", + ~apiLogType=Response, ~eventName=SESSIONS_CALL, ~logType=INFO, ~logCategory=API, @@ -962,7 +1052,7 @@ let fetchSessions = ( logApi( ~optLogger, ~url=uri, - ~type_="no_response", + ~apiLogType=NoResponse, ~eventName=SESSIONS_CALL, ~logType=ERROR, ~logCategory=API, @@ -986,7 +1076,7 @@ let fetchPaymentMethodList = ( logApi( ~optLogger=Some(logger), ~url=uri, - ~type_="request", + ~apiLogType=Request, ~eventName=PAYMENT_METHODS_CALL_INIT, ~logType=INFO, ~logCategory=API, @@ -1009,7 +1099,7 @@ let fetchPaymentMethodList = ( ~url=uri, ~data, ~statusCode, - ~type_="err", + ~apiLogType=Err, ~eventName=PAYMENT_METHODS_CALL, ~logType=ERROR, ~logCategory=API, @@ -1022,7 +1112,7 @@ let fetchPaymentMethodList = ( ~optLogger=Some(logger), ~url=uri, ~statusCode, - ~type_="response", + ~apiLogType=Response, ~eventName=PAYMENT_METHODS_CALL, ~logType=INFO, ~logCategory=API, @@ -1036,7 +1126,7 @@ let fetchPaymentMethodList = ( logApi( ~optLogger=Some(logger), ~url=uri, - ~type_="no_response", + ~apiLogType=NoResponse, ~eventName=PAYMENT_METHODS_CALL, ~logType=ERROR, ~logCategory=API, @@ -1060,7 +1150,7 @@ let fetchCustomerDetails = ( logApi( ~optLogger, ~url=uri, - ~type_="request", + ~apiLogType=Request, ~eventName=CUSTOMER_PAYMENT_METHODS_CALL_INIT, ~logType=INFO, ~logCategory=API, @@ -1083,7 +1173,7 @@ let fetchCustomerDetails = ( ~url=uri, ~data, ~statusCode, - ~type_="err", + ~apiLogType=Err, ~eventName=CUSTOMER_PAYMENT_METHODS_CALL, ~logType=ERROR, ~logCategory=API, @@ -1096,7 +1186,7 @@ let fetchCustomerDetails = ( ~optLogger, ~url=uri, ~statusCode, - ~type_="response", + ~apiLogType=Response, ~eventName=CUSTOMER_PAYMENT_METHODS_CALL, ~logType=INFO, ~logCategory=API, @@ -1110,7 +1200,7 @@ let fetchCustomerDetails = ( logApi( ~optLogger, ~url=uri, - ~type_="no_response", + ~apiLogType=NoResponse, ~eventName=CUSTOMER_PAYMENT_METHODS_CALL, ~logType=ERROR, ~logCategory=API, diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 592bca90f..118fb1689 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -129,7 +129,12 @@ let make = ( let msg = [("paymentMethodList", json)]->Dict.fromArray mountedIframeRef->Window.iframePostMessage(msg) let maskedPayload = json->PaymentHelpers.maskPayload->JSON.stringify - logger.setLogInfo(~value=maskedPayload, ~eventName=PAYMENT_METHODS_RESPONSE, ()) + logger.setLogInfo( + ~value="", + ~internalMetadata=maskedPayload, + ~eventName=PAYMENT_METHODS_RESPONSE, + (), + ) // }, 5000)->ignore json->resolve }) diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index 0ab0a3773..8fc2fa041 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -208,7 +208,7 @@ let make = (publishableKey, options: option, analyticsInfo: option, analyticsInfo: option, analyticsInfo: option, analyticsInfo: optionDict.get("submitSuccessful") { | Some(val) => logApi( - ~type_="method", + ~apiLogType=Method, ~optLogger=Some(logger), ~result=val, ~paymentMethod="confirmPayment", @@ -436,7 +436,7 @@ let make = (publishableKey, options: option, analyticsInfo: optionDict.get("submitSuccessful") { | Some(val) => logApi( - ~type_="method", + ~apiLogType=Method, ~optLogger=Some(logger), ~result=val, ~paymentMethod="confirmCardPayment", diff --git a/src/orca-log-catcher/OrcaLogger.res b/src/orca-log-catcher/OrcaLogger.res index b97a1829c..3032c428e 100644 --- a/src/orca-log-catcher/OrcaLogger.res +++ b/src/orca-log-catcher/OrcaLogger.res @@ -1,3 +1,4 @@ +type apiLogType = Request | Response | NoResponse | Method | Err type logType = DEBUG | INFO | ERROR | WARNING | SILENT type logCategory = API | USER_ERROR | USER_EVENT | MERCHANT_EVENT @@ -11,6 +12,10 @@ type eventName = | INPUT_FIELD_CHANGED | RETRIEVE_CALL_INIT | RETRIEVE_CALL + | AUTHENTICATION_CALL_INIT + | AUTHENTICATION_CALL + | THREE_DS_METHOD_CALL_INIT + | THREE_DS_METHOD_CALL | CONFIRM_CALL_INIT | CONFIRM_CALL | SESSIONS_CALL_INIT @@ -54,6 +59,9 @@ type eventName = | DISPLAY_BANK_TRANSFER_INFO_PAGE | DISPLAY_QR_CODE_INFO_PAGE | DISPLAY_VOUCHER + | DISPLAY_THREE_DS_SDK + | THREE_DS_METHOD + | THREE_DS_METHOD_RESULT | PAYMENT_METHODS_RESPONSE | LOADER_CHANGED | PAYMENT_SESSION_INITIATED @@ -69,6 +77,10 @@ let eventNameToStrMapper = eventName => { | INPUT_FIELD_CHANGED => "INPUT_FIELD_CHANGED" | RETRIEVE_CALL_INIT => "RETRIEVE_CALL_INIT" | RETRIEVE_CALL => "RETRIEVE_CALL" + | AUTHENTICATION_CALL_INIT => "AUTHENTICATION_CALL_INIT" + | AUTHENTICATION_CALL => "AUTHENTICATION_CALL" + | THREE_DS_METHOD_CALL_INIT => "THREE_DS_METHOD_CALL_INIT" + | THREE_DS_METHOD_CALL => "THREE_DS_METHOD_CALL" | CONFIRM_CALL_INIT => "CONFIRM_CALL_INIT" | CONFIRM_CALL => "CONFIRM_CALL" | SESSIONS_CALL_INIT => "SESSIONS_CALL_INIT" @@ -112,6 +124,9 @@ let eventNameToStrMapper = eventName => { | DISPLAY_BANK_TRANSFER_INFO_PAGE => "DISPLAY_BANK_TRANSFER_INFO_PAGE" | DISPLAY_QR_CODE_INFO_PAGE => "DISPLAY_QR_CODE_INFO_PAGE" | DISPLAY_VOUCHER => "DISPLAY_VOUCHER" + | DISPLAY_THREE_DS_SDK => "DISPLAY_THREE_DS_SDK" + | THREE_DS_METHOD => "THREE_DS_METHOD" + | THREE_DS_METHOD_RESULT => "THREE_DS_METHOD_RESULT" | PAYMENT_METHODS_RESPONSE => "PAYMENT_METHODS_RESPONSE" | LOADER_CHANGED => "LOADER_CHANGED" | PAYMENT_SESSION_INITIATED => "PAYMENT_SESSION_INITIATED" @@ -178,7 +193,7 @@ type loggerMake = { ~logType: logType=?, ~logCategory: logCategory=?, ~paymentMethod: string=?, - ~type_: string=?, + ~apiLogType: apiLogType=?, unit, ) => unit, setLogInitiated: unit => unit, @@ -213,7 +228,7 @@ let defaultLoggerConfig = { ~logType as _=?, ~logCategory as _=?, ~paymentMethod as _=?, - ~type_ as _=?, + ~apiLogType as _=?, (), ) => (), setLogInfo: ( @@ -500,6 +515,8 @@ let make = ( PAYMENT_DATA_FILLED, PAYMENT_ATTEMPT, CONFIRM_CALL, + AUTHENTICATION_CALL, + THREE_DS_METHOD_CALL, SDK_CRASH, REDIRECTING_USER, DISPLAY_BANK_TRANSFER_INFO_PAGE, @@ -529,7 +546,7 @@ let make = ( } } - let calculateLatencyHook = (~eventName, ~type_="", ()) => { + let calculateLatencyHook = (~eventName, ~apiLogType=Method, ()) => { let currentTimestamp = Date.now() let latency = switch eventName { | PAYMENT_ATTEMPT => { @@ -539,6 +556,8 @@ let make = ( | _ => -1. } } + | AUTHENTICATION_CALL + | THREE_DS_METHOD_CALL | RETRIEVE_CALL | CONFIRM_CALL | SESSIONS_CALL @@ -546,8 +565,8 @@ let make = ( | CUSTOMER_PAYMENT_METHODS_CALL => { let logRequestTimestamp = events.contents->Dict.get(eventName->eventNameToStrMapper ++ "_INIT") - switch (logRequestTimestamp, type_) { - | (Some(_), "request") => 0. + switch (logRequestTimestamp, apiLogType) { + | (Some(_), Request) => 0. | (Some(float), _) => currentTimestamp -. float | _ => 0. } @@ -618,12 +637,12 @@ let make = ( ~logType=INFO, ~logCategory=API, ~paymentMethod="", - ~type_="", + ~apiLogType=Request, (), ) => { let eventNameStr = eventName->eventNameToStrMapper let firstEvent = events.contents->Dict.get(eventNameStr)->Option.isNone - let latency = calculateLatencyHook(~eventName, ~type_, ()) + let latency = calculateLatencyHook(~eventName, ~apiLogType, ()) let localTimestamp = timestamp->Option.getOr(Date.now()->Belt.Float.toString) let localTimestampFloat = localTimestamp->Belt.Float.fromString->Option.getOr(Date.now()) { From ad2fa630c639c7b246176f1d2683050a58ad3e36 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 4 Apr 2024 13:00:30 +0530 Subject: [PATCH 04/14] feat: giropay dynamic fields added (#267) --- src/Components/DynamicFields.res | 824 ++++++++++++------------- src/Payments/PaymentMethodsRecord.res | 3 +- src/Payments/PaymentMethodsWrapper.res | 2 +- 3 files changed, 413 insertions(+), 416 deletions(-) diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index 1784479e3..bef9f90ae 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -318,425 +318,421 @@ let make = ( dynamicFieldsToRenderInsideBilling->Array.length > 0 && (dynamicFieldsToRenderInsideBilling->Array.length > 1 || !isOnlyInfoElementPresent) - { - fieldsArr->Array.length > 0 - ? <> - {dynamicFieldsToRenderOutsideBilling - ->Array.mapWithIndex((item, index) => { -
Int.toString}`} - className="flex flex-col w-full place-content-between" - style={ReactDOMStyle.make( - ~marginTop=index !== 0 || paymentMethod === "card" - ? themeObj.spacingGridColumn - : "", - ~gridColumnGap=themeObj.spacingGridRow, - (), - )}> - {switch item { - | CardNumber => - - | CardExpiryMonth - | CardExpiryYear - | CardExpiryMonthAndYear => - - | CardCvc => - - | CardExpiryAndCvc => -
- Array.length > 0}> + {<> + {dynamicFieldsToRenderOutsideBilling + ->Array.mapWithIndex((item, index) => { +
Int.toString}`} + className="flex flex-col w-full place-content-between" + style={ReactDOMStyle.make( + ~marginTop=index !== 0 || paymentMethod === "card" ? themeObj.spacingGridColumn : "", + ~gridColumnGap=themeObj.spacingGridRow, + (), + )}> + {switch item { + | CardNumber => + + | CardExpiryMonth + | CardExpiryYear + | CardExpiryMonthAndYear => + + | CardCvc => + + | CardExpiryAndCvc => +
+ + +
+ | Currency(currencyArr) => + + | FullName => + getCustomFieldName} + optionalRequiredFields={Some(requiredFields)} + /> + | Email + | InfoElement + | Country + | Bank + | None + | BillingName + | PhoneNumber + | AddressLine1 + | AddressLine2 + | AddressCity + | StateAndCity + | AddressPincode + | AddressState + | BlikCode + | SpecialField(_) + | CountryAndPincode(_) + | AddressCountry(_) => React.null + }} +
+ }) + ->React.array} + +
+ {React.string(localeString.billingDetailsText)} +
+ {dynamicFieldsToRenderInsideBilling + ->Array.mapWithIndex((item, index) => { +
Int.toString}`} + className="flex flex-col w-full place-content-between"> + {switch item { + | BillingName => + | Email => + | PhoneNumber => + | StateAndCity => +
+ { + let value = ReactEvent.Form.target(ev)["value"] + setCity(prev => { + isValid: value !== "" ? Some(true) : Some(false), + value, + errorString: value !== "" ? "" : prev.errorString, + }) + }} + onBlur={ev => { + let value = ReactEvent.Focus.target(ev)["value"] + setCity(prev => { + ...prev, + isValid: Some(value !== ""), + }) + }} + paymentType + type_="text" + name="city" + inputRef=cityRef + placeholder=localeString.cityLabel + /> + {switch stateJson { + | Some(options) => + Utils.getStateNames({ + value: country, + isValid: None, + errorString: "", + })} + /> + | None => React.null + }} +
+ | CountryAndPincode(countryArr) => +
+ + { + let value = ReactEvent.Focus.target(ev)["value"] + setPostalCode(prev => { + ...prev, + isValid: Some(value !== ""), + }) + }} + onChange=onPostalChange + paymentType + name="postal" + inputRef=postalRef + placeholder=localeString.postalCodeLabel + /> +
+ | AddressLine1 => + { + let value = ReactEvent.Form.target(ev)["value"] + setLine1(prev => { + isValid: value !== "" ? Some(true) : Some(false), + value, + errorString: value !== "" ? "" : prev.errorString, + }) + }} + onBlur={ev => { + let value = ReactEvent.Focus.target(ev)["value"] + setLine1(prev => { + ...prev, + isValid: Some(value !== ""), + }) + }} paymentType - type_="tel" - appearance=config.appearance - maxLength=7 - inputRef=expiryRef - placeholder="MM / YY" + type_="text" + name="line1" + inputRef=line1Ref + placeholder=localeString.line1Placeholder + /> + | AddressLine2 => + { + let value = ReactEvent.Form.target(ev)["value"] + setLine2(prev => { + isValid: value !== "" ? Some(true) : Some(false), + value, + errorString: value !== "" ? "" : prev.errorString, + }) + }} + onBlur={ev => { + let value = ReactEvent.Focus.target(ev)["value"] + setLine2(prev => { + ...prev, + isValid: Some(value !== ""), + }) + }} + paymentType + type_="text" + name="line2" + inputRef=line2Ref + placeholder=localeString.line2Placeholder + /> + | AddressCity => + { + let value = ReactEvent.Form.target(ev)["value"] + setCity(prev => { + isValid: value !== "" ? Some(true) : Some(false), + value, + errorString: value !== "" ? "" : prev.errorString, + }) + }} + onBlur={ev => { + let value = ReactEvent.Focus.target(ev)["value"] + setCity(prev => { + ...prev, + isValid: Some(value !== ""), + }) + }} + paymentType + type_="text" + name="city" + inputRef=cityRef + placeholder=localeString.cityLabel /> - + switch stateJson { + | Some(options) => + Utils.getStateNames({ + value: country, + isValid: None, + errorString: "", + })} + /> + | None => React.null + } + | AddressPincode => + { + let value = ReactEvent.Focus.target(ev)["value"] + setPostalCode(prev => { + ...prev, + isValid: Some(value !== ""), + }) + }} + onChange=onPostalChange paymentType - rightIcon={CardUtils.setRightIconForCvc( - ~cardEmpty, - ~cardInvalid, - ~color=themeObj.colorIconCardCvcError, - ~cardComplete, - )} + name="postal" + inputRef=postalRef + placeholder=localeString.postalCodeLabel + /> + | BlikCode => + | Country => + -
- | Currency(currencyArr) => - - | FullName => - getCustomFieldName} - optionalRequiredFields={Some(requiredFields)} - /> - | Email - | InfoElement - | Country - | Bank - | None - | BillingName - | PhoneNumber - | AddressLine1 - | AddressLine2 - | AddressCity - | StateAndCity - | AddressPincode - | AddressState - | BlikCode - | SpecialField(_) - | CountryAndPincode(_) - | AddressCountry(_) => React.null - }} -
- }) - ->React.array} - -
- {React.string(localeString.billingDetailsText)} -
- {dynamicFieldsToRenderInsideBilling - ->Array.mapWithIndex((item, index) => { -
Int.toString}`} - className="flex flex-col w-full place-content-between"> - {switch item { - | BillingName => - | Email => - | PhoneNumber => - | StateAndCity => -
- { - let value = ReactEvent.Form.target(ev)["value"] - setCity(prev => { - isValid: value !== "" ? Some(true) : Some(false), - value, - errorString: value !== "" ? "" : prev.errorString, - }) - }} - onBlur={ev => { - let value = ReactEvent.Focus.target(ev)["value"] - setCity(prev => { - ...prev, - isValid: Some(value !== ""), - }) - }} - paymentType - type_="text" - name="city" - inputRef=cityRef - placeholder=localeString.cityLabel - /> - {switch stateJson { - | Some(options) => - Utils.getStateNames({ - value: country, - isValid: None, - errorString: "", - })} - /> - | None => React.null - }} -
- | CountryAndPincode(countryArr) => -
- - { - let value = ReactEvent.Focus.target(ev)["value"] - setPostalCode(prev => { - ...prev, - isValid: Some(value !== ""), - }) - }} - onChange=onPostalChange - paymentType - name="postal" - inputRef=postalRef - placeholder=localeString.postalCodeLabel - /> -
- | AddressLine1 => - { - let value = ReactEvent.Form.target(ev)["value"] - setLine1(prev => { - isValid: value !== "" ? Some(true) : Some(false), - value, - errorString: value !== "" ? "" : prev.errorString, - }) - }} - onBlur={ev => { - let value = ReactEvent.Focus.target(ev)["value"] - setLine1(prev => { - ...prev, - isValid: Some(value !== ""), - }) - }} - paymentType - type_="text" - name="line1" - inputRef=line1Ref - placeholder=localeString.line1Placeholder - /> - | AddressLine2 => - { - let value = ReactEvent.Form.target(ev)["value"] - setLine2(prev => { - isValid: value !== "" ? Some(true) : Some(false), - value, - errorString: value !== "" ? "" : prev.errorString, - }) - }} - onBlur={ev => { - let value = ReactEvent.Focus.target(ev)["value"] - setLine2(prev => { - ...prev, - isValid: Some(value !== ""), - }) - }} - paymentType - type_="text" - name="line2" - inputRef=line2Ref - placeholder=localeString.line2Placeholder - /> - | AddressCity => - { - let value = ReactEvent.Form.target(ev)["value"] - setCity(prev => { - isValid: value !== "" ? Some(true) : Some(false), - value, - errorString: value !== "" ? "" : prev.errorString, - }) - }} - onBlur={ev => { - let value = ReactEvent.Focus.target(ev)["value"] - setCity(prev => { - ...prev, - isValid: Some(value !== ""), - }) - }} - paymentType - type_="text" - name="city" - inputRef=cityRef - placeholder=localeString.cityLabel - /> - | AddressState => - switch stateJson { - | Some(options) => - Utils.getStateNames({ - value: country, - isValid: None, - errorString: "", - })} - /> - | None => React.null - } - | AddressPincode => - { - let value = ReactEvent.Focus.target(ev)["value"] - setPostalCode(prev => { - ...prev, - isValid: Some(value !== ""), - }) - }} - onChange=onPostalChange - paymentType - name="postal" - inputRef=postalRef - placeholder=localeString.postalCodeLabel - /> - | BlikCode => - | Country => - - | AddressCountry(countryArr) => - - | Bank => - - | SpecialField(element) => element - | InfoElement => - <> - - {if fieldsArr->Array.length > 1 { - bottomElement - } else { - - }} - - | CardNumber - | CardExpiryMonth - | CardExpiryYear - | CardExpiryMonthAndYear - | CardCvc - | CardExpiryAndCvc - | Currency(_) - | FullName - | None => React.null + | AddressCountry(countryArr) => + + | Bank => + + | SpecialField(element) => element + | InfoElement => + <> + + {if fieldsArr->Array.length > 1 { + bottomElement + } else { + }} -
- }) - ->React.array} + + | CardNumber + | CardExpiryMonth + | CardExpiryYear + | CardExpiryMonthAndYear + | CardCvc + | CardExpiryAndCvc + | Currency(_) + | FullName + | None => React.null + }}
-
-
- - {<> - - {if fieldsArr->Array.length > 1 { - bottomElement - } else { - - }} - } - - - - - - : React.null - } + }) + ->React.array} +
+
+ + + {<> + + {if fieldsArr->Array.length > 1 { + bottomElement + } else { + + }} + } + + + + + } + } diff --git a/src/Payments/PaymentMethodsRecord.res b/src/Payments/PaymentMethodsRecord.res index 143e0413e..b77b5ddff 100644 --- a/src/Payments/PaymentMethodsRecord.res +++ b/src/Payments/PaymentMethodsRecord.res @@ -223,7 +223,7 @@ let paymentMethodsFields = [ paymentMethodName: "giropay", icon: Some(icon("giropay", ~size=19, ~width=25)), displayName: "GiroPay", - fields: [FullName, InfoElement], + fields: [InfoElement], miniIcon: None, }, { @@ -578,6 +578,7 @@ let dynamicFieldsEnabledPaymentMethods = [ "ideal", "sofort", "pix_transfer", + "giropay", ] let getIsBillingField = requiredFieldType => { diff --git a/src/Payments/PaymentMethodsWrapper.res b/src/Payments/PaymentMethodsWrapper.res index 7ee67cc8c..2c7d1710f 100644 --- a/src/Payments/PaymentMethodsWrapper.res +++ b/src/Payments/PaymentMethodsWrapper.res @@ -115,7 +115,7 @@ let make = ( )) useSubmitPaymentData(submitCallback)
Date: Thu, 4 Apr 2024 07:32:34 +0000 Subject: [PATCH 05/14] chore(release): 0.36.0 [skip ci] # [0.36.0](https://github.com/juspay/hyperswitch-web/compare/v0.35.6...v0.36.0) (2024-04-04) ### Features * **3ds:** three DS SDK - adding logs to track milestone events ([#265](https://github.com/juspay/hyperswitch-web/issues/265)) ([ceab161](https://github.com/juspay/hyperswitch-web/commit/ceab1614e80d8cfb96ac3eea04486ebd509e0770)) * giropay dynamic fields added ([#267](https://github.com/juspay/hyperswitch-web/issues/267)) ([ad2fa63](https://github.com/juspay/hyperswitch-web/commit/ad2fa630c639c7b246176f1d2683050a58ad3e36)) --- CHANGELOG.md | 8 +++ package-lock.json | 179 +++++++++++++++------------------------------- package.json | 2 +- 3 files changed, 67 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2409ede02..b0d08ada8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# [0.36.0](https://github.com/juspay/hyperswitch-web/compare/v0.35.6...v0.36.0) (2024-04-04) + + +### Features + +* **3ds:** three DS SDK - adding logs to track milestone events ([#265](https://github.com/juspay/hyperswitch-web/issues/265)) ([ceab161](https://github.com/juspay/hyperswitch-web/commit/ceab1614e80d8cfb96ac3eea04486ebd509e0770)) +* giropay dynamic fields added ([#267](https://github.com/juspay/hyperswitch-web/issues/267)) ([ad2fa63](https://github.com/juspay/hyperswitch-web/commit/ad2fa630c639c7b246176f1d2683050a58ad3e36)) + ## [0.35.6](https://github.com/juspay/hyperswitch-web/compare/v0.35.5...v0.35.6) (2024-04-02) diff --git a/package-lock.json b/package-lock.json index 4eb12e8cd..c4bbdfe85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.35.6", + "version": "0.36.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2870,21 +2870,6 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2902,40 +2887,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2945,23 +2896,6 @@ "ansi-regex": "^6.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - } - } - }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2972,60 +2906,6 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } } } }, @@ -20972,6 +20852,17 @@ "strip-ansi": "^6.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -21063,6 +20954,15 @@ "ansi-regex": "^5.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -23630,6 +23530,43 @@ } } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index e11908492..407624b0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.35.6", + "version": "0.36.0", "main": "index.js", "private": true, "dependencies": { From 1f082ebe2031a10129b24238f1c60fabd6f5e2e0 Mon Sep 17 00:00:00 2001 From: ArushKapoorJuspay <121166031+ArushKapoorJuspay@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:11:31 +0530 Subject: [PATCH 06/14] fix: added Loader and Error Handling for TrustPay GooglePay (#268) --- src/Payments/GPay.res | 5 ++ src/Utilities/PaymentHelpers.res | 31 ++++++++-- src/orca-loader/Elements.res | 101 +++++++++++++++++++++---------- 3 files changed, 100 insertions(+), 37 deletions(-) diff --git a/src/Payments/GPay.res b/src/Payments/GPay.res index 96c540ca8..acc0c9889 100644 --- a/src/Payments/GPay.res +++ b/src/Payments/GPay.res @@ -151,6 +151,11 @@ let make = ( if result { if isInvokeSDKFlow { if isDelayedSessionToken { + handlePostMessage([ + ("fullscreen", true->JSON.Encode.bool), + ("param", "paymentloader"->JSON.Encode.string), + ("iframeId", iframeId->JSON.Encode.string), + ]) let bodyDict = PaymentBody.gPayThirdPartySdkBody(~connectors) processPayment(bodyDict) } else { diff --git a/src/Utilities/PaymentHelpers.res b/src/Utilities/PaymentHelpers.res index fa16ef0fe..86d32e11d 100644 --- a/src/Utilities/PaymentHelpers.res +++ b/src/Utilities/PaymentHelpers.res @@ -12,11 +12,18 @@ type payment = Card | BankTransfer | BankDebits | KlarnaRedirect | Gpay | Applep let closePaymentLoaderIfAny = () => Utils.handlePostMessage([("fullscreen", false->JSON.Encode.bool)]) -let retrievePaymentIntent = (clientSecret, headers, ~optLogger, ~switchToCustomPod) => { +let retrievePaymentIntent = ( + clientSecret, + headers, + ~optLogger, + ~switchToCustomPod, + ~isForceSync=false, +) => { open Promise let paymentIntentID = String.split(clientSecret, "_secret_")->Array.get(0)->Option.getOr("") let endpoint = ApiEndpoint.getApiEndPoint() - let uri = `${endpoint}/payments/${paymentIntentID}?client_secret=${clientSecret}` + let forceSync = isForceSync ? "&force_sync=true" : "" + let uri = `${endpoint}/payments/${paymentIntentID}?client_secret=${clientSecret}${forceSync}` logApi( ~optLogger, @@ -209,9 +216,15 @@ let threeDsAuth = (~clientSecret, ~optLogger, ~threeDsMethodComp, ~headers) => { }) } -let rec pollRetrievePaymentIntent = (clientSecret, headers, ~optLogger, ~switchToCustomPod) => { +let rec pollRetrievePaymentIntent = ( + clientSecret, + headers, + ~optLogger, + ~switchToCustomPod, + ~isForceSync=false, +) => { open Promise - retrievePaymentIntent(clientSecret, headers, ~optLogger, ~switchToCustomPod) + retrievePaymentIntent(clientSecret, headers, ~optLogger, ~switchToCustomPod, ~isForceSync) ->then(json => { let dict = json->JSON.Decode.object->Option.getOr(Dict.make()) let status = dict->getString("status", "") @@ -220,13 +233,19 @@ let rec pollRetrievePaymentIntent = (clientSecret, headers, ~optLogger, ~switchT resolve(json) } else { delay(2000)->then(_val => { - pollRetrievePaymentIntent(clientSecret, headers, ~optLogger, ~switchToCustomPod) + pollRetrievePaymentIntent( + clientSecret, + headers, + ~optLogger, + ~switchToCustomPod, + ~isForceSync, + ) }) } }) ->catch(e => { Console.log2("Unable to retrieve payment due to following error", e) - pollRetrievePaymentIntent(clientSecret, headers, ~optLogger, ~switchToCustomPod) + pollRetrievePaymentIntent(clientSecret, headers, ~optLogger, ~switchToCustomPod, ~isForceSync) }) } diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 118fb1689..aa9e33e5f 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -305,40 +305,79 @@ let make = ( paymentDataRequest->GooglePayType.jsonToPaymentRequestDataType( googlePayThirdPartySession, ) - let secrets = googlePayThirdPartySession->getJsonFromDict("secrets", JSON.Encode.null) - let payment = secrets->getDictFromJson->getString("payment", "") + let headers = [("Content-Type", "application/json"), ("api-key", publishableKey)] + + let connector = + googlePayThirdPartySession + ->Dict.get("connector") + ->Option.getOr(JSON.Encode.null) + ->JSON.Decode.string + ->Option.getOr("") try { - let trustpay = trustPayApi(secrets) - trustpay.executeGooglePayment(payment, googlePayRequest) - ->then(res => { - logger.setLogInfo( - ~value="TrustPay GooglePay Success Response", - ~internalMetadata=res->JSON.stringify, - ~eventName=GOOGLE_PAY_FLOW, - ~paymentMethod="GOOGLE_PAY", - (), - ) - let msg = [("googlePaySyncPayment", true->JSON.Encode.bool)]->Dict.fromArray - mountedIframeRef->Window.iframePostMessage(msg) - resolve() - }) - ->catch(err => { - let exceptionMessage = err->formatException->JSON.stringify - logger.setLogInfo( - ~value=exceptionMessage, - ~eventName=GOOGLE_PAY_FLOW, - ~paymentMethod="GOOGLE_PAY", - ~logType=ERROR, - ~logCategory=USER_ERROR, - (), - ) - let msg = [("googlePaySyncPayment", true->JSON.Encode.bool)]->Dict.fromArray - mountedIframeRef->Window.iframePostMessage(msg) - resolve() - }) - ->ignore + switch connector { + | "trustpay" => { + let secrets = + googlePayThirdPartySession->Utils.getJsonFromDict("secrets", JSON.Encode.null) + + let payment = secrets->Utils.getDictFromJson->Utils.getString("payment", "") + + let trustpay = trustPayApi(secrets) + + let polling = + Utils.delay(2000)->then(_ => + PaymentHelpers.pollRetrievePaymentIntent( + clientSecret, + headers, + ~optLogger=Some(logger), + ~switchToCustomPod, + ~isForceSync=true, + ) + ) + let executeGooglePayment = trustpay.executeGooglePayment( + payment, + googlePayRequest, + ) + let timeOut = Utils.delay(600000)->then(_ => { + let errorMsg = + [("error", "Request Timed Out"->JSON.Encode.string)] + ->Dict.fromArray + ->JSON.Encode.object + reject(Exn.anyToExnInternal(errorMsg)) + }) + + Promise.race([polling, executeGooglePayment, timeOut]) + ->then(res => { + logger.setLogInfo( + ~value="TrustPay GooglePay Response", + ~internalMetadata=res->JSON.stringify, + ~eventName=GOOGLE_PAY_FLOW, + ~paymentMethod="GOOGLE_PAY", + (), + ) + let msg = [("googlePaySyncPayment", true->JSON.Encode.bool)]->Dict.fromArray + mountedIframeRef->Window.iframePostMessage(msg) + resolve() + }) + ->catch(err => { + let exceptionMessage = err->Utils.formatException->JSON.stringify + logger.setLogInfo( + ~value=exceptionMessage, + ~eventName=GOOGLE_PAY_FLOW, + ~paymentMethod="GOOGLE_PAY", + ~logType=ERROR, + ~logCategory=USER_ERROR, + (), + ) + let msg = [("googlePaySyncPayment", true->JSON.Encode.bool)]->Dict.fromArray + mountedIframeRef->Window.iframePostMessage(msg) + resolve() + }) + ->ignore + } + | _ => () + } } catch { | err => { let exceptionMessage = err->formatException->JSON.stringify From 7a3431305992b8d3e9c07238815158b77704ec57 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 4 Apr 2024 08:43:41 +0000 Subject: [PATCH 07/14] chore(release): 0.36.1 [skip ci] ## [0.36.1](https://github.com/juspay/hyperswitch-web/compare/v0.36.0...v0.36.1) (2024-04-04) ### Bug Fixes * added Loader and Error Handling for TrustPay GooglePay ([#268](https://github.com/juspay/hyperswitch-web/issues/268)) ([1f082eb](https://github.com/juspay/hyperswitch-web/commit/1f082ebe2031a10129b24238f1c60fabd6f5e2e0)) --- CHANGELOG.md | 7 ++ package-lock.json | 179 +++++++++++++++++++++++++++++++--------------- package.json | 2 +- 3 files changed, 129 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0d08ada8..cba71aa67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.36.1](https://github.com/juspay/hyperswitch-web/compare/v0.36.0...v0.36.1) (2024-04-04) + + +### Bug Fixes + +* added Loader and Error Handling for TrustPay GooglePay ([#268](https://github.com/juspay/hyperswitch-web/issues/268)) ([1f082eb](https://github.com/juspay/hyperswitch-web/commit/1f082ebe2031a10129b24238f1c60fabd6f5e2e0)) + # [0.36.0](https://github.com/juspay/hyperswitch-web/compare/v0.35.6...v0.36.0) (2024-04-04) diff --git a/package-lock.json b/package-lock.json index c4bbdfe85..101fe6213 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.36.0", + "version": "0.36.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2870,6 +2870,21 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2887,6 +2902,40 @@ "strip-ansi": "^7.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2896,6 +2945,23 @@ "ansi-regex": "^6.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } + } + }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2906,6 +2972,60 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } } } }, @@ -20852,17 +20972,6 @@ "strip-ansi": "^6.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -20954,15 +21063,6 @@ "ansi-regex": "^5.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -23530,43 +23630,6 @@ } } }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 407624b0d..de47c185c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.36.0", + "version": "0.36.1", "main": "index.js", "private": true, "dependencies": { From 9294c5f292bae8dcff2eaa395f8972ffa7e6110b Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:43:12 +0530 Subject: [PATCH 08/14] fix(sentry): reduced sentry tracesSampleRate from 1 to 0.1 (#242) Co-authored-by: Praful Koppalkar <126236898+prafulkoppalkar@users.noreply.github.com> --- src/orca-log-catcher/Sentry.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/orca-log-catcher/Sentry.res b/src/orca-log-catcher/Sentry.res index b0f1d8bab..3d46c750c 100644 --- a/src/orca-log-catcher/Sentry.res +++ b/src/orca-log-catcher/Sentry.res @@ -75,7 +75,7 @@ let initiateSentry = (~dsn) => { }), newSentryReplay(), ], - tracesSampleRate: 1.0, + tracesSampleRate: 0.1, tracePropagationTargets: [ "localhost", "https://dev.hyperswitch.io", From 9bf47c1f972a93258850bf49ed8a84eab7fe44f0 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 4 Apr 2024 10:15:16 +0000 Subject: [PATCH 09/14] chore(release): 0.36.2 [skip ci] ## [0.36.2](https://github.com/juspay/hyperswitch-web/compare/v0.36.1...v0.36.2) (2024-04-04) ### Bug Fixes * **sentry:** reduced sentry tracesSampleRate from 1 to 0.1 ([#242](https://github.com/juspay/hyperswitch-web/issues/242)) ([9294c5f](https://github.com/juspay/hyperswitch-web/commit/9294c5f292bae8dcff2eaa395f8972ffa7e6110b)) --- CHANGELOG.md | 7 ++ package-lock.json | 179 +++++++++++++++------------------------------- package.json | 2 +- 3 files changed, 66 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cba71aa67..e3886e958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.36.2](https://github.com/juspay/hyperswitch-web/compare/v0.36.1...v0.36.2) (2024-04-04) + + +### Bug Fixes + +* **sentry:** reduced sentry tracesSampleRate from 1 to 0.1 ([#242](https://github.com/juspay/hyperswitch-web/issues/242)) ([9294c5f](https://github.com/juspay/hyperswitch-web/commit/9294c5f292bae8dcff2eaa395f8972ffa7e6110b)) + ## [0.36.1](https://github.com/juspay/hyperswitch-web/compare/v0.36.0...v0.36.1) (2024-04-04) diff --git a/package-lock.json b/package-lock.json index 101fe6213..e372d4303 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.36.1", + "version": "0.36.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2870,21 +2870,6 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2902,40 +2887,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2945,23 +2896,6 @@ "ansi-regex": "^6.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - } - } - }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2972,60 +2906,6 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } } } }, @@ -20972,6 +20852,17 @@ "strip-ansi": "^6.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -21063,6 +20954,15 @@ "ansi-regex": "^5.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -23630,6 +23530,43 @@ } } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index de47c185c..86f681418 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.36.1", + "version": "0.36.2", "main": "index.js", "private": true, "dependencies": { From e3509f0b67b752c9a6a656e47372ad5e84026cf3 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:01:30 +0530 Subject: [PATCH 10/14] fix: app rendered event latency calculation (#273) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/LoaderController.res | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/LoaderController.res b/src/LoaderController.res index 3ad0797f5..f4f7e3624 100644 --- a/src/LoaderController.res +++ b/src/LoaderController.res @@ -131,7 +131,11 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime showCardFormByDefault && Utils.checkPriorityList(paymentMethodOrder) ? SemiLoaded : Loading | x => x } - let finalLoadLatency = Date.now() -. launchTime + let finalLoadLatency = if launchTime <= 0.0 { + -1.0 + } else { + Date.now() -. launchTime + } switch updatedState { | Loaded(_) => logger.setLogInfo(~value="Loaded", ~eventName=LOADER_CHANGED, ~latency=finalLoadLatency, ()) @@ -263,8 +267,9 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime }) } } - setLaunchTime(_ => dict->Utils.getFloat("launchTime", 0.0)) - let initLoadlatency = Date.now() -. launchTime + let newLaunchTime = dict->Utils.getFloat("launchTime", 0.0) + setLaunchTime(_ => newLaunchTime) + let initLoadlatency = Date.now() -. newLaunchTime logger.setLogInfo( ~value=Window.href, ~eventName=APP_RENDERED, @@ -357,7 +362,11 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime } if dict->getDictIsSome("paymentMethodList") { let list = dict->getJsonObjectFromDict("paymentMethodList") - let finalLoadlatency = Date.now() -. launchTime + let finalLoadLatency = if launchTime <= 0.0 { + -1.0 + } else { + Date.now() -. launchTime + } let updatedState: PaymentType.loadType = list == Dict.make()->JSON.Encode.object ? LoadError(list) @@ -375,14 +384,14 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime logger.setLogInfo( ~value="Loaded", ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, + ~latency=finalLoadLatency, (), ) | LoadError(x) => logger.setLogError( ~value="LoadError: " ++ x->JSON.stringify, ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, + ~latency=finalLoadLatency, (), ) | _ => () @@ -398,7 +407,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime ? logger.setLogInfo( ~value="Loaded", ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, + ~latency=finalLoadLatency, (), ) : evalMethodsList() @@ -414,7 +423,11 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime ...prev, customerPaymentMethods, }) - let finalLoadlatency = Date.now() -. launchTime + let finalLoadLatency = if launchTime <= 0.0 { + -1.0 + } else { + Date.now() -. launchTime + } let evalMethodsList = () => switch paymentlist { @@ -422,14 +435,14 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime logger.setLogInfo( ~value="Loaded", ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, + ~latency=finalLoadLatency, (), ) | LoadError(x) => logger.setLogError( ~value="LoadError: " ++ x->JSON.stringify, ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, + ~latency=finalLoadLatency, (), ) @@ -443,7 +456,7 @@ let make = (~children, ~paymentMode, ~setIntegrateErrorError, ~logger, ~initTime ? logger.setLogInfo( ~value="Loaded", ~eventName=LOADER_CHANGED, - ~latency=finalLoadlatency, + ~latency=finalLoadLatency, (), ) : evalMethodsList() From e9d76ae225f39ba963967161413c2a0422d4a4aa Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:01:58 +0530 Subject: [PATCH 11/14] feat: logging payment data filled (#269) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/Components/SavedMethods.res | 33 ++++++++++++++++++++++------- src/Payments/ApplePay.res | 7 ++++++ src/Payments/GPay.res | 3 ++- src/Utilities/Utils.res | 10 ++++----- src/orca-loader/Elements.res | 6 ------ src/orca-log-catcher/OrcaLogger.res | 6 ++++-- 6 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/Components/SavedMethods.res b/src/Components/SavedMethods.res index be7812e29..f2ad312fb 100644 --- a/src/Components/SavedMethods.res +++ b/src/Components/SavedMethods.res @@ -71,11 +71,19 @@ let make = ( | _ => false } let empty = cvcNumber == "" + let (token, customerId) = paymentToken + let customerMethod = + savedMethods + ->Array.filter(savedMethod => { + savedMethod.paymentToken === token + }) + ->Array.get(0) + ->Option.getOr(PaymentType.defaultCustomerMethods) + let isUnknownPaymentMethod = customerMethod.paymentMethod === "" + let isCardPaymentMethod = customerMethod.paymentMethod === "card" + let isCardPaymentMethodValid = !customerMethod.requiresCvv || (complete && !empty) - let submitCallback = React.useCallback((ev: Window.event) => { - let json = ev.data->JSON.parseExn - let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper - let (token, customerId) = paymentToken + React.useEffect(() => { let customerMethod = savedMethods ->Array.filter(savedMethod => { @@ -83,9 +91,18 @@ let make = ( }) ->Array.get(0) ->Option.getOr(PaymentType.defaultCustomerMethods) - let isUnknownPaymentMethod = customerMethod.paymentMethod === "" - let isCardPaymentMethod = customerMethod.paymentMethod === "card" - let isCardPaymentMethodValid = !customerMethod.requiresCvv || (complete && !empty) + let complete = + areRequiredFieldsValid && + !isUnknownPaymentMethod && + (!isCardPaymentMethod || isCardPaymentMethodValid) + let paymentType = customerMethod.paymentMethodType->Option.getOr(customerMethod.paymentMethod) + handlePostMessageEvents(~complete, ~empty, ~paymentType, ~loggerState, ~savedMethod=true) + None + }, (areRequiredFieldsValid, empty, customerMethod, isCardPaymentMethodValid)) + + let submitCallback = React.useCallback((ev: Window.event) => { + let json = ev.data->JSON.parseExn + let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper let savedPaymentMethodBody = switch customerMethod.paymentMethod { | "card" => @@ -144,7 +161,7 @@ let make = ( } } } - }, (areRequiredFieldsValid, requiredFieldsBody, empty, complete)) + }, (areRequiredFieldsValid, requiredFieldsBody, empty, complete, customerMethod)) useSubmitPaymentData(submitCallback)
diff --git a/src/Payments/ApplePay.res b/src/Payments/ApplePay.res index e5375462c..cbbbc9ae5 100644 --- a/src/Payments/ApplePay.res +++ b/src/Payments/ApplePay.res @@ -273,6 +273,13 @@ let make = ( let bodyDict = PaymentBody.applePayRedirectBody(~connectors) processPayment(bodyDict) } + let value = "Payment Data Filled: New Payment Method" + loggerState.setLogInfo( + ~value, + ~eventName=PAYMENT_DATA_FILLED, + ~paymentMethod="APPLE_PAY", + (), + ) } else { setApplePayClicked(_ => false) } diff --git a/src/Payments/GPay.res b/src/Payments/GPay.res index acc0c9889..5cc0bbfba 100644 --- a/src/Payments/GPay.res +++ b/src/Payments/GPay.res @@ -170,8 +170,9 @@ let make = ( let bodyDict = PaymentBody.gpayRedirectBody(~connectors) processPayment(bodyDict) } + let value = "Payment Data Filled: New Payment Method" loggerState.setLogInfo( - ~value="", + ~value, ~eventName=PAYMENT_DATA_FILLED, ~paymentMethod="GOOGLE_PAY", (), diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index a0b8684d9..fabbba72b 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -659,14 +659,12 @@ let handlePostMessageEvents = ( ~empty, ~paymentType, ~loggerState: OrcaPaymentPage.OrcaLogger.loggerMake, + ~savedMethod=false, ) => { if complete && paymentType !== "" { - loggerState.setLogInfo( - ~value="Payment Data Filled", - ~eventName=PAYMENT_DATA_FILLED, - ~paymentMethod=paymentType, - (), - ) + let value = + "Payment Data Filled" ++ (savedMethod ? ": Saved Payment Method" : ": New Payment Method") + loggerState.setLogInfo(~value, ~eventName=PAYMENT_DATA_FILLED, ~paymentMethod=paymentType, ()) } handlePostMessage([ ("elementType", "payment"->JSON.Encode.string), diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index aa9e33e5f..b5164d21d 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -537,12 +537,6 @@ let make = ( let msg = [("applePaySyncPayment", true->JSON.Encode.bool)]->Dict.fromArray mountedIframeRef->Window.iframePostMessage(msg) - logger.setLogInfo( - ~value="", - ~eventName=PAYMENT_DATA_FILLED, - ~paymentMethod="APPLE_PAY", - (), - ) resolve() }) ->catch(err => { diff --git a/src/orca-log-catcher/OrcaLogger.res b/src/orca-log-catcher/OrcaLogger.res index 3032c428e..32df8bc84 100644 --- a/src/orca-log-catcher/OrcaLogger.res +++ b/src/orca-log-catcher/OrcaLogger.res @@ -497,9 +497,9 @@ let make = ( switch timeOut.contents { | Some(val) => { clearTimeout(val) - timeOut := Some(setTimeout(() => sendLogs(), 120000)) + timeOut := Some(setTimeout(() => sendLogs(), 20000)) } - | None => timeOut := Some(setTimeout(() => sendLogs(), 120000)) + | None => timeOut := Some(setTimeout(() => sendLogs(), 20000)) } beaconApiCall(mainLogFile) let len = mainLogFile->Array.length @@ -521,6 +521,8 @@ let make = ( REDIRECTING_USER, DISPLAY_BANK_TRANSFER_INFO_PAGE, DISPLAY_QR_CODE_INFO_PAGE, + DISPLAY_VOUCHER, + LOADER_CHANGED, SESSIONS_CALL, RETRIEVE_CALL, ] From 2ee01c29b6ac067acd29be74fe9887a3f49a5f34 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 4 Apr 2024 10:34:10 +0000 Subject: [PATCH 12/14] chore(release): 0.37.0 [skip ci] # [0.37.0](https://github.com/juspay/hyperswitch-web/compare/v0.36.2...v0.37.0) (2024-04-04) ### Bug Fixes * app rendered event latency calculation ([#273](https://github.com/juspay/hyperswitch-web/issues/273)) ([e3509f0](https://github.com/juspay/hyperswitch-web/commit/e3509f0b67b752c9a6a656e47372ad5e84026cf3)) ### Features * logging payment data filled ([#269](https://github.com/juspay/hyperswitch-web/issues/269)) ([e9d76ae](https://github.com/juspay/hyperswitch-web/commit/e9d76ae225f39ba963967161413c2a0422d4a4aa)) --- CHANGELOG.md | 12 ++++ package-lock.json | 179 +++++++++++++++++++++++++++++++--------------- package.json | 2 +- 3 files changed, 134 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3886e958..ac93bfec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# [0.37.0](https://github.com/juspay/hyperswitch-web/compare/v0.36.2...v0.37.0) (2024-04-04) + + +### Bug Fixes + +* app rendered event latency calculation ([#273](https://github.com/juspay/hyperswitch-web/issues/273)) ([e3509f0](https://github.com/juspay/hyperswitch-web/commit/e3509f0b67b752c9a6a656e47372ad5e84026cf3)) + + +### Features + +* logging payment data filled ([#269](https://github.com/juspay/hyperswitch-web/issues/269)) ([e9d76ae](https://github.com/juspay/hyperswitch-web/commit/e9d76ae225f39ba963967161413c2a0422d4a4aa)) + ## [0.36.2](https://github.com/juspay/hyperswitch-web/compare/v0.36.1...v0.36.2) (2024-04-04) diff --git a/package-lock.json b/package-lock.json index e372d4303..704b143e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.36.2", + "version": "0.37.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2870,6 +2870,21 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2887,6 +2902,40 @@ "strip-ansi": "^7.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2896,6 +2945,23 @@ "ansi-regex": "^6.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } + } + }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2906,6 +2972,60 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } } } }, @@ -20852,17 +20972,6 @@ "strip-ansi": "^6.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -20954,15 +21063,6 @@ "ansi-regex": "^5.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -23530,43 +23630,6 @@ } } }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 86f681418..5a0ae420a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.36.2", + "version": "0.37.0", "main": "index.js", "private": true, "dependencies": { From 3070e8f54d2d7850ee4b20e5ba62a77624896f33 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 4 Apr 2024 16:09:25 +0530 Subject: [PATCH 13/14] feat: locale-string added for rest locales (#247) Co-authored-by: Praful Koppalkar <126236898+prafulkoppalkar@users.noreply.github.com> --- src/Components/NicknamePaymentInput.res | 2 +- src/LocaleString.res | 788 +++++++++++++++++++++++- 2 files changed, 774 insertions(+), 16 deletions(-) diff --git a/src/Components/NicknamePaymentInput.res b/src/Components/NicknamePaymentInput.res index c2b6abda0..e0df0bdd7 100644 --- a/src/Components/NicknamePaymentInput.res +++ b/src/Components/NicknamePaymentInput.res @@ -8,7 +8,7 @@ let make = (~paymentType: CardThemeType.mode, ~value, ~setValue) => { } + achBankDebitTerms: _ => `Your ACH Debit Authorization will be set up now, but we'll confirm the amount and let you know before future payments are taken.`, - sepaDebitTerms: _str => + sepaDebitTerms: _ => `Your SEPA Debit Authorization will be set up now, but we'll confirm the amount and let you know before future payments are taken.`, becsDebitTerms: `Your BECS Debit Authorization will be set up now, but we'll confirm the amount and let you know before future payments are taken.`, cardTerms: str => @@ -149,12 +149,14 @@ let defaultLocale = { saveWalletDetails: "Wallets details will be saved upon selection", morePaymentMethods: "More payment methods", useExistingPaymentMethods: "Use saved payment methods", - nicknameLabel: "Card Nickname", + cardNickname: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", } type locale = {localeStrings: array} + let localeStrings = [ + // ? - English (en) { locale: "en", localeDirection: "ltr", @@ -234,9 +236,10 @@ let localeStrings = [ saveWalletDetails: "Wallets details will be saved upon selection", morePaymentMethods: "More payment methods", useExistingPaymentMethods: "Use saved payment methods", - nicknameLabel: "Card Nickname", + cardNickname: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", }, + // ? - Hebrew (he) { locale: "he", localeDirection: "rtl", @@ -316,9 +319,10 @@ let localeStrings = [ saveWalletDetails: "פרטי הארנק יישמרו בעת בחירה", morePaymentMethods: `אמצעי תשלום נוספים`, useExistingPaymentMethods: `השתמש באמצעי תשלום שמורים`, - nicknameLabel: `כינוי לכרטיס`, + cardNickname: `כינוי לכרטיס`, nicknamePlaceholder: `כינוי לכרטיס (אופציונלי)`, }, + // ? - French (fr) { locale: `fr`, localeDirection: `ltr`, @@ -398,9 +402,10 @@ let localeStrings = [ saveWalletDetails: "Les détails du portefeuille seront enregistrés lors de la sélection", morePaymentMethods: `Plus de méthodes de paiement`, useExistingPaymentMethods: `Utiliser les modes de paiement enregistrés`, - nicknameLabel: `Pseudonyme de la carte`, + cardNickname: `Pseudonyme de la carte`, nicknamePlaceholder: `Surnom de la carte (facultatif)`, }, + // ? - English (en-GB) { locale: "en-GB", localeDirection: "ltr", @@ -480,9 +485,10 @@ let localeStrings = [ saveWalletDetails: "Wallets details will be saved upon selection", morePaymentMethods: "More payment methods", useExistingPaymentMethods: "Use saved payment methods", - nicknameLabel: "Card Nickname", + cardNickname: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", }, + // ? - Arabic (ar) { locale: "ar", localeDirection: "rtl", @@ -562,9 +568,10 @@ let localeStrings = [ saveWalletDetails: "سيتم حفظ تفاصيل المحفظة عند الاختيار", morePaymentMethods: `المزيد من طرق الدفع`, useExistingPaymentMethods: `استخدم طرق الدفع المحفوظة`, - nicknameLabel: `الاسم علي الكارت`, + cardNickname: `الاسم علي الكارت`, nicknamePlaceholder: `اسم البطاقة (اختياري)`, }, + // ? - Japanese (ja) { locale: "ja", localeDirection: "ltr", @@ -644,12 +651,13 @@ let localeStrings = [ saveWalletDetails: "選択時にウォレットの詳細が保存されます", morePaymentMethods: `その他の支払い方法`, useExistingPaymentMethods: `保存した支払い方法を使用する`, - nicknameLabel: `カードのニックネーム`, + cardNickname: `カードのニックネーム`, nicknamePlaceholder: `カードニックネーム(任意)`, }, + // ? - German (de) { - locale: "de", - localeDirection: "ltr", + locale: `de`, + localeDirection: `ltr`, cardNumberLabel: `Kartennummer`, inValidCardErrorText: `Kartennummer ist ungültig.`, inCompleteCVCErrorText: `Der Sicherheitscode Ihrer Karte ist unvollständig.`, @@ -661,7 +669,7 @@ let localeStrings = [ cvcTextLabel: `CVC`, line1Label: `Adresszeile 1`, line1Placeholder: `Adresse`, - line1EmptyText: "Adresszeile 1 darf nicht leer sein", + line1EmptyText: `Adresszeile 1 darf nicht leer sein`, line2Label: `Adresszeile 2`, line2Placeholder: `Wohnung, Einheitennummer usw. (optional)`, line2EmptyText: `Adresszeile 2 darf nicht leer sein`, @@ -679,7 +687,7 @@ let localeStrings = [ fullNameLabel: `Vollständiger Name`, fullNamePlaceholder: `Vor-und Nachname`, countryLabel: `Land`, - currencyLabel: "Währung", + currencyLabel: `Währung`, bankLabel: `Wählen Sie Bank`, redirectText: `Nach dem Absenden Ihrer Bestellung werden Sie weitergeleitet, um Ihren Kauf sicher abzuschließen.`, bankDetailsText: `Nach Übermittlung dieser Daten erhalten Sie die Bankverbindung, um die Zahlung durchführen zu können. Bitte notieren Sie sich dies unbedingt.`, @@ -726,7 +734,757 @@ let localeStrings = [ saveWalletDetails: "Wallet-Details werden beim Auswählen gespeichert", morePaymentMethods: `Mehr Zahlungsmethoden`, useExistingPaymentMethods: `Gespeicherte Zahlungsarten nutzen`, - nicknameLabel: `Spitzname der Karte`, + cardNickname: `Spitzname der Karte`, nicknamePlaceholder: `Kartenname (optional)`, }, + // ? - French (Belgium) (fr-BE) + { + locale: `fr-BE`, + localeDirection: `ltr`, + cardNumberLabel: `Numéro de carte`, + inValidCardErrorText: `Le numéro de carte n'est pas valide.`, + inCompleteCVCErrorText: `Le code de sécurité de votre carte est incomplet.`, + inCompleteExpiryErrorText: `La date d'expiration de votre carte est incomplète.`, + pastExpiryErrorText: `L'année d'expiration de votre carte est passée.`, + poweredBy: `Alimenté par Hyperswitch`, + validThruText: `Expiration`, + sortCodeText: `Code guichet`, + cvcTextLabel: `CVC`, + line1Label: `Adresse ligne 1`, + line1Placeholder: `Rue`, + line2Label: `Adresse ligne 2`, + line2Placeholder: `Appartement, numéro d'unité, etc. (facultatif)`, + cityLabel: `Ville`, + postalCodeLabel: `Code postal`, + stateLabel: `État`, + accountNumberText: `Numéro dAccount Number`, + emailLabel: `E-mail`, + fullNameLabel: `Nom cFull name`, + fullNamePlaceholder: `Nom et prénom`, + countryLabel: `Pays`, + currencyLabel: `Devise`, + bankLabel: `Sélectionner une banque`, + redirectText: `Après avoir passé votre commande, vous serez redirigé pour effectuer votre achat en toute sécurité.`, + bankDetailsText: `Après avoir envoyé ces informations, vous obtiendrez les informations de votre compte bancaire pour effectuer le paiement. Veillez à en prendre note.`, + orPayUsing: `Ou payer en utilisant`, + addNewCard: `Ajouter une carte de crédit/débit`, + useExisitingSavedCards: `Utiliser les cartes de débit/crédit enregistrées`, + saveCardDetails: `Enregistrer les détails de la carte`, + addBankAccount: `Ajouter un compte bancaire`, + achBankDebitTerms: str => + `En fournissant votre numéro de compte et en confirmant ce paiement, vous autorisez ${str} et Hyperswitch, notre prestataire de services de paiement, à envoyer des instructions à votre banque pour débiter votre compte et votre banque à débiter votre compte conformément à ces instructions. Vous avez droit à un remboursement de la part de votre banque selon les termes et conditions de l'accord que vous avez conclu avec elle. Le remboursement doit être demandé dans un délai de 8 semaines à compter de la date à laquelle votre compte a été débité.`, + sepaDebitTerms: str => + `En fournissant vos informations de paiement et en confirmant ce paiement, vous autorisez (A) ${str} et Hyperswitch, notre prestataire de services de paiement et/ou PPRO, son prestataire de services local, à envoyer des instructions à votre banque pour débiter votre compte et (B) votre banque à débiter votre compte conformément à ces instructions. Dans le cadre de vos droits, vous avez droit à un remboursement de votre banque selon les termes et conditions de votre accord avec votre banque. Le remboursement doit être demandé dans un délai de 8 semaines à compter de la date à laquelle votre compte a été débité. Vos droits sont expliqués dans une déclaration que vous pouvez obtenir auprès de votre banque. Vous acceptez de recevoir des notifications pour les débits futurs jusqu'à 2 jours avant qu'ils ne se produisent.`, + becsDebitTerms: `En fournissant vos coordonnées bancaires et en confirmant ce paiement, vous acceptez la présente demande de prélèvement automatique et l'accord de service de demande de prélèvement automatique et autorisez Hyperswitch Payments Australia Pty Ltd ACN 160 180 343 Numéro d'identification d'utilisateur de prélèvement automatique 507156 (« Hyperswitch ») à débiter votre compte via le système de compensation électronique en bloc (BECS) au nom de Hyperswitch Payment Widget (le « Marchand ») pour tout montant qui vous est communiqué séparément par le Marchand. Vous certifiez que vous êtes soit le titulaire du compte, soit un signataire autorisé du compte mentionné ci-dessus.`, + cardTerms: str => + `En fournissant les informations relatives à votre carte, vous autorisez ${str} à débiter votre carte pour les paiements futurs conformément à leurs conditions.`, + payNowButton: `Payer maintenant`, + cardNumberEmptyText: `Le numéro de carte ne peut pas être vide`, + cardExpiryDateEmptyText: `La date d'expiration de la carte ne peut pas être vide`, + cvcNumberEmptyText: `Le numéro CVC ne peut pas être vide`, + enterFieldsText: `Veuillez saisir tous les champs`, + enterValidDetailsText: `Veuillez saisir des détails valides`, + card: `Carte`, + billingNameLabel: `Nom de facturation`, + cardHolderName: `Nom du titulaire`, + cardNickname: `Pseudonyme de la carte`, + billingNamePlaceholder: `Nom et prénom`, + emailEmptyText: `L'e-mail ne peut pas être vide`, + emailInvalidText: `Adresse e-mail invalide`, + line1EmptyText: `La ligne d'adresse 1 ne peut pas être vide`, + line2EmptyText: `La ligne d'adresse 2 ne peut pas être vide`, + cityEmptyText: `La ville ne peut pas être vide`, + postalCodeEmptyText: `Le code postal ne peut pas être vide`, + postalCodeInvalidText: `Code postal invalide`, + stateEmptyText: `L'état ne peut pas être vide`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Un montant supplémentaire de${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}sera appliqué pour cette transaction`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Un montant supplémentaire pouvant aller jusqu'à${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}sera appliqué pour cette transaction`)} + , + surchargeMsgAmountForOneClickWallets: `Frais supplémentaires applicables`, + on: `sur`, + \"and": `et`, + nameEmptyText: str => `Veuillez fournir votre ${str}`, + completeNameEmptyText: str => `Veuillez fournir votre complet ${str}`, + billingDetailsText: `Détails de la facturation`, + socialSecurityNumberLabel: `Numéro de sécurité sociale`, + saveWalletDetails: `Les détails des portefeuilles seront enregistrés lors de la sélection`, + morePaymentMethods: `Plus de méthodes de paiement`, + useExistingPaymentMethods: `Utiliser les modes de paiement enregistrés`, + nicknamePlaceholder: `Surnom de la carte (facultatif)`, + selectPaymentMethodText: `Veuillez sélectionner un mode de paiement et réessayer`, + }, + // ? - Spanish (es) + { + locale: `es`, + localeDirection: `ltr`, + cardNumberLabel: `Número de tarjeta`, + inValidCardErrorText: `El número de la tarjeta no es válido.`, + inCompleteCVCErrorText: `El código de seguridad de su tarjeta está incompleto.`, + inCompleteExpiryErrorText: `La fecha de vencimiento de su tarjeta está incompleta.`, + pastExpiryErrorText: `El año de vencimiento de su tarjeta ya ha pasado.`, + poweredBy: `Desarrollado por Hyperswitch`, + validThruText: `Vencimiento`, + sortCodeText: `Código Sort`, + cvcTextLabel: `CVV`, + line1Label: `Línea de dirección 1`, + line1Placeholder: `Dirección postal`, + line2Label: `Línea de dirección 2`, + line2Placeholder: `Piso, número de departamento, etc. (opcional)`, + cityLabel: `Ciudad`, + postalCodeLabel: `Código postal`, + stateLabel: `Provincia/estado`, + accountNumberText: `Número de cuenta`, + emailLabel: `Correo electrónico`, + fullNameLabel: `Nombre completo`, + fullNamePlaceholder: `Nombre y apellidos`, + countryLabel: `País`, + currencyLabel: `Moneda`, + bankLabel: `Seleccionar banco`, + redirectText: `Después de enviar su pedido, se le redirigirá para que complete su compra de forma segura.`, + bankDetailsText: `Después de enviar estos datos, obtendrá la información de la cuenta bancaria para realizar el pago. Asegúrese de anotarla.`, + orPayUsing: `O pague con`, + addNewCard: `Añadir tarjeta de crédito/débito`, + useExisitingSavedCards: `Utilizar las tarjetas de débito/crédito guardadas`, + saveCardDetails: `Guardar la información de la tarjeta`, + addBankAccount: `Añadir cuenta bancaria`, + achBankDebitTerms: str => + `Al proporcionar su número de cuenta y confirmar este pago, autoriza a ${str} y Hyperswitch, nuestro proveedor de servicios de pago, a enviar órdenes a su banco para que aplique cargos en su cuenta y para que realice los correspondientes adeudos en la misma de acuerdo con dichas órdenes. Tiene derecho a recibir un reembolso de su banco de acuerdo con las condiciones del contrato suscrito. El reembolso debe reclamarse en un plazo de 8 semanas desde la fecha en la que se aplicó el cargo en su cuenta.`, + sepaDebitTerms: str => + `Al proporcionar su información de pago y confirmar este pago, autoriza a (A) ${str} y Hyperswitch, nuestro proveedor de servicios de pago o a PPRO, su proveedor de servicios local, a enviar órdenes a su banco para que aplique cargos en su cuenta y (B) para que realice los correspondientes adeudos en la misma de acuerdo con dichas órdenes. Como parte de sus derechos, tiene la potestad de que su banco le devuelva el dinero según las condiciones de su contrato. El reembolso debe reclamarse en un plazo de 8 semanas desde la fecha en la que se aplicó el cargo en su cuenta. Sus derechos aparecen explicados en una declaración que puede solicitar en su banco. Acepta recibir notificaciones de futuros cargos hasta 2 días antes de que se produzcan.`, + becsDebitTerms: `Al proporcionar los datos de su cuenta bancaria y confirmar este pago, acepta esta solicitud de domiciliación bancaria y el acuerdo de servicio para la misma. Además, autoriza a Hyperswitch Payments Australia Pty Ltd ACN 160 180 343, número de identificación de usuario de domiciliación bancaria 507156 («Hyperswitch»), a realizar adeudos en su cuenta a través del sistema de compensación electrónica masiva (BECS) en nombre de Hyperswitch Payment Widget (el «comercio») por cualquier importe que el comercio le comunique individualmente. Certifica que es titular de una cuenta o un firmante autorizado en la cuenta indicada anteriormente.`, + cardTerms: str => + `Al proporcionar la información de su tarjeta, permite a ${str} que realice cargos en su tarjeta para futuros pagos de acuerdo con sus términos.`, + payNowButton: `Pagar ahora`, + cardNumberEmptyText: `El número de la tarjeta no puede estar vacío`, + cardExpiryDateEmptyText: `La fecha de vencimiento de la tarjeta no puede estar vacía`, + cvcNumberEmptyText: `El número CVV no puede estar vacío`, + enterFieldsText: `Rellene todos los campos`, + enterValidDetailsText: `Introduzca datos válidos`, + card: `Tarjeta`, + billingNameLabel: `Nombre de facturación`, + cardHolderName: `Nombre del titular de la tarjeta`, + cardNickname: `Apodo de la tarjeta`, + billingNamePlaceholder: `Nombre y apellido`, + emailEmptyText: `El correo electrónico no puede estar vacío.`, + emailInvalidText: `Dirección de correo electrónico no válida`, + line1EmptyText: `La línea de dirección 1 no puede estar vacía`, + line2EmptyText: `La línea de dirección 2 no puede estar vacía`, + cityEmptyText: `La ciudad no puede estar vacía.`, + postalCodeEmptyText: `El código postal no puede estar vacío.`, + postalCodeInvalidText: `código postal no válido`, + stateEmptyText: `El estado no puede estar vacío.`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`un monto de recargo de${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}se aplicará para esta transacción`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Un monto de recargo de hasta${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}se aplicará para esta transacción`)} + , + surchargeMsgAmountForOneClickWallets: `Tarifa adicional aplicable`, + on: `en`, + \"and": `y`, + nameEmptyText: str => `Por favor proporcione su ${str}`, + completeNameEmptyText: str => `Por favor proporcione su completo ${str}`, + billingDetailsText: `Detalles de facturación`, + socialSecurityNumberLabel: `Número de seguro social`, + saveWalletDetails: `Los detalles de las billeteras se guardarán al realizar la selección.`, + morePaymentMethods: `Más métodos de pago`, + useExistingPaymentMethods: `Utilice métodos de pago guardados`, + nicknamePlaceholder: `Apodo de la tarjeta (opcional)`, + selectPaymentMethodText: `Por favor seleccione un método de pago y vuelva a intentarlo`, + }, + // ? - Catalan (ca) + { + locale: `ca`, + localeDirection: `ltr`, + cardNumberLabel: `Número de targeta`, + inValidCardErrorText: `El número de targeta no és vàlid.`, + inCompleteCVCErrorText: `El codi de seguretat de la targeta està incomplet.`, + inCompleteExpiryErrorText: `La data de venciment de la targeta està incompleta.`, + pastExpiryErrorText: `La data de venciment de la targeta ja ha passat.`, + poweredBy: `Amb tecnologia de Hyperswitch`, + validThruText: `Venciment`, + sortCodeText: `Codi de sucursal`, + cvcTextLabel: `CVC`, + line1Label: `Línia d'adreça 1`, + line1Placeholder: `Adreça postal`, + line2Label: `Línia d'adreça 2`, + line2Placeholder: `Pis, número d'apartament, etc. (opcional)`, + cityLabel: `Ciutat`, + postalCodeLabel: `Codi postal`, + stateLabel: `Estat`, + accountNumberText: `Número de compte`, + emailLabel: `Adreça electrònica`, + fullNameLabel: `Nom complet`, + fullNamePlaceholder: `Nom i cognoms`, + countryLabel: `País`, + currencyLabel: `Moneda`, + bankLabel: `Seleccioni un banc`, + redirectText: `En fer la comanda, se li redirigirà perquè completi la compra de manera segura.`, + bankDetailsText: `Després d'enviar aquestes dades, rebrà la informació del compte bancari per fer el pagament. Recordi prendre'n nota.`, + orPayUsing: `O faci el pagament mitjançant`, + addNewCard: `Afegeixi una targeta de crèdit o dèbit`, + useExisitingSavedCards: `Faci servir les targetes de dèbit o crèdit desades`, + saveCardDetails: `Desi les dades de la targeta`, + addBankAccount: `Afegeixi un compte bancari`, + achBankDebitTerms: str => + `En facilitar el número de compte i confirmar el pagament, autoritza ${str} i Hyperswitch, el nostre proveïdor de serveis de pagament, a enviar ordres al seu banc perquè apliqui els càrrecs corresponents al compte. Tindrà dret a rebre un reembossament del banc d'acord amb els termes i condicions del contracte que hi hagi subscrit. El reembossament s'ha de sol·licitar en un termini de 8 setmanes des de la data en què es va aplicar el càrrec al compte.`, + sepaDebitTerms: str => + `En facilitar la informació de pagament i confirmar el pagament, autoritza ${str} i Hyperswitch, el nostre proveïdor de serveis de pagament, o a PPRO, el seu proveïdor de serveis local, a enviar ordres al seu banc i a (B) perquè apliqui els càrrecs corresponents al compte. Com a part dels seus drets, podrà rebre un reembossament del banc d'acord amb els termes i condicions del contracte que hi hagi subscrit. El reembossament s'ha de sol·licitar en un termini de 8 setmanes des de la data en què es va aplicar el càrrec al compte. Els seus drets s'expliquen en un extracte que podrà sol·licitar al banc. Accepta rebre notificacions dels càrrecs futurs fins 2 dies abans que es produeixin.`, + becsDebitTerms: `En facilitar les dades del compte bancari i confirmar el pagament, accepta aquesta sol·licitud de domiciliació bancària i l'acord de servei corresponent. A més, autoritza Hyperswitch Payments Australia Pty Ltd ACN 160 180 343, amb número d'identificació d'usuari de domiciliació bancària 507156, («Hyperswitch») a aplicar càrrecs al compte a través del sistema de compensació electrònica massiva (BECS) en nom de Hyperswitch Payment Widget (el «comerç») per a qualsevol import que el comerç li comuniqui individualment. Certifica que és titular d'un compte o signatari autoritzat del compte que s'indica anteriorment.`, + cardTerms: str => + `En facilitar la informació de la targeta, permet a ${str} que faci càrrecs a la targeta per a pagaments futurs d'acord amb les seves condicions.`, + payNowButton: `Pagui ara`, + cardNumberEmptyText: `Cal indicar el número de la targeta`, + cardExpiryDateEmptyText: `Cal indicar la data de venciment de la targeta`, + cvcNumberEmptyText: `Cal indicar el número CVC`, + enterFieldsText: `Empleni tots els camps`, + enterValidDetailsText: `Introdueixi dades vàlides`, + card: `Targeta`, + billingNameLabel: `Nom de facturació`, + cardHolderName: `Nom del titular de la targeta`, + cardNickname: `Sobrenom de la targeta`, + billingNamePlaceholder: `Nom i cognom`, + emailEmptyText: `El correu electrònic no pot estar buit`, + emailInvalidText: `adressa de correu invàlida`, + line1EmptyText: `La línia d'adreça 1 no pot estar buida`, + line2EmptyText: `La línia d'adreça 2 no pot estar buida`, + cityEmptyText: `La ciutat no pot estar buida`, + postalCodeEmptyText: `El codi postal no pot estar buit`, + postalCodeInvalidText: `Codi postal no vàlid`, + stateEmptyText: `L'estat no pot estar buit`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Un import de recàrrec de${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}s'aplicarà per a aquesta transacció`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Un recàrrec de fins a${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}s'aplicarà per a aquesta transacció`)} + , + surchargeMsgAmountForOneClickWallets: `Taxa addicional aplicable`, + on: `activat`, + \"and": `i`, + nameEmptyText: str => `Si us plau, proporcioneu el vostre${str}`, + completeNameEmptyText: str => `Si us plau, proporcioneu el vostre complet ${str}`, + billingDetailsText: `Detalls de facturació`, + socialSecurityNumberLabel: `Número de la Seguretat Social`, + saveWalletDetails: `Els detalls de les carteres es desaran en seleccionar-los`, + morePaymentMethods: `més mètodes de pagament`, + useExistingPaymentMethods: `Utilitzeu formes de pagament desades`, + nicknamePlaceholder: `Àlies de la targeta (opcional)`, + selectPaymentMethodText: `Seleccioneu una forma de pagament i torneu-ho a provar`, + }, + // ? - Portuguese (pt) + { + locale: `pt`, + localeDirection: `ltr`, + cardNumberLabel: `Número do cartão`, + inValidCardErrorText: `O número do cartão é inválido.`, + inCompleteCVCErrorText: `O código de segurança do seu cartão está incompleto.`, + inCompleteExpiryErrorText: `A data de validade do seu cartão está incompleta.`, + pastExpiryErrorText: `O ano de validade do seu cartão já passou.`, + poweredBy: `Desenvolvido por Hyperswitch`, + validThruText: `Validade`, + sortCodeText: `Código de agência bancária`, + cvcTextLabel: `CVC`, + line1Label: `Linha de endereço 1`, + line1Placeholder: `Nome de rua`, + line2Label: `Linha de endereço 2`, + line2Placeholder: `Apartamento, número de porta, etc. (opcional)`, + cityLabel: `Localidade`, + postalCodeLabel: `Código postal`, + stateLabel: `Distrito`, + accountNumberText: `Número de conta`, + emailLabel: `E-mail`, + fullNameLabel: `Nome completo`, + fullNamePlaceholder: `Nome e apelido`, + countryLabel: `País`, + currencyLabel: `Moeda`, + bankLabel: `Selecionar banco`, + redirectText: `Depois de fazer a sua encomenda, será redirecionado(a) para concluir a sua compra com segurança.`, + bankDetailsText: `Depois de enviar estes detalhes, receberá as informações da conta bancária para efetuar o pagamento. Assegure-se de que toma nota desses dados.`, + orPayUsing: `Ou pague utilizando`, + addNewCard: `Adicionar cartão de débito/crédito`, + useExisitingSavedCards: `Usar cartões de débito/crédito guardados`, + saveCardDetails: `Guardar dados do cartão`, + addBankAccount: `Adicionar conta bancária`, + achBankDebitTerms: str => + `Ao fornecer o seu número de conta e confirmar este pagamento, está a autorizar ${str} e a Hyperswitch, nossa prestadora de serviços de pagamento, a enviar instruções ao seu banco para debitar a sua conta e ao seu banco para debitar a sua conta de acordo com essas instruções. Tem direito a um reembolso do seu banco de acordo com os termos e condições do seu contrato com o seu banco. Um reembolso tem de ser solicitado dentro de 8 semanas a partir da data em que a sua conta tiver sido debitada.`, + sepaDebitTerms: str => + `Ao fornecer as suas informações de pagamento e confirmar este pagamento, autoriza (A) ${str} e a Hyperswitch, a nossa prestadora de serviços de pagamento e/ou a PPRO, fornecedora de serviços local desta, para enviar instruções ao seu banco para debitar a sua conta e (B) ao seu banco para debitar a sua conta de acordo com essas instruções. Como parte dos seus direitos, tem direito a um reembolso do seu banco nos termos e condições do seu contrato com o seu banco. Um reembolso tem de ser solicitado dentro de 8 semanas a partir da data em que a sua conta tiver sido debitada. Os seus direitos são explicados numa declaração que pode obter junto do seu banco. Concorda em receber notificações para débitos futuros até 2 dias antes de ocorrerem.`, + becsDebitTerms: `Ao fornecer os seus dados bancários e confirmar este pagamento, concorda com este Pedido de Débito Automático e com o contrato de serviço de Pedido de Débito Automático e autoriza a Hyperswitch Payments Australia Pty Ltd ACN 160 180 343, Número de ID de Utilizador de Débito Automático 507156 ("Hyperswitch"), a debitar a sua conta através do Sistema de Compensação Eletrónica em Massa (BECS) em nome de Hyperswitch Payment Widget (o "Comerciante") por quaisquer valores separadamente comunicados a si pelo Comerciante. Certifica que é titular da conta ou signatário autorizado na conta listada acima.`, + cardTerms: str => + `Ao fornecer as informações do seu cartão, permite ${str} o débito do seu cartão para pagamentos futuros de acordo com as respetivas condições.`, + payNowButton: `Pagar agora`, + cardNumberEmptyText: `O número do cartão não pode ficar em branco`, + cardExpiryDateEmptyText: `A data de validade do cartão não pode ficar em branco`, + cvcNumberEmptyText: `O número CVC não pode ficar em branco`, + enterFieldsText: `Preencha todos os campos`, + enterValidDetailsText: `Introduza dados válidos`, + card: `Cartão`, + billingNameLabel: `Nome de faturação`, + cardHolderName: `Nome do titular do cartão`, + cardNickname: `Apelido do cartão`, + billingNamePlaceholder: `Nome e sobrenome`, + emailEmptyText: `O e-mail não pode ficar vazio`, + emailInvalidText: `Endereço de email invalido`, + line1EmptyText: `A linha de endereço 1 não pode ficar vazia`, + line2EmptyText: `A linha de endereço 2 não pode ficar vazia`, + cityEmptyText: `A cidade não pode ficar vazia`, + postalCodeEmptyText: `O código postal não pode ficar vazio`, + postalCodeInvalidText: `Código postal inválido`, + stateEmptyText: `O estado não pode ficar vazio`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Um valor adicional de${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}será aplicado para esta transação`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Um valor adicional de até${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}será aplicado para esta transação`)} + , + surchargeMsgAmountForOneClickWallets: `Taxa adicional aplicável`, + on: `sobre`, + \"and": `e`, + nameEmptyText: str => `Por favor, forneça seu ${str}`, + completeNameEmptyText: str => `Por favor, forneça seu completo ${str}`, + billingDetailsText: `Detalhes de cobrança`, + socialSecurityNumberLabel: `Número da Segurança Social`, + saveWalletDetails: `Os detalhes das carteiras serão salvos após a seleção`, + morePaymentMethods: `Mais métodos de pagamento`, + useExistingPaymentMethods: `Use métodos de pagamento salvos`, + nicknamePlaceholder: `Apelido do cartão (opcional)`, + selectPaymentMethodText: `Selecione uma forma de pagamento e tente novamente`, + }, + // ? - Italian (it) + { + locale: `it`, + localeDirection: `lrt`, + cardNumberLabel: `Numero della carta`, + inValidCardErrorText: `Il numero della carta non è valido.`, + inCompleteCVCErrorText: `Il codice di sicurezza della carta è incompleto.`, + inCompleteExpiryErrorText: `La data di scadenza della carta è incompleta.`, + pastExpiryErrorText: `L'anno di scadenza della tua carta è passato.`, + poweredBy: `Offerto da Hyperswitch`, + validThruText: `Scadenza`, + sortCodeText: `Sort Code`, + cvcTextLabel: `CVC`, + line1Label: `Indirizzo (riga 1)`, + line1Placeholder: `Indirizzo`, + line2Label: `Indirizzo (riga 2)`, + line2Placeholder: `Appartamento, interno, ecc. (facoltativo)`, + cityLabel: `Città`, + postalCodeLabel: `Codice di avviamento postale`, + stateLabel: `Stato`, + accountNumberText: `Numero del conto`, + emailLabel: `E-mail`, + fullNameLabel: `Nome e cognome`, + fullNamePlaceholder: `Nome e cognome`, + countryLabel: `Paese`, + currencyLabel: `Valuta`, + bankLabel: `Seleziona una banca`, + redirectText: `Dopo aver inviato l'ordine, ti reindirizzeremo per completare l'acquisto in totale sicurezza.`, + bankDetailsText: `Dopo aver inviato questi dettagli, riceverai le informazioni sul conto bancario per effettuare il pagamento. Assicurati di annotarli.`, + orPayUsing: `Oppure paga utilizzando`, + addNewCard: `Aggiungi una carta di credito/debito`, + useExisitingSavedCards: `Utilizza carte di debito/credito salvate`, + saveCardDetails: `Salva i dati della carta`, + addBankAccount: `Aggiungi un conto bancario`, + achBankDebitTerms: str => + `Fornendo il tuo numero di conto e confermando questo pagamento, autorizzi ${str} e Hyperswitch, il nostro fornitore di servizi di pagamento, a inviare istruzioni alla tua banca per effettuare l'addebito sul tuo conto e la tua banca a effettuare tale addebito sul conto in conformità alle presenti istruzioni. Hai diritto a un rimborso dalla tua banca secondo i termini e le condizioni del tuo contratto con la stessa. Il rimborso va richiesto entro 8 settimane a partire dalla data di addebito sul conto.`, + sepaDebitTerms: str => + `Fornendo le tue informazioni di pagamento e confermando questo pagamento, autorizzi (A) ${str} e Hyperswitch, il nostro fornitore di servizi di pagamento e/o PPRO, il suo fornitore locale di servizi, a inviare istruzioni alla tua banca per effettuare l'addebito sul tuo conto e (B) la tua banca a effettuare tale addebito sul conto in conformità alle presenti istruzioni. Come parte dei tuoi diritti, puoi richiedere un rimborso alla tua banca in conformità con i termini e le condizioni del tuo contratto con tale istituto. Devi richiedere il rimborso entro 8 settimane a partire dalla data di addebito sul conto. Puoi conoscere i tuoi diritti in merito richiedendo la relativa informativa alla tua banca. Accetti di ricevere avvisi relativi ai prossimi addebiti fino a 2 giorni prima della loro data effettiva.`, + becsDebitTerms: `Fornendo i dettagli del tuo conto bancario e confermando questo pagamento, accetti la presente Richiesta di addebito diretto e il contratto di servizio per la Richiesta di addebito diretto e autorizzi Hyperswitch Payments Australia Pty Ltd ACN 160 180 343, numero identificativo utente per addebito diretto 507156 ( \"Hyperswitch\") a effettuare l'addebito sul tuo conto tramite il Bulk Electronic Clearing System (BECS) per conto di Hyperswitch Payment Widget (l' Esercente) per qualsiasi importo ti venga comunicato separatamente dall'Esercente. Dichiari di essere titolare o firmatario autorizzato del conto sopra indicato.`, + cardTerms: str => + `Fornendo i dati della tua carta, autorizzi ${str} ad addebitare sulla tua carta pagamenti futuri in conformità con i suoi termini.`, + payNowButton: `Paga ora`, + cardNumberEmptyText: `Il campo Numero della carta non può essere vuoto`, + cardExpiryDateEmptyText: `Il campo Data di scadenza della carta non può essere vuoto`, + cvcNumberEmptyText: `Il campo CVC non può essere vuoto`, + enterFieldsText: `Compila tutti i campi`, + enterValidDetailsText: `Inserisci dati validi`, + card: `Carta`, + billingNameLabel: `Intestatario della fattura`, + cardHolderName: `Nome del titolare della carta`, + cardNickname: `Soprannome della carta`, + billingNamePlaceholder: `Nome e cognome`, + emailEmptyText: `L'e-mail non può essere vuota`, + emailInvalidText: `indirizzo email non valido`, + line1EmptyText: `La riga dell'indirizzo 1 non può essere vuota`, + line2EmptyText: `La riga dell'indirizzo 2 non può essere vuota`, + cityEmptyText: `La città non può essere vuota`, + postalCodeEmptyText: `Il codice postale non può essere vuoto`, + postalCodeInvalidText: `Codice postale non valido`, + stateEmptyText: `Lo stato non può essere vuoto`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Un importo aggiuntivo di${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}verrà applicato per questa transazione`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Un importo di supplemento fino a${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}verrà applicato per questa transazione`)} + , + surchargeMsgAmountForOneClickWallets: `Supplemento applicabile`, + on: `SU`, + \"and": `E`, + nameEmptyText: str => `Per favore fornisci il tuo ${str}`, + completeNameEmptyText: str => `Si prega di fornire il file completo ${str}`, + billingDetailsText: `Dettagli di fatturazione`, + socialSecurityNumberLabel: `Numero di Social Security`, + saveWalletDetails: `I dettagli dei portafogli verranno salvati al momento della selezione`, + morePaymentMethods: `Più metodi di pagamento`, + useExistingPaymentMethods: `Utilizza i metodi di pagamento salvati`, + nicknamePlaceholder: `Soprannome della carta (facoltativo)`, + selectPaymentMethodText: `Seleziona un metodo di pagamento e riprova`, + }, + // ? - Polish (pl) + { + locale: `pl`, + localeDirection: `ltr`, + cardNumberLabel: `Numer karty`, + inValidCardErrorText: `Numer karty jest nieprawidłowy.`, + inCompleteCVCErrorText: `Kod zabezpieczający karty jest niekompletny.`, + inCompleteExpiryErrorText: `Data ważności karty jest niepełna.`, + pastExpiryErrorText: `Rok w dacie ważności karty minął.`, + poweredBy: `Na oprogramowaniu Hyperswitch`, + validThruText: `Dada ważności`, + sortCodeText: `Kod sortowania`, + cvcTextLabel: `CVC`, + line1Label: `Adres wiersz 1`, + line1Placeholder: `Adres (ulica, nr budynku)`, + line2Label: `Adres wiersz 2`, + line2Placeholder: `Nr lokalu itp. (opcjonalnie)`, + cityLabel: `Miejscowość`, + postalCodeLabel: `Kod pocztowy`, + stateLabel: `Stan`, + accountNumberText: `Numer rachunku`, + emailLabel: `E-mail`, + fullNameLabel: `Imię i nazwisko`, + fullNamePlaceholder: `Imię i nazwisko`, + countryLabel: `Państwo`, + currencyLabel: `Waluta`, + bankLabel: `Wybierz bank`, + redirectText: `Po złożeniu zamówienia nastąpi przekierowanie na stronę, na której możesz bezpiecznie sfinalizować zakup.`, + bankDetailsText: `Po przesłaniu tych informacji otrzymasz dane konta bankowego do płatności. Pamiętaj, aby je zanotować.`, + orPayUsing: `Lub zapłać za pomocą`, + addNewCard: `Dodaj kartę kredytową lub debetową`, + useExisitingSavedCards: `Użyj zapisanych kart debetowych lub kredytowych`, + saveCardDetails: `Zapisz dane karty`, + addBankAccount: `Dodaj konto bankowe`, + achBankDebitTerms: str => + `Podając numer konta i potwierdzając tę płatność, upoważniasz ${str} i Hyperswitch, naszego dostawcę usług płatniczych, do przekazania Twojemu bankowi dyspozycji obciążenia Twojego konta, a Twój bank – do obciążenia Twojego konta zgodnie z tymi instrukcjami. Przysługuje Ci prawo do zwrotu pieniędzy od banku zgodnie z warunkami umowy zawartej z bankiem. Wniosek o zwrot pieniędzy należy złożyć w ciągu 8 dni od dnia obciążenia konta.`, + sepaDebitTerms: str => + `Podając dane do płatności i potwierdzając tę płatność, upoważniasz (A) ${str} i Hyperswitch, naszego dostawcę usług płatniczych, oraz PPRO, lokalnego dostawcy usług tej firmy do przekazania Twojemu bankowi dyspozycji obciążenia Twojego konta, a także (B) Twój bank – do obciążenia Twojego konta zgodnie z tymi instrukcjami. Twoje prawa obejmują prawo do zwrotu pieniędzy przez Twój bank zgodnie z warunkami umowy zawartej z bankiem. Wniosek o zwrot pieniędzy należy złożyć w ciągu 8 dni od dnia obciążenia konta. Twoje prawa są wyjaśnione w wyciągu, który możesz otrzymać od swojego banku. Wyrażasz zgodę na otrzymywanie powiadomień o przyszłych obciążeniach do 2 dni przed ich realizacją.`, + becsDebitTerms: `Podając dane konta bankowego i potwierdzając tę płatność, zgadzasz się na niniejsze polecenie zapłaty i umowę o świadczenie usług polecenia zapłaty oraz upoważniasz Hyperswitch Payments Australia Pty Ltd ACN 160 180 343 numer identyfikacyjny użytkownika polecenia zapłaty 507156 („Hyperswitch”) do obciążenia Twojego konta za pośrednictwem Zbiorczego Elektronicznego Systemu Rozliczeniowego (BECS) w imieniu Hyperswitch Payment Widget („Sprzedawca”) wszelkimi kwotami, o których Sprzedawca poinformował Cię osobno. Oświadczasz, że jesteś posiadaczem konta lub osobą upoważnioną do składania podpisów dla konta wymienionego powyżej.`, + cardTerms: str => + `Podając dane swojej karty, zezwalasz ${str} na obciążenie jej przyszłymi płatnościami zgodnie z jej warunkami.`, + payNowButton: `Zapłać teraz`, + cardNumberEmptyText: `Numer karty nie może być pusty`, + cardExpiryDateEmptyText: `Data ważności karty nie może być pusta`, + cvcNumberEmptyText: `Numer CVC nie może być pusty`, + enterFieldsText: `Uzupełnij wszystkie pola`, + enterValidDetailsText: `Wprowadź prawidłowe dane`, + card: `Karta`, + billingNameLabel: `Nazwisko do faktury`, + cardHolderName: `Imię i nazwisko posiadacza karty`, + cardNickname: `Przezwisko karty`, + billingNamePlaceholder: `Imię i nazwisko`, + emailEmptyText: `Adres e-mail nie może być pusty`, + emailInvalidText: `Niepoprawny adres email`, + line1EmptyText: `Linia adresu 1 nie może być pusta`, + line2EmptyText: `Linia adresu 2 nie może być pusta`, + cityEmptyText: `Miasto nie może być puste`, + postalCodeEmptyText: `Kod pocztowy nie może być pusty`, + postalCodeInvalidText: `Nieprawidłowy kod pocztowy`, + stateEmptyText: `Stan nie może być pusty`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Dopłata w wysokości${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}zostaną zastosowane do tej transakcji`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Dopłata w wysokości do${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}zostaną zastosowane do tej transakcji`)} + , + surchargeMsgAmountForOneClickWallets: `Obowiązuje dodatkowa opłata`, + on: `NA`, + \"and": `I`, + nameEmptyText: str => `Proszę podać swoje ${str}`, + completeNameEmptyText: str => `Proszę podać kompletne ${str}`, + billingDetailsText: `Szczegóły płatności`, + socialSecurityNumberLabel: `Numer ubezpieczenia społecznego`, + saveWalletDetails: `Po dokonaniu wyboru szczegóły portfela zostaną zapisane`, + morePaymentMethods: `Więcej metod płatności`, + useExistingPaymentMethods: `Skorzystaj z zapisanych metod płatności`, + nicknamePlaceholder: `Pseudonim karty (opcjonalnie)`, + selectPaymentMethodText: `Wybierz metodę płatności i spróbuj ponownie`, + }, + // ? - Dutch (nl) + { + locale: `nl`, + localeDirection: `ltr`, + cardNumberLabel: `Kortnummer`, + inValidCardErrorText: `Kortnummeret er ugyldigt.`, + inCompleteCVCErrorText: `Dit korts sikkerhedskode er ufuldstændig.`, + inCompleteExpiryErrorText: `Dit korts udløbsdato er ufuldstændig.`, + pastExpiryErrorText: `Dit korts udløbsår er i fortiden`, + poweredBy: `Drevet af Hyperswitch`, + validThruText: `Udløbsdato`, + sortCodeText: `Registreringsnummer`, + cvcTextLabel: `CVC`, + line1Label: `Adresselinje 1`, + line1Placeholder: `Gadenavn`, + line2Label: "Adresselinje 2", + line2Placeholder: `Lejl., enhedsnummer osv. (valgfrit)`, + cityLabel: `By`, + postalCodeLabel: `Postnummer`, + stateLabel: `Region`, + accountNumberText: `Kontonummer`, + emailLabel: `E-mail`, + fullNameLabel: `Fulde navn`, + fullNamePlaceholder: `For- og efternavn`, + countryLabel: `Land`, + currencyLabel: `Valuta`, + bankLabel: `Vælg bank`, + redirectText: `Når du har indsendt din bestilling, bliver du omdirigeret for at gennemføre dit køb på en sikker måde.`, + bankDetailsText: `Når du har indsendt disse oplysninger, vil du få oplysninger om den bankkonto, du skal betale til. Sørg for at notede dem.`, + orPayUsing: `Eller betal ved hjælp af`, + addNewCard: `Kredit/debetkort`, + useExisitingSavedCards: `Brug gemte debet-/kreditkort`, + saveCardDetails: `Gem kortoplysninger`, + addBankAccount: `Tilføj bankkonto`, + achBankDebitTerms: str => + `Ved at angive dit kontonummer og bekræfte denne betaling giver du ${str} og Hyperswitch, vores betalingstjenesteudbyder, tilladelse til at sende instruktioner til din bank om at debitere din konto og din bank om at debitere din konto i overensstemmelse med disse instruktioner. Du har ret til en refusion fra din bank i henhold til vilkårene og betingelserne i din aftale med din bank. Der skal anmodes om en refusion inden for otte uger fra den dato, hvor din konto blev debiteret.`, + sepaDebitTerms: str => + `Ved at angive dine betalingsoplysninger og bekræfte denne betaling giver du (A) ${str} og Hyperswitch, vores betalingstjenesteudbyder og/eller PPRO, dens lokale tjenesteudbyder, tilladelse til at sende instruktioner til din bank om at debitere din konto og (B) din bank om at debitere din konto i overensstemmelse med disse instruktioner. Som en del af dine rettigheder har du ret til en refusion fra din bank i henhold til vilkårene og betingelserne i din aftale med din bank. Der skal anmodes om en refusion inden for otte uger fra den dato, hvor din konto blev debiteret. Dine rettigheder er forklaret i en erklæring, som du kan få fra din bank. Du accepterer at modtage meddelelser om fremtidige debiteringer op til to dage, før de finder sted.`, + becsDebitTerms: `Ved at angive dine bankkontooplysninger og bekræfte denne betaling accepterer du denne anmodning om direkte debitering og serviceaftalen om anmodning om direkte debitering og giver Hyperswitch Payments Australia Pty Ltd ACN 160 180 343 Direct Debit User ID-nummer 507156 ( \"Hyperswitch\") tilladelse til at debitere din konto via Bulk Electronic Clearing System (BECS) på vegne af Hyperswitch Payment Widget (\"Forhandleren\") for eventuelle beløb, som Forhandleren har meddelt dig separat. Du bekræfter, at du enten er en kontoindehaver eller en autoriseret underskriver på den konto, der er angivet ovenfor.`, + cardTerms: str => + `Ved at angive dine kortoplysninger giver du tilladelse ${str} til at debitere dit kort for fremtidige betalinger i overensstemmelse med deres vilkår.`, + payNowButton: `Betal nu`, + cardNumberEmptyText: `Kortnummeret kan ikke være tomt`, + cardExpiryDateEmptyText: `Kortets udløbsdato kan ikke være tom`, + cvcNumberEmptyText: `CVC-nummeret kan ikke være tomt`, + enterFieldsText: `Udfyld venligst alle dato felter`, + enterValidDetailsText: `Indtast gyldige oplysninger`, + card: `Kort`, + billingNameLabel: `Faktureringsnavn`, + cardHolderName: `Naam van de kaarthouder`, + cardNickname: `Kaartbijnaam`, + billingNamePlaceholder: `Voornaam en achternaam`, + emailEmptyText: `E-mail mag niet leeg zijn`, + emailInvalidText: `Ongeldig e-mailadres`, + line1EmptyText: `Adresregel 1 mag niet leeg zijn`, + line2EmptyText: `Adresregel 2 mag niet leeg zijn`, + cityEmptyText: `De stad kan niet leeg zijn`, + postalCodeEmptyText: `Postcode mag niet leeg zijn`, + postalCodeInvalidText: `Ongeldige postcode`, + stateEmptyText: `De staat kan niet leeg zijn`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Een toeslagbedrag van${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}zal voor deze transactie worden toegepast`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Een toeslagbedrag van maximaal${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}zal voor deze transactie worden toegepast`)} + , + surchargeMsgAmountForOneClickWallets: `Extra kosten van toepassing`, + on: `op`, + \"and": `En`, + nameEmptyText: str => `Geef alstublieft uw ${str}`, + completeNameEmptyText: str => `Geef uw volledige ${str}`, + billingDetailsText: `Factureringsgegevens`, + socialSecurityNumberLabel: `Burgerservicenummer`, + saveWalletDetails: `Portefeuillegegevens worden bij selectie opgeslagen`, + morePaymentMethods: `Meer betaalmethoden`, + useExistingPaymentMethods: `Gebruik opgeslagen betaalmethoden`, + nicknamePlaceholder: `Bijnaam kaart (optioneel)`, + selectPaymentMethodText: `Selecteer een betaalmethode en probeer het opnieuw`, + }, + // ? - Swedish (SV) + { + locale: `sv`, + localeDirection: `ltr`, + cardNumberLabel: `Kortnummer`, + inValidCardErrorText: `Kortnumret är ogiltigt.`, + inCompleteCVCErrorText: `Kortets säkerhetskod är ofullständig.`, + inCompleteExpiryErrorText: `Kortets utgångsdatum är ofullständigt.`, + pastExpiryErrorText: `Kortets utgångsår är i det förflutna.`, + poweredBy: `Drivs av Hyperswitch`, + validThruText: `Utgångsdatum`, + sortCodeText: `Sorteringskod`, + cvcTextLabel: `CVC`, + line1Label: `Adressrad 1`, + line1Placeholder: `Gatuadress`, + line2Label: `Adressrad 2`, + line2Placeholder: `Lägenhetsnummer osv. (valfritt)`, + cityLabel: `Ort`, + postalCodeLabel: `Postnummer`, + stateLabel: `Region`, + accountNumberText: `Kontonummer`, + emailLabel: `E-postadress`, + fullNameLabel: `Fullständigt namn`, + fullNamePlaceholder: `För- och efternamn`, + countryLabel: `Land`, + currencyLabel: `Valuta`, + bankLabel: `Välj bank`, + redirectText: `När du har skickat in din beställning kommer du att omdirigeras för att säkert slutföra ditt köp.`, + bankDetailsText: `När du har skickat in dessa uppgifter får du bankkontoinformation för att göra betalningen. Se till att komma ihåg den.`, + orPayUsing: `Eller betala med`, + addNewCard: `Lägg till kredit-/betalkort`, + useExisitingSavedCards: `Använd sparade betal-/kreditkort`, + saveCardDetails: `Spara kortuppgifter`, + addBankAccount: `Lägg till bankkonto`, + achBankDebitTerms: str => + `Genom att ange ditt kontonummer och bekräfta denna betalning godkänner du att ${str} och Hyperswitch, vår betaltjänstleverantör, skickar instruktioner till din bank att debitera ditt konto och att din bank debiterar ditt konto i enlighet med dessa instruktioner. Du har rätt till återbetalning från din bank enligt villkoren i ditt avtal med din bank. En återbetalning måste begäras inom 8 veckor från det datum då ditt konto debiterades.`, + sepaDebitTerms: str => + `Genom att ange din betalningsinformation och bekräfta denna betalning godkänner du att (A) ${str} och Hyperswitch, vår betaltjänstleverantör och/eller PPRO, dess lokala tjänsteleverantör, skickar instruktioner till din bank att debitera ditt konto och (B) att din bank debiterar ditt konto i enlighet med dessa instruktioner. Som en del av dina rättigheter har du rätt till återbetalning från din bank enligt villkoren i ditt avtal med din bank. En återbetalning måste begäras inom 8 veckor från det datum då ditt konto debiterades. Dina rättigheter förklaras i ett uttalande som du kan erhålla från din bank. Du samtycker till att få aviseringar för framtida debiteringar upp till 2 dagar innan de inträffar.`, + becsDebitTerms: "Genom att ange dina bankkontouppgifter och bekräfta denna betalning godkänner du denna autogirering och serviceavtalet för autogirering och godkänner att Hyperswitch Payments Australia Pty Ltd ACN 160 180 343 med användar-ID för direktdebitering 507156 ( \"Hyperswitch\") debiterar ditt konto via Bulk Electronic Clearing System (BECS) på uppdrag av Hyperswitch Payment Widget (\"Handlaren\") för eventuella belopp som separat meddelats dig av Handlaren. Du intygar att du antingen är kontoinnehavare eller behörig undertecknare för kontot som anges ovan.", + cardTerms: str => + `Genom att ange din kortinformation tillåter du att ${str} debiterar ditt kort för framtida betalningar i enlighet med deras villkor.`, + payNowButton: `Betala nu`, + cardNumberEmptyText: `Kortnummer får inte vara tomt`, + cardExpiryDateEmptyText: `Kortets utgångsdatum får inte vara tomt`, + cvcNumberEmptyText: `CVC-nummer får inte vara tomt`, + enterFieldsText: `Fyll i samtliga fält`, + enterValidDetailsText: `Ange giltiga uppgifter`, + card: `Kort`, + billingNameLabel: `Faktureringsnamn`, + cardHolderName: `Korthållarens namn`, + cardNickname: `Kortets smeknamn`, + billingNamePlaceholder: `Förnamn och efternamn`, + emailEmptyText: `E-post får inte vara tom`, + emailInvalidText: `Ogiltig e-postadress`, + line1EmptyText: `Adressrad 1 får inte vara tom`, + line2EmptyText: `Adressrad 2 får inte vara tom`, + cityEmptyText: `Staden får inte vara tom`, + postalCodeEmptyText: `Postnummer får inte vara tomt`, + postalCodeInvalidText: `Ogiltigt postnummer`, + stateEmptyText: "Staten får inte vara tom", + surchargeMsgAmount: (currency, str) => <> + {React.string(`Ett tilläggsbelopp på${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({`${Utils.nbsp}kommer att tillämpas för denna transaktion`})} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Ett tilläggsbelopp på upp till${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}kommer att tillämpas för denna transaktion`)} + , + surchargeMsgAmountForOneClickWallets: "Tilläggsavgift tillkommer", + on: "på", + \"and": "och", + nameEmptyText: str => `Vänligen ange din ${str}`, + completeNameEmptyText: str => `Vänligen ange din fullständiga ${str}`, + billingDetailsText: `Faktureringsuppgifter`, + socialSecurityNumberLabel: `Personnummer`, + saveWalletDetails: `Information om plånböcker kommer att sparas vid val`, + morePaymentMethods: `Fler betalningsmetoder`, + useExistingPaymentMethods: `Använd sparade betalningsmetoder`, + nicknamePlaceholder: `Kortets smeknamn (valfritt)`, + selectPaymentMethodText: `Välj en betalningsmetod och försök igen`, + }, + // ? - Russian (ru) + { + locale: `ru`, + localeDirection: `ltr`, + cardNumberLabel: `Номер карты`, + inValidCardErrorText: `Номер карты недействителен.`, + inCompleteCVCErrorText: `Неправильно указан код безопасности карты.`, + inCompleteExpiryErrorText: `Неправильно указан срок действия карты.`, + pastExpiryErrorText: `Год истечения срока действия карты в прошлом.`, + poweredBy: `Работает на Hyperswitch`, + validThruText: `Окончание действия`, + sortCodeText: `Номер отделения банка`, + cvcTextLabel: `CVC`, + line1Label: `Адресная строка 1`, + line1Placeholder: `Улица`, + line2Label: `Адресная строка 2`, + line2Placeholder: `Квартира, номер блока и т. д. (необязательно)`, + cityLabel: `Город`, + postalCodeLabel: `Почтовый индекс`, + stateLabel: `Область`, + accountNumberText: `Номер счета`, + emailLabel: `Электронная почта`, + fullNameLabel: `Ф.И.О.`, + fullNamePlaceholder: `Имя и фамилия`, + countryLabel: `Страна`, + currencyLabel: `Валюта`, + bankLabel: `Выберите банк`, + redirectText: `После оформления заказа вы будете перенаправлены на другую страницу для безопасного завершения покупки.`, + bankDetailsText: `После ввода этих данных вы получите банковские реквизиты для совершения платежа. Обязательно запишите их.`, + orPayUsing: `Или оплатить с помощью`, + addNewCard: `Добавить кредитную/дебетовую карту`, + useExisitingSavedCards: `Использовать сохраненные дебетовые/кредитные карты`, + saveCardDetails: `Сохранить данные карты`, + addBankAccount: `Добавить банковский счет`, + achBankDebitTerms: str => + `Предоставляя номер своего счета и подтверждая этот платеж, вы уполномочиваете ${str} и Hyperswitch, нашего поставщика платежных услуг, отправить инструкции в ваш банк для списания средств с вашего счета, а ваш банк — списать средства с вашего счета в соответствии с этими инструкциями. Вы имеете право на возврат средств от своего банка в соответствии с условиями вашего договора с банком. Заявление на возврат средств должно быть подано в течение 8 недель, начиная с даты списания средств с вашего счета.`, + sepaDebitTerms: str => + `Предоставляя свои платежные данные и подтверждая данный платеж, вы уполномочиваете (А) ${str} и Hyperswitch, нашего поставщика платежных услуг и/или PPRO, его местного поставщика услуг, отправить инструкции в ваш банк для списания средств с вашего счета и (Б) ваш банк списать средства с вашего счета в соответствии с этими инструкциями. В рамках своих прав вы имеете право на возврат средств от своего банка в соответствии с условиями вашего договора с банком. Заявление на возврат средств должно быть подано в течение 8 недель, начиная с даты списания средств с вашего счета. Ваши права разъясняются в заявлении, которое вы можете получить в своем банке. Вы соглашаетесь получать уведомления о будущих списаниях средств за 2 дня до их осуществления.`, + becsDebitTerms: `Предоставляя свои банковские реквизиты и подтверждая этот платеж, вы соглашаетесь с настоящим Запросом на прямое дебетование и соглашением об услуге Запроса на прямое дебетование и уполномочиваете Hyperswitch Payments Australia Pty Ltd ACN 160 180 343 Direct Debit User ID number 507156 («Hyperswitch») списать средства с вашего счета через Систему массовых электронных расчетов (BECS) от имени Платежного виджета Hyperswitch («Продавец») на любые суммы, отдельно сообщенные вам Продавцом. Вы подтверждаете, что являетесь владельцем счета или уполномоченным лицом с правом подписи по указанному выше счету.`, + cardTerms: str => + `Предоставляя данные своей карты, вы позволяете компании ${str} списать средства с вашей карты для будущих платежей в соответствии с ее условиями.`, + payNowButton: `Оплатить сейчас`, + cardNumberEmptyText: `Необходимо указать номер карты`, + cardExpiryDateEmptyText: `Необходимо указать дату окончания срока действия карты`, + cvcNumberEmptyText: `Необходимо указать номер CVC`, + enterFieldsText: `Заполните все поля`, + enterValidDetailsText: `Введите действительные данные`, + card: `Карта`, + billingNameLabel: `Имя плательщика`, + cardHolderName: `Имя держателя карты`, + cardNickname: `Прозвище карты`, + billingNamePlaceholder: `Имя и фамилия`, + emailEmptyText: `Электронная почта не может быть пустой`, + emailInvalidText: `Неверный адрес электронной почты`, + line1EmptyText: `Адресная строка 1 не может быть пустой.`, + line2EmptyText: `Адресная строка 2 не может быть пустой.`, + cityEmptyText: `Город не может быть пустым`, + postalCodeEmptyText: `Почтовый индекс не может быть пустым`, + postalCodeInvalidText: `Неверный почтовый индекс`, + stateEmptyText: `Штат не может быть пустым`, + surchargeMsgAmount: (currency, str) => <> + {React.string(`Дополнительная сумма в размере${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string({ + `${Utils.nbsp}будет применено к этой транзакции` + })} + , + surchargeMsgAmountForCard: (currency, str) => <> + {React.string(`Сумма доплаты до${Utils.nbsp}`)} + {React.string(`${currency} ${str}`)} + {React.string(`${Utils.nbsp}будет применено к этой транзакции`)} + , + surchargeMsgAmountForOneClickWallets: `Возможна дополнительная плата`, + on: `на`, + \"and": `и`, + nameEmptyText: str => `Пожалуйста, предоставьте свой ${str}`, + completeNameEmptyText: str => + `Пожалуйста, предоставьте полную ${str}`, + billingDetailsText: `Платежные реквизиты`, + socialSecurityNumberLabel: `Номер социального страхования`, + saveWalletDetails: `Данные кошельков будут сохранены после выбора.`, + morePaymentMethods: `Больше способов оплаты`, + useExistingPaymentMethods: `Используйте сохраненные способы оплаты`, + nicknamePlaceholder: `Псевдоним карты (необязательно)`, + selectPaymentMethodText: `Пожалуйста, выберите способ оплаты и повторите попытку.`, + }, ] From d822a9afa793033c5e0eb6274aac5e9affcafb03 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 4 Apr 2024 10:41:36 +0000 Subject: [PATCH 14/14] chore(release): 0.38.0 [skip ci] # [0.38.0](https://github.com/juspay/hyperswitch-web/compare/v0.37.0...v0.38.0) (2024-04-04) ### Features * locale-string added for rest locales ([#247](https://github.com/juspay/hyperswitch-web/issues/247)) ([3070e8f](https://github.com/juspay/hyperswitch-web/commit/3070e8f54d2d7850ee4b20e5ba62a77624896f33)) --- CHANGELOG.md | 7 ++ package-lock.json | 179 +++++++++++++++------------------------------- package.json | 2 +- 3 files changed, 66 insertions(+), 122 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac93bfec0..919581cf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [0.38.0](https://github.com/juspay/hyperswitch-web/compare/v0.37.0...v0.38.0) (2024-04-04) + + +### Features + +* locale-string added for rest locales ([#247](https://github.com/juspay/hyperswitch-web/issues/247)) ([3070e8f](https://github.com/juspay/hyperswitch-web/commit/3070e8f54d2d7850ee4b20e5ba62a77624896f33)) + # [0.37.0](https://github.com/juspay/hyperswitch-web/compare/v0.36.2...v0.37.0) (2024-04-04) diff --git a/package-lock.json b/package-lock.json index 704b143e7..91dc96199 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.37.0", + "version": "0.38.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2870,21 +2870,6 @@ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2902,40 +2887,6 @@ "strip-ansi": "^7.0.1" } }, - "string-width-cjs": { - "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -2945,23 +2896,6 @@ "ansi-regex": "^6.0.1" } }, - "strip-ansi-cjs": { - "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - } - } - }, "wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -2972,60 +2906,6 @@ "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } - }, - "wrap-ansi-cjs": { - "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } } } }, @@ -20972,6 +20852,17 @@ "strip-ansi": "^6.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -21063,6 +20954,15 @@ "ansi-regex": "^5.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -23630,6 +23530,43 @@ } } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 5a0ae420a..fb70d3a21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.37.0", + "version": "0.38.0", "main": "index.js", "private": true, "dependencies": {