diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index 27d1f74..7d46539 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 a7e3ac0..e81b476 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