From 0d01ff290e0d22e17bf294d939d500c6c9a927a5 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Mon, 24 Jun 2024 16:03:32 +0530 Subject: [PATCH 01/12] fix: package update --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 731bf62ef..ed1631177 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.69.0", + "version": "0.70.2", "main": "index.js", "private": true, "dependencies": { From 195c474c77537f8741ff28cafc85a66b04091ef5 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 24 Jun 2024 10:35:29 +0000 Subject: [PATCH 02/12] chore(release): 0.70.2 [skip ci] ## [0.70.2](https://github.com/juspay/hyperswitch-web/compare/v0.70.1...v0.70.2) (2024-06-24) ### Bug Fixes * package update ([0d01ff2](https://github.com/juspay/hyperswitch-web/commit/0d01ff290e0d22e17bf294d939d500c6c9a927a5)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554c76ec8..ce9346d49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.70.2](https://github.com/juspay/hyperswitch-web/compare/v0.70.1...v0.70.2) (2024-06-24) + + +### Bug Fixes + +* package update ([0d01ff2](https://github.com/juspay/hyperswitch-web/commit/0d01ff290e0d22e17bf294d939d500c6c9a927a5)) + # [0.69.0](https://github.com/juspay/hyperswitch-web/compare/v0.68.0...v0.69.0) (2024-06-20) diff --git a/package-lock.json b/package-lock.json index 7f0017ce1..96cea8193 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.69.0", + "version": "0.70.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.69.0", + "version": "0.70.2", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", From bce8bea6045acbae2df1016b93623709715a8277 Mon Sep 17 00:00:00 2001 From: ArushKapoorJuspay <121166031+ArushKapoorJuspay@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:02:44 +0530 Subject: [PATCH 03/12] fix: fixed Saved Methods ApplePay and GooglePay Handler (#455) --- src/Components/SavedMethods.res | 99 +++++++++++++----------------- src/PaymentElement.res | 26 +++++++- src/Utilities/ApplePayHelpers.res | 4 ++ src/Utilities/GooglePayHelpers.res | 5 +- src/Utilities/PaymentHelpers.res | 2 +- 5 files changed, 76 insertions(+), 60 deletions(-) diff --git a/src/Components/SavedMethods.res b/src/Components/SavedMethods.res index ab0ff5f3c..817482fa9 100644 --- a/src/Components/SavedMethods.res +++ b/src/Components/SavedMethods.res @@ -33,8 +33,10 @@ let make = ( let dict = sessions->Utils.getDictFromJson let sessionObj = React.useMemo(() => SessionsType.itemToObjMapper(dict, Others), [dict]) - let isApplePayReady = Recoil.useRecoilValueFromAtom(RecoilAtoms.isApplePayReady) - let isGPayReady = Recoil.useRecoilValueFromAtom(RecoilAtoms.isGooglePayReady) + let gPayToken = SessionsType.getPaymentSessionObj(sessionObj.sessionsToken, Gpay) + + let applePaySessionObj = SessionsType.itemToObjMapper(dict, ApplePayObject) + let applePayToken = SessionsType.getPaymentSessionObj(applePaySessionObj.sessionsToken, ApplePay) let intent = PaymentHelpers.usePaymentIntent(Some(loggerState), Card) let savedCardlength = savedMethods->Array.length @@ -59,13 +61,6 @@ let make = ( let bottomElement = { savedMethods - ->Array.filter(savedMethod => { - switch savedMethod.paymentMethodType { - | Some("apple_pay") => isApplePayReady - | Some("google_pay") => isGPayReady - | _ => true - } - }) ->Array.mapWithIndex((obj, i) => { let brandIcon = switch obj.paymentMethod { | "wallet" => getWalletBrandIcon(obj) @@ -121,9 +116,9 @@ let make = ( useHandlePostMessages(~complete, ~empty, ~paymentType, ~savedMethod=true) - GooglePayHelpers.useHandleGooglePayResponse(~connectors=[], ~intent) + GooglePayHelpers.useHandleGooglePayResponse(~connectors=[], ~intent, ~isSavedMethodsFlow=true) - ApplePayHelpers.useHandleApplePayResponse(~connectors=[], ~intent) + ApplePayHelpers.useHandleApplePayResponse(~connectors=[], ~intent, ~isSavedMethodsFlow=true) let submitCallback = React.useCallback((ev: Window.event) => { let json = ev.data->JSON.parseExn @@ -162,52 +157,44 @@ let make = ( confirm.confirmTimestamp >= confirm.readyTimestamp ) { switch customerMethod.paymentMethodType { - | Some("google_pay") => { - let gPayToken = SessionsType.getPaymentSessionObj(sessionObj.sessionsToken, Gpay) - switch gPayToken { - | OtherTokenOptional(optToken) => - GooglePayHelpers.handleGooglePayClicked( - ~sessionObj=optToken, - ~componentName, - ~iframeId, - ~readOnly, - ) - | _ => - // TODO - To be replaced with proper error message - intent( - ~bodyArr=savedPaymentMethodBody - ->getJsonFromArrayOfJson - ->flattenObject(true) - ->mergeTwoFlattenedJsonDicts(requiredFieldsBody) - ->getArrayOfTupleFromDict, - ~confirmParam=confirm.confirmParams, - ~handleUserError=false, - (), - ) - } + | Some("google_pay") => + switch gPayToken { + | OtherTokenOptional(optToken) => + GooglePayHelpers.handleGooglePayClicked( + ~sessionObj=optToken, + ~componentName, + ~iframeId, + ~readOnly, + ) + | _ => + // TODO - To be replaced with proper error message + intent( + ~bodyArr=savedPaymentMethodBody + ->getJsonFromArrayOfJson + ->flattenObject(true) + ->mergeTwoFlattenedJsonDicts(requiredFieldsBody) + ->getArrayOfTupleFromDict, + ~confirmParam=confirm.confirmParams, + ~handleUserError=false, + (), + ) } - | Some("apple_pay") => { - let applePaySessionObj = SessionsType.itemToObjMapper(dict, ApplePayObject) - let applePayToken = SessionsType.getPaymentSessionObj( - applePaySessionObj.sessionsToken, - ApplePay, + | Some("apple_pay") => + switch applePayToken { + | ApplePayTokenOptional(optToken) => + ApplePayHelpers.handleApplePayButtonClicked(~sessionObj=optToken, ~componentName) + | _ => + // TODO - To be replaced with proper error message + intent( + ~bodyArr=savedPaymentMethodBody + ->getJsonFromArrayOfJson + ->flattenObject(true) + ->mergeTwoFlattenedJsonDicts(requiredFieldsBody) + ->getArrayOfTupleFromDict, + ~confirmParam=confirm.confirmParams, + ~handleUserError=false, + (), ) - switch applePayToken { - | ApplePayTokenOptional(optToken) => - ApplePayHelpers.handleApplePayButtonClicked(~sessionObj=optToken, ~componentName) - | _ => - // TODO - To be replaced with proper error message - intent( - ~bodyArr=savedPaymentMethodBody - ->getJsonFromArrayOfJson - ->flattenObject(true) - ->mergeTwoFlattenedJsonDicts(requiredFieldsBody) - ->getArrayOfTupleFromDict, - ~confirmParam=confirm.confirmParams, - ~handleUserError=false, - (), - ) - } } | _ => intent( @@ -244,6 +231,8 @@ let make = ( complete, customerMethod, isCustomerAcceptanceRequired, + applePayToken, + gPayToken, )) useSubmitPaymentData(submitCallback) diff --git a/src/PaymentElement.res b/src/PaymentElement.res index 648932116..f46bed6b4 100644 --- a/src/PaymentElement.res +++ b/src/PaymentElement.res @@ -26,6 +26,9 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod let (walletOptions, setWalletOptions) = React.useState(_ => []) let {sdkHandleConfirmPayment} = Recoil.useRecoilValueFromAtom(optionAtom) + let isApplePayReady = Recoil.useRecoilValueFromAtom(RecoilAtoms.isApplePayReady) + let isGPayReady = Recoil.useRecoilValueFromAtom(RecoilAtoms.isGooglePayReady) + let (paymentMethodListValue, setPaymentMethodListValue) = Recoil.useRecoilState( PaymentUtils.paymentMethodListValue, ) @@ -72,7 +75,16 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod } } - let finalSavedPaymentMethods = savedPaymentMethods->Array.copy + let finalSavedPaymentMethods = + savedPaymentMethods + ->Array.copy + ->Array.filter(savedMethod => { + switch savedMethod.paymentMethodType { + | Some("apple_pay") => isApplePayReady + | Some("google_pay") => isGPayReady + | _ => true + } + }) finalSavedPaymentMethods->Array.sort(sortSavedPaymentMethods) let paymentOrder = paymentMethodOrder->getOptionalArr->removeDuplicate @@ -98,7 +110,13 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod } None - }, (customerPaymentMethods, displaySavedPaymentMethods, optionAtomValue)) + }, ( + customerPaymentMethods, + displaySavedPaymentMethods, + optionAtomValue, + isApplePayReady, + isGPayReady, + )) React.useEffect(() => { let defaultSelectedPaymentMethod = optionAtomValue.displayDefaultSavedPaymentIcon @@ -344,7 +362,9 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod - + Array.length > 0 || walletOptions->Array.length > 0) && diff --git a/src/Utilities/ApplePayHelpers.res b/src/Utilities/ApplePayHelpers.res index 24f482439..e3a0dc0b7 100644 --- a/src/Utilities/ApplePayHelpers.res +++ b/src/Utilities/ApplePayHelpers.res @@ -138,6 +138,7 @@ let useHandleApplePayResponse = ( ~setApplePayClicked=_ => (), ~syncPayment=() => (), ~isInvokeSDKFlow=true, + ~isSavedMethodsFlow=false, ) => { let options = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom) let {publishableKey} = Recoil.useRecoilValueFromAtom(RecoilAtoms.keys) @@ -191,6 +192,9 @@ let useHandleApplePayResponse = ( ) } else if dict->Dict.get("showApplePayButton")->Option.isSome { setApplePayClicked(_ => false) + if isSavedMethodsFlow { + postFailedSubmitResponse(~errortype="server_error", ~message="Something went wrong") + } } else if dict->Dict.get("applePaySyncPayment")->Option.isSome { syncPayment() } diff --git a/src/Utilities/GooglePayHelpers.res b/src/Utilities/GooglePayHelpers.res index 64b3c24da..b2519d690 100644 --- a/src/Utilities/GooglePayHelpers.res +++ b/src/Utilities/GooglePayHelpers.res @@ -78,7 +78,7 @@ let processPayment = ( ) } -let useHandleGooglePayResponse = (~connectors, ~intent) => { +let useHandleGooglePayResponse = (~connectors, ~intent, ~isSavedMethodsFlow=false) => { let options = Recoil.useRecoilValueFromAtom(RecoilAtoms.optionAtom) let {publishableKey} = Recoil.useRecoilValueFromAtom(RecoilAtoms.keys) @@ -123,6 +123,9 @@ let useHandleGooglePayResponse = (~connectors, ~intent) => { } if dict->Dict.get("gpayError")->Option.isSome { handlePostMessage([("fullscreen", false->JSON.Encode.bool)]) + if isSavedMethodsFlow { + postFailedSubmitResponse(~errortype="server_error", ~message="Something went wrong") + } } } Window.addEventListener("message", handle) diff --git a/src/Utilities/PaymentHelpers.res b/src/Utilities/PaymentHelpers.res index eb733e8e9..5ad72f5d2 100644 --- a/src/Utilities/PaymentHelpers.res +++ b/src/Utilities/PaymentHelpers.res @@ -558,6 +558,7 @@ let rec intentCall = ( | (Applepay, false) | (Paypal, false) => if !isPaymentSession { + closePaymentLoaderIfAny() postSubmitResponse(~jsonData=data, ~url=url.href) } else if confirmParam.redirect === Some("always") { handleOpenUrl(url.href) @@ -1560,4 +1561,3 @@ let paymentIntentForPaymentSession = ( (), ) } - From 33474fc7da13bf0c1bc5dd4f95fbc0c6b54e4ccc Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 24 Jun 2024 13:34:16 +0000 Subject: [PATCH 04/12] chore(release): 0.70.3 [skip ci] ## [0.70.3](https://github.com/juspay/hyperswitch-web/compare/v0.70.2...v0.70.3) (2024-06-24) ### Bug Fixes * fixed Saved Methods ApplePay and GooglePay Handler ([#455](https://github.com/juspay/hyperswitch-web/issues/455)) ([bce8bea](https://github.com/juspay/hyperswitch-web/commit/bce8bea6045acbae2df1016b93623709715a8277)) --- 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 ce9346d49..54c2cfd92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.70.3](https://github.com/juspay/hyperswitch-web/compare/v0.70.2...v0.70.3) (2024-06-24) + + +### Bug Fixes + +* fixed Saved Methods ApplePay and GooglePay Handler ([#455](https://github.com/juspay/hyperswitch-web/issues/455)) ([bce8bea](https://github.com/juspay/hyperswitch-web/commit/bce8bea6045acbae2df1016b93623709715a8277)) + ## [0.70.2](https://github.com/juspay/hyperswitch-web/compare/v0.70.1...v0.70.2) (2024-06-24) diff --git a/package-lock.json b/package-lock.json index 96cea8193..8442a8446 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.70.2", + "version": "0.70.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.70.2", + "version": "0.70.3", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index ed1631177..dc4110e8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.70.2", + "version": "0.70.3", "main": "index.js", "private": true, "dependencies": { From a680e71a73a31eef89d66fd1d35666da53294a51 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:54:12 +0530 Subject: [PATCH 05/12] =?UTF-8?q?fix:=20handle=20requires=5Fcustomer=5Fact?= =?UTF-8?q?ion=20and=20processing=20status=20for=20pix=20pa=E2=80=A6=20(#4?= =?UTF-8?q?56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Payments/QRCodeDisplay.res | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Payments/QRCodeDisplay.res b/src/Payments/QRCodeDisplay.res index 8dd6eb9fc..c91ddd1b0 100644 --- a/src/Payments/QRCodeDisplay.res +++ b/src/Payments/QRCodeDisplay.res @@ -94,7 +94,9 @@ let make = () => { let dict = json->JSON.Decode.object->Option.getOr(Dict.make()) let status = dict->getString("status", "") - if status === "succeeded" { + if ( + status === "succeeded" || status === "requires_customer_action" || status === "processing" + ) { postSubmitResponse(~jsonData=json, ~url=return_url) } else if status === "failed" { postFailedSubmitResponse( From dc9b9db96f91f889526df0d9414f2caa33694b64 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 25 Jun 2024 10:25:48 +0000 Subject: [PATCH 06/12] chore(release): 0.70.4 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [0.70.4](https://github.com/juspay/hyperswitch-web/compare/v0.70.3...v0.70.4) (2024-06-25) ### Bug Fixes * handle requires_customer_action and processing status for pix pa… ([#456](https://github.com/juspay/hyperswitch-web/issues/456)) ([a680e71](https://github.com/juspay/hyperswitch-web/commit/a680e71a73a31eef89d66fd1d35666da53294a51)) --- 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 54c2cfd92..bc408f009 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.70.4](https://github.com/juspay/hyperswitch-web/compare/v0.70.3...v0.70.4) (2024-06-25) + + +### Bug Fixes + +* handle requires_customer_action and processing status for pix pa… ([#456](https://github.com/juspay/hyperswitch-web/issues/456)) ([a680e71](https://github.com/juspay/hyperswitch-web/commit/a680e71a73a31eef89d66fd1d35666da53294a51)) + ## [0.70.3](https://github.com/juspay/hyperswitch-web/compare/v0.70.2...v0.70.3) (2024-06-24) diff --git a/package-lock.json b/package-lock.json index 8442a8446..2ca7a7fc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.70.3", + "version": "0.70.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.70.3", + "version": "0.70.4", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index dc4110e8a..1dda1f460 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.70.3", + "version": "0.70.4", "main": "index.js", "private": true, "dependencies": { From a4b653b79b0056bfc1966f6dcab5a02c272c2c47 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Tue, 25 Jun 2024 16:09:49 +0530 Subject: [PATCH 07/12] fix: headers update & warnings removed (#457) Co-authored-by: Arush --- src/Payments/GPay.res | 2 -- src/Utilities/Utils.res | 4 +++- src/orca-loader/PaymentSessionMethods.res | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Payments/GPay.res b/src/Payments/GPay.res index cd33c5557..6a1671a0f 100644 --- a/src/Payments/GPay.res +++ b/src/Payments/GPay.res @@ -27,8 +27,6 @@ let make = (~sessionObj: option, ~thirdPartySessionObj: opti let areOneClickWalletsRendered = Recoil.useSetRecoilState(RecoilAtoms.areOneClickWalletsRendered) - let isGuestCustomer = UtilityHooks.useIsGuestCustomer() - let googlePayPaymentMethodType = switch PaymentMethodsRecord.getPaymentMethodTypeFromList( ~paymentMethodListValue, ~paymentMethod="wallet", diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index be60d6c42..d2d12541f 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -804,6 +804,9 @@ let getHeaders = (~uri=?, ~token=?, ~headers=Dict.make(), ()) => { ("Content-Type", "application/json"), ("X-Client-Version", Window.version), ("X-Payment-Confirm-Source", "sdk"), + ("X-Browser-Name", OrcaLogger.arrayOfNameAndVersion->Array.get(0)->Option.getOr("Others")), + ("X-Browser-Version", OrcaLogger.arrayOfNameAndVersion->Array.get(1)->Option.getOr("0")), + ("X-Client-Platform", "web"), ]->Dict.fromArray switch (token, uri) { @@ -1328,4 +1331,3 @@ let handleFailureResponse = (~message, ~errorType) => ]->getJsonFromArrayOfJson, ), ]->getJsonFromArrayOfJson - diff --git a/src/orca-loader/PaymentSessionMethods.res b/src/orca-loader/PaymentSessionMethods.res index 828484ba6..fda18eaec 100644 --- a/src/orca-loader/PaymentSessionMethods.res +++ b/src/orca-loader/PaymentSessionMethods.res @@ -168,7 +168,12 @@ let getCustomerSavedPaymentMethods = ( PaymentUtils.getStateJson() ->then(stateJson => { - logger.setLogInfo(~value="States Loaded", ~eventName=APPLE_PAY_FLOW, ~paymentMethod="APPLE_PAY", ()) + logger.setLogInfo( + ~value="States Loaded", + ~eventName=APPLE_PAY_FLOW, + ~paymentMethod="APPLE_PAY", + (), + ) stateJson->completeApplePayPayment }) ->catch(err => { @@ -226,7 +231,12 @@ let getCustomerSavedPaymentMethods = ( PaymentUtils.getStateJson() ->then( stateJson => { - logger.setLogInfo(~value="States Loaded", ~eventName=GOOGLE_PAY_FLOW, ~paymentMethod="GOOGLE_PAY", ()) + logger.setLogInfo( + ~value="States Loaded", + ~eventName=GOOGLE_PAY_FLOW, + ~paymentMethod="GOOGLE_PAY", + (), + ) stateJson->completeGooglePayPayment }, ) @@ -423,7 +433,7 @@ let getCustomerSavedPaymentMethods = ( ->Identity.anyTypeToJson ->resolve }) - ->catch(err => { + ->catch(_ => { updateCustomerPaymentMethodsRef(~isFilterApplePay=true, ~isFilterGooglePay=true) { From f6ed1b5d1cb96374ccf45227dbe4f8d8bd002ee4 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 25 Jun 2024 10:43:57 +0000 Subject: [PATCH 08/12] chore(release): 0.70.5 [skip ci] ## [0.70.5](https://github.com/juspay/hyperswitch-web/compare/v0.70.4...v0.70.5) (2024-06-25) ### Bug Fixes * headers update & warnings removed ([#457](https://github.com/juspay/hyperswitch-web/issues/457)) ([a4b653b](https://github.com/juspay/hyperswitch-web/commit/a4b653b79b0056bfc1966f6dcab5a02c272c2c47)) --- 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 bc408f009..b82a0070f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.70.5](https://github.com/juspay/hyperswitch-web/compare/v0.70.4...v0.70.5) (2024-06-25) + + +### Bug Fixes + +* headers update & warnings removed ([#457](https://github.com/juspay/hyperswitch-web/issues/457)) ([a4b653b](https://github.com/juspay/hyperswitch-web/commit/a4b653b79b0056bfc1966f6dcab5a02c272c2c47)) + ## [0.70.4](https://github.com/juspay/hyperswitch-web/compare/v0.70.3...v0.70.4) (2024-06-25) diff --git a/package-lock.json b/package-lock.json index 2ca7a7fc5..dc1a55741 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.70.4", + "version": "0.70.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.70.4", + "version": "0.70.5", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 1dda1f460..b27776fac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.70.4", + "version": "0.70.5", "main": "index.js", "private": true, "dependencies": { From a1c75fbaea004b2abd274544b90e40a9b1a74cea Mon Sep 17 00:00:00 2001 From: ArushKapoorJuspay <121166031+ArushKapoorJuspay@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:26:39 +0530 Subject: [PATCH 09/12] fix: fixed handling of empty string in requiredString and warningString (#450) Co-authored-by: Pritish Budhiraja --- src/Utilities/Utils.res | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index d2d12541f..252621965 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -110,14 +110,12 @@ let getDecodedBoolFromJson = (json, callbackFunc, defaultValue) => { let getRequiredString = (dict, key, default, ~logger) => { let optionalStr = getOptionString(dict, key) switch optionalStr { - | Some(val) => { - val == "" ? manageErrorWarning(REQUIRED_PARAMETER, ~dynamicStr=key, ~logger, ()) : () - val - } - | None => { + | None + | Some("") => { manageErrorWarning(REQUIRED_PARAMETER, ~dynamicStr=key, ~logger, ()) optionalStr->Option.getOr(default) } + | Some(val) => val } } @@ -125,10 +123,11 @@ let getWarningString = (dict, key, default, ~logger) => { switch dict->Dict.get(key) { | Some(val) => switch val->JSON.Decode.string { - | Some(val) => val - | None => + | None + | Some("") => manageErrorWarning(TYPE_STRING_ERROR, ~dynamicStr=key, ~logger, ()) default + | Some(val) => val } | None => default } From 6fbc57b1097fe40baf6c551d656e3ec417ceb62c Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 25 Jun 2024 10:58:16 +0000 Subject: [PATCH 10/12] chore(release): 0.70.6 [skip ci] ## [0.70.6](https://github.com/juspay/hyperswitch-web/compare/v0.70.5...v0.70.6) (2024-06-25) ### Bug Fixes * fixed handling of empty string in requiredString and warningString ([#450](https://github.com/juspay/hyperswitch-web/issues/450)) ([a1c75fb](https://github.com/juspay/hyperswitch-web/commit/a1c75fbaea004b2abd274544b90e40a9b1a74cea)) --- 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 b82a0070f..8d20c3754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.70.6](https://github.com/juspay/hyperswitch-web/compare/v0.70.5...v0.70.6) (2024-06-25) + + +### Bug Fixes + +* fixed handling of empty string in requiredString and warningString ([#450](https://github.com/juspay/hyperswitch-web/issues/450)) ([a1c75fb](https://github.com/juspay/hyperswitch-web/commit/a1c75fbaea004b2abd274544b90e40a9b1a74cea)) + ## [0.70.5](https://github.com/juspay/hyperswitch-web/compare/v0.70.4...v0.70.5) (2024-06-25) diff --git a/package-lock.json b/package-lock.json index dc1a55741..44ed3933e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.70.5", + "version": "0.70.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.70.5", + "version": "0.70.6", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index b27776fac..6a480f08a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.70.5", + "version": "0.70.6", "main": "index.js", "private": true, "dependencies": { From 1bcd585f09f9eb5c151614e29827127d4d6dc4e0 Mon Sep 17 00:00:00 2001 From: ArushKapoorJuspay <121166031+ArushKapoorJuspay@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:14:05 +0530 Subject: [PATCH 11/12] fix: google Pay Fix (#458) Co-authored-by: Pritish Budhiraja --- src/orca-loader/PaymentSessionMethods.res | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/orca-loader/PaymentSessionMethods.res b/src/orca-loader/PaymentSessionMethods.res index fda18eaec..a0e920454 100644 --- a/src/orca-loader/PaymentSessionMethods.res +++ b/src/orca-loader/PaymentSessionMethods.res @@ -12,12 +12,6 @@ let getCustomerSavedPaymentMethods = ( open GooglePayType let applePaySessionRef = ref(Nullable.null) - let gPayClient = google( - { - "environment": publishableKey->String.startsWith("pk_prd_") ? "PRODUCTION" : "TEST", - }->Identity.anyTypeToJson, - ) - PaymentHelpers.fetchCustomerPaymentMethodList( ~clientSecret, ~publishableKey, @@ -27,6 +21,12 @@ let getCustomerSavedPaymentMethods = ( ~isPaymentSession=true, ) ->then(customerDetails => { + let gPayClient = google( + { + "environment": publishableKey->String.startsWith("pk_prd_") ? "PRODUCTION" : "TEST", + }->Identity.anyTypeToJson, + ) + let customerDetailsDict = customerDetails->JSON.Decode.object->Option.getOr(Dict.make()) let (customerPaymentMethods, isGuestCustomer) = customerDetailsDict->PaymentType.itemToCustomerObjMapper From dd1f095608b9d0e8ca68c3c69b05af22d2ef4cfd Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 25 Jun 2024 11:45:39 +0000 Subject: [PATCH 12/12] chore(release): 0.70.7 [skip ci] ## [0.70.7](https://github.com/juspay/hyperswitch-web/compare/v0.70.6...v0.70.7) (2024-06-25) ### Bug Fixes * google Pay Fix ([#458](https://github.com/juspay/hyperswitch-web/issues/458)) ([1bcd585](https://github.com/juspay/hyperswitch-web/commit/1bcd585f09f9eb5c151614e29827127d4d6dc4e0)) --- 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 8d20c3754..83947fb0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.70.7](https://github.com/juspay/hyperswitch-web/compare/v0.70.6...v0.70.7) (2024-06-25) + + +### Bug Fixes + +* google Pay Fix ([#458](https://github.com/juspay/hyperswitch-web/issues/458)) ([1bcd585](https://github.com/juspay/hyperswitch-web/commit/1bcd585f09f9eb5c151614e29827127d4d6dc4e0)) + ## [0.70.6](https://github.com/juspay/hyperswitch-web/compare/v0.70.5...v0.70.6) (2024-06-25) diff --git a/package-lock.json b/package-lock.json index 44ed3933e..a6a9a53e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.70.6", + "version": "0.70.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.70.6", + "version": "0.70.7", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 6a480f08a..ff7368c6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.70.6", + "version": "0.70.7", "main": "index.js", "private": true, "dependencies": {