From 0fdfacd5826cebc16bb0a807d0539c42055e30f5 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Wed, 22 May 2024 15:27:59 +0530 Subject: [PATCH 1/5] feat: isolate paymentElementCreate message (#387) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/orca-loader/Elements.res | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 2eafd6c8f..cb5caf2bd 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -1047,10 +1047,10 @@ let make = ( fetchCustomerPaymentMethods(mountedIframeRef, false, componentType) } fetchSessionTokens(mountedIframeRef) - mountedIframeRef->Window.iframePostMessage(message) resolve() }) ->ignore + mountedIframeRef->Window.iframePostMessage(message) } let paymentElement = LoaderPaymentElement.make( From 3b9efdcc57212515d5a3abcf83c0c9038cb712d7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 22 May 2024 09:59:44 +0000 Subject: [PATCH 2/5] chore(release): 0.54.0 [skip ci] # [0.54.0](https://github.com/juspay/hyperswitch-web/compare/v0.53.3...v0.54.0) (2024-05-22) ### Features * isolate paymentElementCreate message ([#387](https://github.com/juspay/hyperswitch-web/issues/387)) ([0fdfacd](https://github.com/juspay/hyperswitch-web/commit/0fdfacd5826cebc16bb0a807d0539c42055e30f5)) --- 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 7f69ad9d5..8f51232d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [0.54.0](https://github.com/juspay/hyperswitch-web/compare/v0.53.3...v0.54.0) (2024-05-22) + + +### Features + +* isolate paymentElementCreate message ([#387](https://github.com/juspay/hyperswitch-web/issues/387)) ([0fdfacd](https://github.com/juspay/hyperswitch-web/commit/0fdfacd5826cebc16bb0a807d0539c42055e30f5)) + ## [0.53.3](https://github.com/juspay/hyperswitch-web/compare/v0.53.2...v0.53.3) (2024-05-22) diff --git a/package-lock.json b/package-lock.json index a1bdc8810..5344e8da9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.53.3", + "version": "0.54.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.53.3", + "version": "0.54.0", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 9e102b5ec..448ce1689 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.53.3", + "version": "0.54.0", "main": "index.js", "private": true, "dependencies": { From 8642913f5ba4be1c441499f15da2aab64870b209 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Wed, 22 May 2024 17:31:36 +0530 Subject: [PATCH 3/5] fix: saved method checkbox condition updated (#395) --- src/Components/SavedMethods.res | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Components/SavedMethods.res b/src/Components/SavedMethods.res index ca1751825..7d8544605 100644 --- a/src/Components/SavedMethods.res +++ b/src/Components/SavedMethods.res @@ -176,8 +176,16 @@ let make = ( let conditionsForShowingSaveCardCheckbox = React.useMemo(() => { !isGuestCustomer && paymentMethodListValue.payment_type === NEW_MANDATE && - displaySavedPaymentMethodsCheckbox - }, (isGuestCustomer, paymentMethodListValue.payment_type, displaySavedPaymentMethodsCheckbox)) + displaySavedPaymentMethodsCheckbox && + savedMethods->Array.some(ele => { + ele.paymentMethod === "card" && ele.requiresCvv + }) + }, ( + isGuestCustomer, + paymentMethodListValue.payment_type, + displaySavedPaymentMethodsCheckbox, + savedMethods, + ))
{if savedCardlength === 0 && (loadSavedCards === PaymentType.LoadingSavedCards || !showFields) { From 767f2ed59abda909dc7e534a4a375b01c31e5664 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 22 May 2024 12:03:18 +0000 Subject: [PATCH 4/5] chore(release): 0.54.1 [skip ci] ## [0.54.1](https://github.com/juspay/hyperswitch-web/compare/v0.54.0...v0.54.1) (2024-05-22) ### Bug Fixes * saved method checkbox condition updated ([#395](https://github.com/juspay/hyperswitch-web/issues/395)) ([8642913](https://github.com/juspay/hyperswitch-web/commit/8642913f5ba4be1c441499f15da2aab64870b209)) --- 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 8f51232d6..30626ab6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.54.1](https://github.com/juspay/hyperswitch-web/compare/v0.54.0...v0.54.1) (2024-05-22) + + +### Bug Fixes + +* saved method checkbox condition updated ([#395](https://github.com/juspay/hyperswitch-web/issues/395)) ([8642913](https://github.com/juspay/hyperswitch-web/commit/8642913f5ba4be1c441499f15da2aab64870b209)) + # [0.54.0](https://github.com/juspay/hyperswitch-web/compare/v0.53.3...v0.54.0) (2024-05-22) diff --git a/package-lock.json b/package-lock.json index 5344e8da9..4fe18f676 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.54.0", + "version": "0.54.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.54.0", + "version": "0.54.1", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 448ce1689..1e42469b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.54.0", + "version": "0.54.1", "main": "index.js", "private": true, "dependencies": { From dd78d5611100e23025e19d1563e1ff1e5434a692 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 23 May 2024 16:27:52 +0530 Subject: [PATCH 5/5] fix: sdk button redirect issue (#398) --- src/Components/PayNowButton.res | 12 ------------ src/Utilities/PaymentBody.res | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index 27d1f743f..7d4653914 100644 --- a/src/Components/PayNowButton.res +++ b/src/Components/PayNowButton.res @@ -21,21 +21,9 @@ let make = () => { let confirmPayload = sdkHandleConfirmPayment->PaymentBody.confirmPayloadForSDKButton let buttonText = sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton) - let handleMessage = (event: Types.event) => { - let json = event.data->Identity.anyTypeToJson->getStringFromJson("")->safeParse - let dict = json->getDictFromJson - switch dict->Dict.get("submitSuccessful") { - | Some(_) => - setIsPayNowButtonDisable(_ => false) - setShowLoader(_ => false) - | None => () - } - } - let handleOnClick = _ => { setIsPayNowButtonDisable(_ => true) setShowLoader(_ => true) - EventListenerManager.addSmartEventListener("message", handleMessage, "onSubmitSuccessful") handlePostMessage([("handleSdkConfirm", confirmPayload)]) } diff --git a/src/Utilities/PaymentBody.res b/src/Utilities/PaymentBody.res index a7e3ac0ca..e81b476fa 100644 --- a/src/Utilities/PaymentBody.res +++ b/src/Utilities/PaymentBody.res @@ -162,11 +162,11 @@ let paymentTypeBody = paymentType => let confirmPayloadForSDKButton = (sdkHandleConfirmPayment: PaymentType.sdkHandleConfirmPayment) => [ - ("redirect", "always"->JSON.Encode.string), ( "confirmParams", [ ("return_url", sdkHandleConfirmPayment.confirmParams.return_url->JSON.Encode.string), + ("redirect", "always"->JSON.Encode.string), // *As in the case of SDK Button we are not returning the promise back so it will always redirect ]->Utils.getJsonFromArrayOfJson, ), ]->Utils.getJsonFromArrayOfJson