From 0eb6dec75a480287309006cc046adcc991a92ab0 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Thu, 23 May 2024 16:08:45 +0530 Subject: [PATCH] fix: redirect loader issue --- src/Components/PayNowButton.res | 6 ++++-- src/Utilities/PaymentBody.res | 7 +------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index 27d1f743f..e9a364174 100644 --- a/src/Components/PayNowButton.res +++ b/src/Components/PayNowButton.res @@ -26,8 +26,10 @@ let make = () => { let dict = json->getDictFromJson switch dict->Dict.get("submitSuccessful") { | Some(_) => - setIsPayNowButtonDisable(_ => false) - setShowLoader(_ => false) + if sdkHandleConfirmPayment.confirmParams.redirect === Some("if_required") { + setIsPayNowButtonDisable(_ => false) + setShowLoader(_ => false) + } | None => () } } diff --git a/src/Utilities/PaymentBody.res b/src/Utilities/PaymentBody.res index 4339e8319..eaf7e476e 100644 --- a/src/Utilities/PaymentBody.res +++ b/src/Utilities/PaymentBody.res @@ -166,12 +166,7 @@ let confirmPayloadForSDKButton = (sdkHandleConfirmPayment: PaymentType.sdkHandle "confirmParams", [ ("return_url", sdkHandleConfirmPayment.confirmParams.return_url->JSON.Encode.string), - ( - "redirect", - sdkHandleConfirmPayment.confirmParams.redirect - ->Option.getOr("if_required") - ->JSON.Encode.string, - ), + ("redirect", "always"->JSON.Encode.string), ]->Utils.getJsonFromArrayOfJson, ), ]->Utils.getJsonFromArrayOfJson