From e012642865231e6c2787b828730cfc1c41ebbe36 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Mon, 27 May 2024 14:16:01 +0530 Subject: [PATCH 1/4] fix: sdk button loader issue (#400) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/Components/PayNowButton.res | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index 7d4653914..d8795f3d6 100644 --- a/src/Components/PayNowButton.res +++ b/src/Components/PayNowButton.res @@ -21,9 +21,23 @@ 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(submitSuccessfulVal) => + if !(submitSuccessfulVal->JSON.Decode.bool->Option.getOr(false)) { + setIsPayNowButtonDisable(_ => false) + setShowLoader(_ => false) + } + | None => () + } + } + let handleOnClick = _ => { setIsPayNowButtonDisable(_ => true) setShowLoader(_ => true) + EventListenerManager.addSmartEventListener("message", handleMessage, "onSubmitSuccessful") handlePostMessage([("handleSdkConfirm", confirmPayload)]) } From a041c04c8545ce1d751c34c4689690cb96d48728 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 27 May 2024 08:47:44 +0000 Subject: [PATCH 2/4] chore(release): 0.55.1 [skip ci] ## [0.55.1](https://github.com/juspay/hyperswitch-web/compare/v0.55.0...v0.55.1) (2024-05-27) ### Bug Fixes * sdk button loader issue ([#400](https://github.com/juspay/hyperswitch-web/issues/400)) ([e012642](https://github.com/juspay/hyperswitch-web/commit/e012642865231e6c2787b828730cfc1c41ebbe36)) --- 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 eff617abc..fa7d76de0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.55.1](https://github.com/juspay/hyperswitch-web/compare/v0.55.0...v0.55.1) (2024-05-27) + + +### Bug Fixes + +* sdk button loader issue ([#400](https://github.com/juspay/hyperswitch-web/issues/400)) ([e012642](https://github.com/juspay/hyperswitch-web/commit/e012642865231e6c2787b828730cfc1c41ebbe36)) + # [0.55.0](https://github.com/juspay/hyperswitch-web/compare/v0.54.2...v0.55.0) (2024-05-23) diff --git a/package-lock.json b/package-lock.json index a5ad45c60..f14c1c18e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.55.0", + "version": "0.55.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.55.0", + "version": "0.55.1", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 3bb7a984a..8984e0a00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.55.0", + "version": "0.55.1", "main": "index.js", "private": true, "dependencies": { From 4953f7a861ed40ebe2c59b139aa06f9b822f8e67 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Mon, 27 May 2024 15:08:20 +0530 Subject: [PATCH 3/4] fix: blik code hyphen removal (#401) Co-authored-by: Pritish Budhiraja <1805317@kiit.ac.in> --- src/Payments/PaymentMethodsWrapper.res | 3 +-- src/Utilities/DynamicFieldsUtils.res | 2 +- src/Utilities/Utils.res | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Payments/PaymentMethodsWrapper.res b/src/Payments/PaymentMethodsWrapper.res index 63089b91a..38b3bff28 100644 --- a/src/Payments/PaymentMethodsWrapper.res +++ b/src/Payments/PaymentMethodsWrapper.res @@ -33,7 +33,6 @@ let make = (~paymentType: CardThemeType.mode, ~paymentMethodName: string) => { let (country, _) = Recoil.useRecoilState(userCountry) let (selectedBank, _) = Recoil.useRecoilState(userBank) let setFieldComplete = Recoil.useSetRecoilState(fieldsComplete) - let cleanBlik = str => str->String.replaceRegExp(%re("/-/g"), "") let cleanPhoneNumber = str => str->String.replaceRegExp(%re("/\s/g"), "") let (requiredFieldsBody, setRequiredFieldsBody) = React.useState(_ => Dict.make()) @@ -79,7 +78,7 @@ let make = (~paymentType: CardThemeType.mode, ~paymentMethodName: string) => { ~fullName=fullName.value, ~email=email.value, ~bank=bank.hyperSwitch, - ~blikCode=blikCode.value->cleanBlik, + ~blikCode=blikCode.value->removeHyphen, ~phoneNumber=cleanPhoneNumber( phoneNumber.countryCode->Option.getOr("") ++ phoneNumber.value, ), diff --git a/src/Utilities/DynamicFieldsUtils.res b/src/Utilities/DynamicFieldsUtils.res index 8477c2cdb..207f95b2f 100644 --- a/src/Utilities/DynamicFieldsUtils.res +++ b/src/Utilities/DynamicFieldsUtils.res @@ -408,7 +408,7 @@ let useRequiredFieldsBody = ( | AddressCity => city.value | AddressPincode => postalCode.value | AddressState => state.value - | BlikCode => blikCode.value + | BlikCode => blikCode.value->Utils.removeHyphen | PhoneNumber => phone.value | Currency(_) => currency | Country => country diff --git a/src/Utilities/Utils.res b/src/Utilities/Utils.res index 35531437c..96371e03b 100644 --- a/src/Utilities/Utils.res +++ b/src/Utilities/Utils.res @@ -1278,3 +1278,5 @@ let getStateNameFromStateCodeAndCountry = (list: JSON.t, stateCode: string, coun | None => stateCode } } + +let removeHyphen = str => str->String.replaceRegExp(%re("/-/g"), "") From 66b13f571d5c260316f249fd8f036994197545ce Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 27 May 2024 09:39:55 +0000 Subject: [PATCH 4/4] chore(release): 0.55.2 [skip ci] ## [0.55.2](https://github.com/juspay/hyperswitch-web/compare/v0.55.1...v0.55.2) (2024-05-27) ### Bug Fixes * blik code hyphen removal ([#401](https://github.com/juspay/hyperswitch-web/issues/401)) ([4953f7a](https://github.com/juspay/hyperswitch-web/commit/4953f7a861ed40ebe2c59b139aa06f9b822f8e67)) --- 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 fa7d76de0..1b7f45086 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [0.55.2](https://github.com/juspay/hyperswitch-web/compare/v0.55.1...v0.55.2) (2024-05-27) + + +### Bug Fixes + +* blik code hyphen removal ([#401](https://github.com/juspay/hyperswitch-web/issues/401)) ([4953f7a](https://github.com/juspay/hyperswitch-web/commit/4953f7a861ed40ebe2c59b139aa06f9b822f8e67)) + ## [0.55.1](https://github.com/juspay/hyperswitch-web/compare/v0.55.0...v0.55.1) (2024-05-27) diff --git a/package-lock.json b/package-lock.json index f14c1c18e..787ce6bb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "orca-payment-page", - "version": "0.55.1", + "version": "0.55.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "orca-payment-page", - "version": "0.55.1", + "version": "0.55.2", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudfront": "^3.414.0", diff --git a/package.json b/package.json index 8984e0a00..df8fe0455 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orca-payment-page", - "version": "0.55.1", + "version": "0.55.2", "main": "index.js", "private": true, "dependencies": {