From de06cc2bd46354531fb6fda523f6471b3eb7b8dc Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Tue, 23 Apr 2024 12:12:35 +0530 Subject: [PATCH 1/9] feat: compressed theme layout added --- src/BrutalTheme.res | 5 ++ src/CardTheme.res | 19 +++++++- src/CharcoalTheme.res | 6 +++ src/Components/BillingNamePaymentInput.res | 3 +- src/Components/DropdownField.res | 10 +++- src/Components/DynamicFields.res | 53 ++++++++++++++++------ src/Components/FullNamePaymentInput.res | 9 +++- src/Components/PaymentDropDownField.res | 10 +++- src/Components/PaymentField.res | 10 +++- src/Components/PaymentInputField.res | 12 +++-- src/DefaultTheme.res | 7 +++ src/MidnightTheme.res | 6 +++ src/PaymentElement.res | 12 ++--- src/Payments/CardPayment.res | 27 +++++++++-- src/Payments/KlarnaPayment.res | 5 +- src/Payments/SepaBankDebit.res | 6 ++- src/SoftTheme.res | 5 ++ src/Types/CardThemeType.res | 3 ++ 18 files changed, 169 insertions(+), 39 deletions(-) diff --git a/src/BrutalTheme.res b/src/BrutalTheme.res index c0a8ee962..aa5b84d2f 100644 --- a/src/BrutalTheme.res +++ b/src/BrutalTheme.res @@ -90,6 +90,11 @@ let brutalRules = (theme: CardThemeType.themeClass) => "color": theme.colorText, "borderRadius": theme.borderRadius, }, + ".Input-Compressed": { + "border": `0.1em solid #000000`, + "boxShadow": "0.12em 0.12em", + "color": theme.colorText, + }, ".Input:-webkit-autofill": { "transition": "background-color 5000s ease-in-out 0s", "-webkitTextFillColor": `${theme.colorText} !important`, diff --git a/src/CardTheme.res b/src/CardTheme.res index 4378a1e19..f9a42bfda 100644 --- a/src/CardTheme.res +++ b/src/CardTheme.res @@ -20,6 +20,16 @@ let getTheme = (val, logger) => { } } } + +let getInnerLayout = str => { + switch str { + | "compressed" => Compressed + | "spaced" + | _ => + Spaced + } +} + let getShowLoader = (str, logger) => { switch str { | "auto" => Auto @@ -49,6 +59,7 @@ let defaultAppearance = { componentType: "payment", labels: Above, rules: Dict.make()->JSON.Encode.object, + innerLayout: Spaced, } let defaultFonts = { cssSrc: "", @@ -316,7 +327,12 @@ let getAppearance = ( ->Dict.get(str) ->Option.flatMap(JSON.Decode.object) ->Option.map(json => { - unknownKeysWarning(["theme", "variables", "rules", "labels"], json, "appearance", ~logger) + unknownKeysWarning( + ["theme", "variables", "rules", "labels", "innerLayout"], + json, + "appearance", + ~logger, + ) let rulesJson = defaultRules(getVariables("variables", json, default, logger)) @@ -325,6 +341,7 @@ let getAppearance = ( componentType: getWarningString(json, "componentType", "", ~logger), variables: getVariables("variables", json, default, logger), rules: mergeJsons(rulesJson, getJsonObjectFromDict(json, "rules")), + innerLayout: getWarningString(json, "innerLayout", "spaced", ~logger)->getInnerLayout, labels: switch getWarningString(json, "labels", "above", ~logger) { | "above" => Above | "floating" => Floating diff --git a/src/CharcoalTheme.res b/src/CharcoalTheme.res index 046db3d66..3fd069233 100644 --- a/src/CharcoalTheme.res +++ b/src/CharcoalTheme.res @@ -89,6 +89,12 @@ let charcoalRules = theme => "color": theme.colorText, "borderRadius": theme.borderRadius, }, + ".Input-Compressed": { + "border": `1px solid ${theme.colorBackground}`, + "fontWeight": theme.fontWeightLight, + "boxShadow": "0.12em 0.12em", + "color": theme.colorText, + }, ".Input:-webkit-autofill": { "transition": "background-color 5000s ease-in-out 0s", "-webkitTextFillColor": `${theme.colorText} !important`, diff --git a/src/Components/BillingNamePaymentInput.res b/src/Components/BillingNamePaymentInput.res index d92abd5fc..cf2d55a5d 100644 --- a/src/Components/BillingNamePaymentInput.res +++ b/src/Components/BillingNamePaymentInput.res @@ -4,7 +4,7 @@ open Utils @react.component let make = (~paymentType, ~customFieldName=None, ~requiredFields as optionalRequiredFields=?) => { - let {localeString} = Recoil.useRecoilValueFromAtom(configAtom) + let {config, localeString} = Recoil.useRecoilValueFromAtom(configAtom) let {fields} = Recoil.useRecoilValueFromAtom(optionAtom) let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom) @@ -74,6 +74,7 @@ let make = (~paymentType, ~customFieldName=None, ~requiredFields as optionalRequ name="name" inputRef=nameRef placeholder + className={config.appearance.innerLayout === Spaced ? "" : "!border-b-0"} /> } diff --git a/src/Components/DropdownField.res b/src/Components/DropdownField.res index 09a54d5a6..3e3c5ae5b 100644 --- a/src/Components/DropdownField.res +++ b/src/Components/DropdownField.res @@ -14,6 +14,7 @@ let make = ( let dropdownRef = React.useRef(Nullable.null) let (inputFocused, setInputFocused) = React.useState(_ => false) let {parentURL} = Recoil.useRecoilValueFromAtom(keys) + let isSpacedInnerLayout = config.appearance.innerLayout === Spaced let handleFocus = _ => { setInputFocused(_ => true) @@ -46,7 +47,10 @@ let make = ( let cursorClass = !disabled ? "cursor-pointer" : "cursor-not-allowed" Array.length > 0}>
- String.length > 0 && appearance.labels == Above}> + String.length > 0 && + appearance.labels == Above && + isSpacedInnerLayout}>
+ className={`${isSpacedInnerLayout + ? "Input" + : "Input-Compressed"} ${className} w-full appearance-none outline-none ${cursorClass}`}> {options ->Array.mapWithIndex((item: string, i) => { diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index 0a5a1dcac..bc4b30978 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -65,6 +65,7 @@ let make = ( }, (requiredFields, isAllStoredCardsHaveName, isSavedCardFlow)) let {config, themeObj, localeString} = Recoil.useRecoilValueFromAtom(configAtom) + let isSpacedInnerLayout = config.appearance.innerLayout === Spaced let logger = Recoil.useRecoilValueFromAtom(loggerAtom) @@ -435,11 +436,22 @@ let make = ( options=currencyArr /> | FullName => - getCustomFieldName} - optionalRequiredFields={Some(requiredFields)} - /> + <> +
+ {item->getCustomFieldName->Option.getOr("")->React.string} +
+ getCustomFieldName} + optionalRequiredFields={Some(requiredFields)} + /> + | Email | InfoElement | Country @@ -463,15 +475,26 @@ let make = ( ->React.array}
- {React.string(localeString.billingDetailsText)} -
+
+ {React.string(localeString.billingDetailsText)} +
+
{dynamicFieldsToRenderInsideBilling ->Array.mapWithIndex((item, index) => {
| PhoneNumber => | StateAndCity => -
+
{switch stateJson { | Some(options) => @@ -524,7 +548,7 @@ let make = ( }}
| CountryAndPincode(countryArr) => -
+
| AddressLine1 => @@ -576,6 +602,7 @@ let make = ( name="line1" inputRef=line1Ref placeholder=localeString.line1Placeholder + className={isSpacedInnerLayout ? "" : "!border-b-0"} /> | AddressLine2 => { - let {localeString} = Recoil.useRecoilValueFromAtom(configAtom) +let make = ( + ~paymentType: CardThemeType.mode, + ~customFieldName=None, + ~optionalRequiredFields=None, +) => { + Js.log2("paymentTypepaymentType", customFieldName) + let {localeString, themeObj} = Recoil.useRecoilValueFromAtom(configAtom) let {fields} = Recoil.useRecoilValueFromAtom(optionAtom) let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom) diff --git a/src/Components/PaymentDropDownField.res b/src/Components/PaymentDropDownField.res index d63b61037..fd1b71b33 100644 --- a/src/Components/PaymentDropDownField.res +++ b/src/Components/PaymentDropDownField.res @@ -14,6 +14,7 @@ let make = ( let dropdownRef = React.useRef(Nullable.null) let (inputFocused, setInputFocused) = React.useState(_ => false) let {parentURL} = Recoil.useRecoilValueFromAtom(keys) + let isSpacedInnerLayout = config.appearance.innerLayout === Spaced let getClassName = initialLabel => { if value.value->String.length == 0 { @@ -74,7 +75,10 @@ let make = ( let cursorClass = !disabled ? "cursor-pointer" : "cursor-not-allowed" Array.length > 0}>
- String.length > 0 && config.appearance.labels == Above}> + String.length > 0 && + config.appearance.labels == Above && + isSpacedInnerLayout}>
+ className={`${isSpacedInnerLayout + ? "Input" + : "Input-Compressed"} ${inputClass} ${className} w-full appearance-none outline-none ${cursorClass}`}> {options ->Array.mapWithIndex((item: string, i) => { diff --git a/src/Components/PaymentField.res b/src/Components/PaymentField.res index c9bcb8b3d..348b67921 100644 --- a/src/Components/PaymentField.res +++ b/src/Components/PaymentField.res @@ -21,6 +21,7 @@ let make = ( let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom) let {readOnly} = Recoil.useRecoilValueFromAtom(optionAtom) let {parentURL} = Recoil.useRecoilValueFromAtom(keys) + let isSpacedInnerLayout = config.appearance.innerLayout === Spaced let (inputFocused, setInputFocused) = React.useState(_ => false) @@ -77,7 +78,10 @@ let make = ( let inputClass = getClassName("Input")
- String.length > 0 && config.appearance.labels == Above}> + String.length > 0 && + config.appearance.labels == Above && + isSpacedInnerLayout}>
{ - let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom) + let {themeObj, config} = Recoil.useRecoilValueFromAtom(configAtom) + let {innerLayout} = config.appearance let {readOnly} = Recoil.useRecoilValueFromAtom(optionAtom) let {parentURL} = Recoil.useRecoilValueFromAtom(keys) @@ -76,7 +77,10 @@ let make = ( let inputClass = getClassName("Input")
- String.length > 0 && appearance.labels == Above}> + String.length > 0 && + appearance.labels == Above && + innerLayout === Spaced}>
"boxShadow": `0px 1px 1px rgb(0 0 0 / 3%), 0px 3px 6px rgb(0 0 0 / 2%)`, "transition": "background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", }, + ".Input-Compressed": { + "border": `1px solid #e6e6e6`, + "color": theme.colorText, + "fontWeight": theme.fontWeightLight, + "boxShadow": `0px 1px 1px rgb(0 0 0 / 3%), 0px 3px 6px rgb(0 0 0 / 2%)`, + "transition": "background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", + }, ".Input:-webkit-autofill": { "transition": "background-color 5000s ease-in-out 0s", "-webkitTextFillColor": `${theme.colorText} !important`, diff --git a/src/MidnightTheme.res b/src/MidnightTheme.res index 0a9a3cab5..12ec77bda 100644 --- a/src/MidnightTheme.res +++ b/src/MidnightTheme.res @@ -104,6 +104,12 @@ let midnightRules = theme => "boxShadow": `0px 2px 4px rgb(0 0 0 / 50%), 0px 1px 6px rgb(0 0 0 / 25%)`, "transition": "background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", }, + ".Input-Compressed": { + "border": `1px solid #424353`, + "color": "#ffffff", + "boxShadow": `0px 2px 4px rgb(0 0 0 / 50%), 0px 1px 6px rgb(0 0 0 / 25%)`, + "transition": "background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", + }, ".Input:-webkit-autofill": { "transition": "background-color 5000s ease-in-out 0s", "-webkitTextFillColor": "#ffffff !important", diff --git a/src/PaymentElement.res b/src/PaymentElement.res index 04a3cd033..769aa88e0 100644 --- a/src/PaymentElement.res +++ b/src/PaymentElement.res @@ -461,12 +461,6 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod {React.string(localeString.useExistingPaymentMethods)}
- -
- -
-
- {switch methodslist { | LoadError(_) => React.null | _ => @@ -474,5 +468,11 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod
}} + +
+ +
+
+ } diff --git a/src/Payments/CardPayment.res b/src/Payments/CardPayment.res index 14aee6d5b..04f60a3a1 100644 --- a/src/Payments/CardPayment.res +++ b/src/Payments/CardPayment.res @@ -16,6 +16,7 @@ let make = ( open UtilityHooks let {config, themeObj, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom) + let {innerLayout} = config.appearance let options = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom) let loggerState = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom) @@ -194,6 +195,17 @@ let make = ( className="flex flex-col" style={ReactDOMStyle.make(~gridGap=themeObj.spacingGridColumn, ())}>
+ +
+ {React.string("Card information")} +
+
-
+
-
+
{
+ style={ReactDOMStyle.make( + ~gridGap=config.appearance.innerLayout === Spaced ? themeObj.spacingGridColumn : "", + (), + )}> diff --git a/src/Payments/SepaBankDebit.res b/src/Payments/SepaBankDebit.res index 10e2f9ca3..0428df145 100644 --- a/src/Payments/SepaBankDebit.res +++ b/src/Payments/SepaBankDebit.res @@ -6,6 +6,7 @@ open PaymentModeType @react.component let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list) => { let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom) + let {config} = Recoil.useRecoilValueFromAtom(configAtom) let intent = PaymentHelpers.usePaymentIntent(Some(loggerState), BankDebits) let {themeObj} = Recoil.useRecoilValueFromAtom(configAtom) @@ -77,7 +78,10 @@ let make = (~paymentType: CardThemeType.mode, ~list: PaymentMethodsRecord.list)
+ style={ReactDOMStyle.make( + ~gridGap={config.appearance.innerLayout === Spaced ? themeObj.spacingGridColumn : ""}, + (), + )}> diff --git a/src/SoftTheme.res b/src/SoftTheme.res index 8ddde7962..155acb8de 100644 --- a/src/SoftTheme.res +++ b/src/SoftTheme.res @@ -85,6 +85,11 @@ let softRules = theme => "boxShadow": `inset 4px 4px 5px #353637, inset -4px -3px 7px #434445`, "transition": "background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", }, + ".Input-Compressed": { + "color": theme.colorText, + "boxShadow": `inset 4px 4px 5px #353637, inset -4px -3px 7px #434445`, + "transition": "background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", + }, ".Input:-webkit-autofill": { "transition": "background-color 5000s ease-in-out 0s", "-webkitTextFillColor": `${theme.colorText} !important`, diff --git a/src/Types/CardThemeType.res b/src/Types/CardThemeType.res index 7001fcba4..d363075ea 100644 --- a/src/Types/CardThemeType.res +++ b/src/Types/CardThemeType.res @@ -1,5 +1,7 @@ type theme = Default | Brutal | Midnight | Soft | Charcoal | NONE +type innerLayout = Spaced | Compressed + @val external navigator: 'a = "navigator" type showLoader = Auto | Always | Never @@ -66,6 +68,7 @@ type appearance = { variables: themeClass, rules: JSON.t, labels: label, + innerLayout: innerLayout, } type fonts = { cssSrc: string, From f3e83532dddf456b2b30adf8d4570dbc40c8347f Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Tue, 23 Apr 2024 12:13:27 +0530 Subject: [PATCH 2/9] fix: remove log --- src/Components/FullNamePaymentInput.res | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Components/FullNamePaymentInput.res b/src/Components/FullNamePaymentInput.res index 8ce05818e..d4bdba709 100644 --- a/src/Components/FullNamePaymentInput.res +++ b/src/Components/FullNamePaymentInput.res @@ -8,8 +8,7 @@ let make = ( ~customFieldName=None, ~optionalRequiredFields=None, ) => { - Js.log2("paymentTypepaymentType", customFieldName) - let {localeString, themeObj} = Recoil.useRecoilValueFromAtom(configAtom) + let {localeString} = Recoil.useRecoilValueFromAtom(configAtom) let {fields} = Recoil.useRecoilValueFromAtom(optionAtom) let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom) From 430b75920b42bd06e9f425caacc49526d06d753c Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Wed, 24 Apr 2024 15:58:30 +0530 Subject: [PATCH 3/9] fix: error message and style fix --- src/BrutalTheme.res | 4 +++ src/CharcoalTheme.res | 7 ++++- src/Components/PaymentInputField.res | 38 +++++++++++++++------------- src/DefaultTheme.res | 8 +++++- src/MidnightTheme.res | 6 +++++ src/Payments/CardPayment.res | 27 +++++++++++++++++--- src/SoftTheme.res | 3 +++ 7 files changed, 69 insertions(+), 24 deletions(-) diff --git a/src/BrutalTheme.res b/src/BrutalTheme.res index aa5b84d2f..c8125a910 100644 --- a/src/BrutalTheme.res +++ b/src/BrutalTheme.res @@ -103,6 +103,10 @@ let brutalRules = (theme: CardThemeType.themeClass) => "transform": "translate(0.05em, 0.05em)", "boxShadow": "0.02em 0.02em", }, + ".Input-Compressed:focus": { + "transform": "translate(0.02em, 0.02em)", + "boxShadow": "0.01em 0.01em", + }, ".Input--invalid": { "border": `0.1em solid ${theme.colorDangerText}`, "color": theme.colorDanger, diff --git a/src/CharcoalTheme.res b/src/CharcoalTheme.res index 3fd069233..b64a74c31 100644 --- a/src/CharcoalTheme.res +++ b/src/CharcoalTheme.res @@ -92,7 +92,6 @@ let charcoalRules = theme => ".Input-Compressed": { "border": `1px solid ${theme.colorBackground}`, "fontWeight": theme.fontWeightLight, - "boxShadow": "0.12em 0.12em", "color": theme.colorText, }, ".Input:-webkit-autofill": { @@ -103,6 +102,12 @@ let charcoalRules = theme => "border": `1px solid ${theme.colorPrimary}`, "boxShadow": `${theme.colorPrimary}4c 0px 0px 0px 3px`, }, + ".Input-Compressed:focus": { + "border": `2px solid ${theme.colorPrimary}`, + "boxShadow": `${theme.colorPrimary}4c 0px 0px 0px 2px`, + "position": "relative", + "zIndex": "2", + }, ".Input--invalid": { "color": theme.colorDanger, "border": `2px solid ${theme.colorDanger}`, diff --git a/src/Components/PaymentInputField.res b/src/Components/PaymentInputField.res index f6201ed44..832f4302a 100644 --- a/src/Components/PaymentInputField.res +++ b/src/Components/PaymentInputField.res @@ -134,24 +134,26 @@ let make = (
-
{rightIcon}
+
{rightIcon}
- {switch errorString { - | Some(val) => - String.length > 0}> -
- {React.string(val)} -
-
- | None => React.null - }} + + {switch errorString { + | Some(val) => + String.length > 0}> +
+ {React.string(val)} +
+
+ | None => React.null + }} +
} diff --git a/src/DefaultTheme.res b/src/DefaultTheme.res index 0bd07cc83..7927810de 100644 --- a/src/DefaultTheme.res +++ b/src/DefaultTheme.res @@ -111,9 +111,15 @@ let defaultRules = theme => "border": `1px solid ${theme.colorPrimary}`, "boxShadow": `${theme.colorPrimary}4c 0px 0px 0px 3px`, }, + ".Input-Compressed:focus": { + "border": `1px solid ${theme.colorPrimary}`, + "boxShadow": `${theme.colorPrimary}4c 0px 0px 0px 2px`, + "position": "relative", + "zIndex": "2", + }, ".Input--invalid": { "color": theme.colorDanger, - "border": `2px solid ${theme.colorDanger}`, + "border": `1px solid ${theme.colorDanger}`, "transition": "border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease", }, ".Input::placeholder": { diff --git a/src/MidnightTheme.res b/src/MidnightTheme.res index 12ec77bda..662f15d41 100644 --- a/src/MidnightTheme.res +++ b/src/MidnightTheme.res @@ -118,6 +118,12 @@ let midnightRules = theme => "border": `1px solid ${theme.colorPrimary}`, "boxShadow": `${theme.colorPrimary}4c 0px 0px 0px 3px`, }, + ".Input-Compressed:focus": { + "border": `1px solid ${theme.colorPrimary}`, + "boxShadow": `${theme.colorPrimary}4c 0px 0px 0px 2px`, + "position": "relative", + "zIndex": "2", + }, ".Input--invalid": { "color": theme.colorDanger, "border": `2px solid ${theme.colorDanger}`, diff --git a/src/Payments/CardPayment.res b/src/Payments/CardPayment.res index 04f60a3a1..8e673076e 100644 --- a/src/Payments/CardPayment.res +++ b/src/Payments/CardPayment.res @@ -222,7 +222,9 @@ let make = ( maxLength=maxCardLength inputRef=cardRef placeholder="1234 1234 1234 1234" - className={innerLayout === Spaced ? "" : "!border-b-0"} + className={innerLayout === Compressed && cardError->String.length > 0 + ? "border-b-0" + : ""} />
String.length > 0 + ? "!border-l-0" + : ""}`} maxLength=4 inputRef=cvcRef placeholder="123" />
+ String.length > 0 || + cvcError->String.length > 0 || + expiryError->String.length > 0}> +
+ {React.string("Invalid input")} +
+
".Input:focus": { "boxShadow": `inset 8px 7px 7px #353637, inset -8px -6px 7px #434445`, }, + ".Input-Compressed:focus": { + "boxShadow": `inset 8px 7px 7px #353637, inset -8px -6px 7px #434445`, + }, ".Input--invalid": { "color": theme.colorDanger, }, From 1f754b6f4023709752ef892c0e2861d34aa4f2fe Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa Date: Wed, 24 Apr 2024 19:36:01 +0530 Subject: [PATCH 4/9] fix: added breakpoints to debug --- src/Payments/ApplePay.res | 3 ++- src/orca-loader/Elements.res | 49 ++++++++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/Payments/ApplePay.res b/src/Payments/ApplePay.res index a3a985a23..c10026aa5 100644 --- a/src/Payments/ApplePay.res +++ b/src/Payments/ApplePay.res @@ -309,7 +309,8 @@ let make = ( postFailedSubmitResponse(~errortype="server_error", ~message="Something went wrong") } } else if dict->Dict.get("applePaySyncPayment")->Option.isSome { - syncPayment() + () + // syncPayment(breakpoint) } } catch { | _ => Utils.logInfo(Console.log("Error in parsing Apple Pay Data")) diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 37716fc43..6c206410c 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -4,6 +4,7 @@ open Identity open Utils open EventListenerManager open ApplePayTypes +@send external alert: ('t, string) => unit = "alert" type trustPayFunctions = { finishApplePaymentV2: (string, paymentRequestData) => Promise.t, @@ -462,7 +463,6 @@ let make = ( addSmartEventListener("message", handleApplePayMounted, "onApplePayMount") addSmartEventListener("message", handlePollStatusMessage, "onPollStatusMsg") addSmartEventListener("message", handleGooglePayThirdPartyFlow, "onGooglePayThirdParty") - Window.removeEventListener("message", handleApplePayMessages.contents) let fetchSessionTokens = mountedIframeRef => { let handleSessionTokensLoaded = (event: Types.event) => { @@ -536,6 +536,11 @@ let make = ( ->JSON.Decode.bool ->Belt.Option.getWithDefault(false) + Window.window->alert( + "isDelayedSessionToken: " ++ + isDelayedSessionToken->anyTypeToJson->JSON.stringify, + ) + if isDelayedSessionToken { logger.setLogInfo( ~value="Delayed Session Token Flow", @@ -544,19 +549,28 @@ let make = ( (), ) - let applePayPresent = + let applePaySessionTokenData = dict ->Dict.get("applePayPresent") ->Belt.Option.flatMap(JSON.Decode.object) ->Belt.Option.getWithDefault(Dict.make()) + Window.window->alert( + "applePaySessionTokenData: " ++ + applePaySessionTokenData->anyTypeToJson->JSON.stringify, + ) + let connector = - applePayPresent + applePaySessionTokenData ->Dict.get("connector") ->Belt.Option.getWithDefault(JSON.Encode.null) ->JSON.Decode.string ->Belt.Option.getWithDefault("") + Window.window->alert( + "connector: " ++ connector->anyTypeToJson->JSON.stringify, + ) + switch connector { | "trustpay" => logger.setLogInfo( @@ -566,7 +580,7 @@ let make = ( (), ) let secrets = - applePayPresent + applePaySessionTokenData ->Dict.get("session_token_data") ->Belt.Option.getWithDefault(JSON.Encode.null) ->JSON.Decode.object @@ -574,13 +588,22 @@ let make = ( ->Dict.get("secrets") ->Belt.Option.getWithDefault(JSON.Encode.null) + Window.window->alert( + "secrets: " ++ secrets->anyTypeToJson->JSON.stringify, + ) + let paymentRequest = - applePayPresent + applePaySessionTokenData ->Dict.get("payment_request_data") ->Belt.Option.flatMap(JSON.Decode.object) ->Belt.Option.getWithDefault(Dict.make()) ->ApplePayTypes.jsonToPaymentRequestDataType + Window.window->alert( + "paymentRequest: " ++ + paymentRequest->anyTypeToJson->JSON.stringify, + ) + let payment = secrets ->JSON.Decode.object @@ -590,10 +613,17 @@ let make = ( ->JSON.Decode.string ->Belt.Option.getWithDefault("") + Window.window->alert( + "payment: " ++ payment->anyTypeToJson->JSON.stringify, + ) + try { let trustpay = trustPayApi(secrets) trustpay.finishApplePaymentV2(payment, paymentRequest) ->then(res => { + Window.window->alert( + "res: " ++ res->anyTypeToJson->JSON.stringify, + ) logger.setLogInfo( ~value="TrustPay ApplePay Success Response", ~internalMetadata=res->JSON.stringify, @@ -604,6 +634,7 @@ let make = ( let msg = [ ("applePaySyncPayment", true->JSON.Encode.bool), + ("breakpoint", "1"->JSON.Encode.string), ]->Dict.fromArray mountedIframeRef->Window.iframePostMessage(msg) logger.setLogInfo( @@ -617,6 +648,9 @@ let make = ( ->catch(err => { let exceptionMessage = err->Utils.formatException->JSON.stringify + Window.window->alert( + "err: " ++ err->anyTypeToJson->JSON.stringify, + ) logger.setLogInfo( ~eventName=APPLE_PAY_FLOW, ~paymentMethod="APPLE_PAY", @@ -626,6 +660,7 @@ let make = ( let msg = [ ("applePaySyncPayment", true->JSON.Encode.bool), + ("breakpoint", "2"->JSON.Encode.string), ]->Dict.fromArray mountedIframeRef->Window.iframePostMessage(msg) resolve() @@ -639,9 +674,13 @@ let make = ( ~paymentMethod="APPLE_PAY", (), ) + Window.window->alert( + "exn: " ++ exn->Utils.formatException->JSON.stringify, + ) let msg = [ ("applePaySyncPayment", true->JSON.Encode.bool), + ("breakpoint", "3"->JSON.Encode.string), ]->Dict.fromArray mountedIframeRef->Window.iframePostMessage(msg) } From 4c3df2989c7fa93ef245301ac661a3e469c998b7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 24 Apr 2024 14:10:42 +0000 Subject: [PATCH 5/9] chore(release): 0.45.2 [skip ci] ## [0.45.2](https://github.com/juspay/hyperswitch-web/compare/v0.45.1...v0.45.2) (2024-04-24) ### Bug Fixes * added breakpoints to debug ([1f754b6](https://github.com/juspay/hyperswitch-web/commit/1f754b6f4023709752ef892c0e2861d34aa4f2fe)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c01f3b2..bd73e3637 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.45.2](https://github.com/juspay/hyperswitch-web/compare/v0.45.1...v0.45.2) (2024-04-24) + + +### Bug Fixes + +* added breakpoints to debug ([1f754b6](https://github.com/juspay/hyperswitch-web/commit/1f754b6f4023709752ef892c0e2861d34aa4f2fe)) + ## [0.45.1](https://github.com/juspay/hyperswitch-web/compare/v0.45.0...v0.45.1) (2024-04-24) diff --git a/package-lock.json b/package-lock.json index 198b7af94..bbb44dd3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.45.1", + "version": "0.45.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.45.1", + "version": "0.45.2", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 88b168e81..da65d966d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.45.1", + "version": "0.45.2", "main": "index.js", "private": true, "dependencies": { From 5ff752d0fbb5175edc53ca6bf3c263b5e4a48b20 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 2 May 2024 16:25:37 +0530 Subject: [PATCH 6/9] fix: comments addressed --- src/CardTheme.res | 4 +--- src/Components/DropdownField.res | 5 ++--- src/Components/DynamicFields.res | 7 +++++-- src/Components/PaymentDropDownField.res | 5 ++--- src/Components/PaymentField.res | 5 ++--- src/Components/PaymentInputField.res | 5 ++--- src/Payments/CardPayment.res | 8 ++++---- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/CardTheme.res b/src/CardTheme.res index 3ae6eb87d..a1f209ea1 100644 --- a/src/CardTheme.res +++ b/src/CardTheme.res @@ -24,9 +24,7 @@ let getTheme = (val, logger) => { let getInnerLayout = str => { switch str { | "compressed" => Compressed - | "spaced" - | _ => - Spaced + | _ => Spaced } } diff --git a/src/Components/DropdownField.res b/src/Components/DropdownField.res index 3e3c5ae5b..539063a3a 100644 --- a/src/Components/DropdownField.res +++ b/src/Components/DropdownField.res @@ -43,6 +43,7 @@ let make = ( } let floatinglabelClass = inputFocused ? "Label--floating" : "Label--resting" + let inputClassStyles = isSpacedInnerLayout ? "Input" : "Input-Compressed" let cursorClass = !disabled ? "cursor-pointer" : "cursor-not-allowed" Array.length > 0}> @@ -78,9 +79,7 @@ let make = ( disabled={readOnly || disabled} onChange=handleChange onFocus=handleFocus - className={`${isSpacedInnerLayout - ? "Input" - : "Input-Compressed"} ${className} w-full appearance-none outline-none ${cursorClass}`}> + className={`${inputClassStyles} ${className} w-full appearance-none outline-none ${cursorClass}`}> {options ->Array.mapWithIndex((item: string, i) => { diff --git a/src/Components/DynamicFields.res b/src/Components/DynamicFields.res index fcb535729..542af12a2 100644 --- a/src/Components/DynamicFields.res +++ b/src/Components/DynamicFields.res @@ -315,6 +315,9 @@ let make = ( dynamicFieldsToRenderInsideBilling->Array.length > 0 && (dynamicFieldsToRenderInsideBilling->Array.length > 1 || !isOnlyInfoElementPresent) + let spacedStylesForBiilingDetails = isSpacedInnerLayout ? "p-2" : "my-2" + let spacedStylesForCity = isSpacedInnerLayout ? "p-2" : "" + Array.length > 0}> {<> {dynamicFieldsToRenderOutsideBilling @@ -475,7 +478,7 @@ let make = ( ->React.array}
{dynamicFieldsToRenderInsideBilling diff --git a/src/Components/PaymentDropDownField.res b/src/Components/PaymentDropDownField.res index fd1b71b33..d1ef77594 100644 --- a/src/Components/PaymentDropDownField.res +++ b/src/Components/PaymentDropDownField.res @@ -59,6 +59,7 @@ let make = ( let labelClass = getClassName("Label") let inputClass = getClassName("Input") + let inputClassStyles = isSpacedInnerLayout ? "Input" : "Input-Compressed" let handleChange = ev => { let target = ev->ReactEvent.Form.target @@ -106,9 +107,7 @@ let make = ( disabled={readOnly || disabled} onFocus={handleFocus} onChange=handleChange - className={`${isSpacedInnerLayout - ? "Input" - : "Input-Compressed"} ${inputClass} ${className} w-full appearance-none outline-none ${cursorClass}`}> + className={`${inputClassStyles} ${inputClass} ${className} w-full appearance-none outline-none ${cursorClass}`}> {options ->Array.mapWithIndex((item: string, i) => { diff --git a/src/Components/PaymentField.res b/src/Components/PaymentField.res index 348b67921..cdd8d4e27 100644 --- a/src/Components/PaymentField.res +++ b/src/Components/PaymentField.res @@ -76,6 +76,7 @@ let make = ( } let labelClass = getClassName("Label") let inputClass = getClassName("Input") + let inputClassStyles = isSpacedInnerLayout ? "Input" : "Input-Compressed"
String.length > 0 ? "!border-l-0" : "" +
String.length > 0 - ? "!border-l-0" - : ""}`} + className={`tracking-widest w-full ${compressedLayoutStyleForCvcError}`} maxLength=4 inputRef=cvcRef placeholder="123" From 4c549dc33ccdd6a7473bd42530cf0650310076aa Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 2 May 2024 16:34:05 +0530 Subject: [PATCH 7/9] feat: locale string added for card information --- src/LocaleStrings/ArabicLocale.res | 1 + src/LocaleStrings/CatalanLocale.res | 1 + src/LocaleStrings/DeutschLocale.res | 1 + src/LocaleStrings/DutchLocale.res | 1 + src/LocaleStrings/EnglishGBLocale.res | 1 + src/LocaleStrings/EnglishLocale.res | 1 + src/LocaleStrings/FrenchBelgiumLocale.res | 1 + src/LocaleStrings/FrenchLocale.res | 1 + src/LocaleStrings/HebrewLocale.res | 1 + src/LocaleStrings/ItalianLocale.res | 1 + src/LocaleStrings/JapaneseLocale.res | 1 + src/LocaleStrings/LocaleStringTypes.res | 1 + src/LocaleStrings/PolishLocale.res | 1 + src/LocaleStrings/PortugueseLocale.res | 1 + src/LocaleStrings/RussianLocale.res | 1 + src/LocaleStrings/SpanishLocale.res | 1 + src/LocaleStrings/SwedishLocale.res | 1 + src/Payments/CardPayment.res | 2 +- 18 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/LocaleStrings/ArabicLocale.res b/src/LocaleStrings/ArabicLocale.res index e63cc984b..0c624bc66 100644 --- a/src/LocaleStrings/ArabicLocale.res +++ b/src/LocaleStrings/ArabicLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `استخدم طرق الدفع المحفوظة`, cardNickname: `الاسم علي الكارت`, nicknamePlaceholder: `اسم البطاقة (اختياري)`, + cardHeader: `معلومات البطاقة`, } diff --git a/src/LocaleStrings/CatalanLocale.res b/src/LocaleStrings/CatalanLocale.res index 2b2ed500e..511268989 100644 --- a/src/LocaleStrings/CatalanLocale.res +++ b/src/LocaleStrings/CatalanLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Utilitzeu formes de pagament desades`, nicknamePlaceholder: `Àlies de la targeta (opcional)`, selectPaymentMethodText: `Seleccioneu una forma de pagament i torneu-ho a provar`, + cardHeader: `Informació de la targeta`, } diff --git a/src/LocaleStrings/DeutschLocale.res b/src/LocaleStrings/DeutschLocale.res index e2735a4db..f5cc586ed 100644 --- a/src/LocaleStrings/DeutschLocale.res +++ b/src/LocaleStrings/DeutschLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Gespeicherte Zahlungsarten nutzen`, cardNickname: `Spitzname der Karte`, nicknamePlaceholder: `Kartenname (optional)`, + cardHeader: `Kartendaten`, } diff --git a/src/LocaleStrings/DutchLocale.res b/src/LocaleStrings/DutchLocale.res index 774f82a09..c977d2d46 100644 --- a/src/LocaleStrings/DutchLocale.res +++ b/src/LocaleStrings/DutchLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Gebruik opgeslagen betaalmethoden`, nicknamePlaceholder: `Bijnaam kaart (optioneel)`, selectPaymentMethodText: `Selecteer een betaalmethode en probeer het opnieuw`, + cardHeader: `Kaartinformatie`, } diff --git a/src/LocaleStrings/EnglishGBLocale.res b/src/LocaleStrings/EnglishGBLocale.res index e3f70a4cc..281bdba9d 100644 --- a/src/LocaleStrings/EnglishGBLocale.res +++ b/src/LocaleStrings/EnglishGBLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: "Use saved payment methods", cardNickname: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", + cardHeader: `Card information`, } diff --git a/src/LocaleStrings/EnglishLocale.res b/src/LocaleStrings/EnglishLocale.res index 05a1cda57..0e1a16d70 100644 --- a/src/LocaleStrings/EnglishLocale.res +++ b/src/LocaleStrings/EnglishLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: "Use saved payment methods", cardNickname: "Card Nickname", nicknamePlaceholder: "Card Nickname (Optional)", + cardHeader: `Card information`, } diff --git a/src/LocaleStrings/FrenchBelgiumLocale.res b/src/LocaleStrings/FrenchBelgiumLocale.res index 4051a95d4..c50a9c700 100644 --- a/src/LocaleStrings/FrenchBelgiumLocale.res +++ b/src/LocaleStrings/FrenchBelgiumLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { 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`, + cardHeader: `Informations de carte`, } diff --git a/src/LocaleStrings/FrenchLocale.res b/src/LocaleStrings/FrenchLocale.res index 289b028aa..1dc70825a 100644 --- a/src/LocaleStrings/FrenchLocale.res +++ b/src/LocaleStrings/FrenchLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Utiliser les modes de paiement enregistrés`, cardNickname: `Pseudonyme de la carte`, nicknamePlaceholder: `Surnom de la carte (facultatif)`, + cardHeader: `Informations de carte`, } diff --git a/src/LocaleStrings/HebrewLocale.res b/src/LocaleStrings/HebrewLocale.res index c8216e8f7..ef617cf7b 100644 --- a/src/LocaleStrings/HebrewLocale.res +++ b/src/LocaleStrings/HebrewLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `השתמש באמצעי תשלום שמורים`, cardNickname: `כינוי לכרטיס`, nicknamePlaceholder: `כינוי לכרטיס (אופציונלי)`, + cardHeader: `מידע כרטיס`, } diff --git a/src/LocaleStrings/ItalianLocale.res b/src/LocaleStrings/ItalianLocale.res index e15d3b905..9ab4f09a6 100644 --- a/src/LocaleStrings/ItalianLocale.res +++ b/src/LocaleStrings/ItalianLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Utilizza i metodi di pagamento salvati`, nicknamePlaceholder: `Soprannome della carta (facoltativo)`, selectPaymentMethodText: `Seleziona un metodo di pagamento e riprova`, + cardHeader: `Informazioni sulla carta`, } diff --git a/src/LocaleStrings/JapaneseLocale.res b/src/LocaleStrings/JapaneseLocale.res index 61b239dad..4bd4f756e 100644 --- a/src/LocaleStrings/JapaneseLocale.res +++ b/src/LocaleStrings/JapaneseLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `保存した支払い方法を使用する`, cardNickname: `カードのニックネーム`, nicknamePlaceholder: `カードニックネーム(任意)`, + cardHeader: `カード情報`, } diff --git a/src/LocaleStrings/LocaleStringTypes.res b/src/LocaleStrings/LocaleStringTypes.res index 884e95285..98dcfbc35 100644 --- a/src/LocaleStrings/LocaleStringTypes.res +++ b/src/LocaleStrings/LocaleStringTypes.res @@ -70,4 +70,5 @@ type localeStrings = { useExistingPaymentMethods: string, cardNickname: string, nicknamePlaceholder: string, + cardHeader: string, } diff --git a/src/LocaleStrings/PolishLocale.res b/src/LocaleStrings/PolishLocale.res index a8ebd77b5..b311101fd 100644 --- a/src/LocaleStrings/PolishLocale.res +++ b/src/LocaleStrings/PolishLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Skorzystaj z zapisanych metod płatności`, nicknamePlaceholder: `Pseudonim karty (opcjonalnie)`, selectPaymentMethodText: `Wybierz metodę płatności i spróbuj ponownie`, + cardHeader: `Informacje o karcie`, } diff --git a/src/LocaleStrings/PortugueseLocale.res b/src/LocaleStrings/PortugueseLocale.res index e1ba1d509..f9e23b7b5 100644 --- a/src/LocaleStrings/PortugueseLocale.res +++ b/src/LocaleStrings/PortugueseLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Use métodos de pagamento salvos`, nicknamePlaceholder: `Apelido do cartão (opcional)`, selectPaymentMethodText: `Selecione uma forma de pagamento e tente novamente`, + cardHeader: `Informações do cartão`, } diff --git a/src/LocaleStrings/RussianLocale.res b/src/LocaleStrings/RussianLocale.res index 3eba2661f..c420d9a65 100644 --- a/src/LocaleStrings/RussianLocale.res +++ b/src/LocaleStrings/RussianLocale.res @@ -82,4 +82,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Используйте сохраненные способы оплаты`, nicknamePlaceholder: `Псевдоним карты (необязательно)`, selectPaymentMethodText: `Пожалуйста, выберите способ оплаты и повторите попытку.`, + cardHeader: `Информация о карте`, } diff --git a/src/LocaleStrings/SpanishLocale.res b/src/LocaleStrings/SpanishLocale.res index 2bbc883c5..d4d085950 100644 --- a/src/LocaleStrings/SpanishLocale.res +++ b/src/LocaleStrings/SpanishLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { 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`, + cardHeader: `Información de la tarjeta`, } diff --git a/src/LocaleStrings/SwedishLocale.res b/src/LocaleStrings/SwedishLocale.res index 6b3b3ca12..61610ed4f 100644 --- a/src/LocaleStrings/SwedishLocale.res +++ b/src/LocaleStrings/SwedishLocale.res @@ -79,4 +79,5 @@ let localeStrings: LocaleStringTypes.localeStrings = { useExistingPaymentMethods: `Använd sparade betalningsmetoder`, nicknamePlaceholder: `Kortets smeknamn (valfritt)`, selectPaymentMethodText: `Välj en betalningsmetod och försök igen`, + cardHeader: `Kortinformation`, } diff --git a/src/Payments/CardPayment.res b/src/Payments/CardPayment.res index 2b09522c5..5fb573243 100644 --- a/src/Payments/CardPayment.res +++ b/src/Payments/CardPayment.res @@ -206,7 +206,7 @@ let make = ( ~opacity="0.6", (), )}> - {React.string("Card information")} + {React.string(localeString.cardHeader)}
From 661dac3791adc8616fb6b0d2d41c72a7bfc4c02b Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 2 May 2024 16:39:18 +0530 Subject: [PATCH 8/9] fix: unintended changes --- src/Payments/ApplePay.res | 3 +-- src/orca-loader/Elements.res | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Payments/ApplePay.res b/src/Payments/ApplePay.res index 4b19f02c9..4ff18c5e7 100644 --- a/src/Payments/ApplePay.res +++ b/src/Payments/ApplePay.res @@ -304,8 +304,7 @@ let make = ( postFailedSubmitResponse(~errortype="server_error", ~message="Something went wrong") } } else if dict->Dict.get("applePaySyncPayment")->Option.isSome { - () - // syncPayment(breakpoint) + syncPayment() } } catch { | _ => Utils.logInfo(Console.log("Error in parsing Apple Pay Data")) diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 08faea21b..5a6d6e23f 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -4,7 +4,6 @@ open Identity open Utils open EventListenerManager open ApplePayTypes -@send external alert: ('t, string) => unit = "alert" type trustPayFunctions = { finishApplePaymentV2: (string, paymentRequestData) => Promise.t, From 894905cc163b365c80cdf63c43e63cac222c082c Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 2 May 2024 16:41:22 +0530 Subject: [PATCH 9/9] fix: unintended changes --- src/Components/FullNamePaymentInput.res | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Components/FullNamePaymentInput.res b/src/Components/FullNamePaymentInput.res index d4bdba709..04ad9df4c 100644 --- a/src/Components/FullNamePaymentInput.res +++ b/src/Components/FullNamePaymentInput.res @@ -3,11 +3,7 @@ open PaymentType open Utils @react.component -let make = ( - ~paymentType: CardThemeType.mode, - ~customFieldName=None, - ~optionalRequiredFields=None, -) => { +let make = (~paymentType, ~customFieldName=None, ~optionalRequiredFields=None) => { let {localeString} = Recoil.useRecoilValueFromAtom(configAtom) let {fields} = Recoil.useRecoilValueFromAtom(optionAtom) let loggerState = Recoil.useRecoilValueFromAtom(loggerAtom)