From d48c5c26b2eb96ceeaa75c348d73c3f6ab480cc4 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa <136090360+vsrivatsa-juspay@users.noreply.github.com> Date: Thu, 30 May 2024 19:08:58 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20allow=20customer=20to=20pay=20with=20dif?= =?UTF-8?q?ferent=20payment=20method=20on=20cancel=20of=E2=80=A6=20(#409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Arush Co-authored-by: Pritish Budhiraja --- src/Payments/KlarnaSDK.res | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Payments/KlarnaSDK.res b/src/Payments/KlarnaSDK.res index 86c4c0384..2acaf11dd 100644 --- a/src/Payments/KlarnaSDK.res +++ b/src/Payments/KlarnaSDK.res @@ -32,13 +32,9 @@ let make = (~sessionObj: SessionsType.token) => { let handleCloseLoader = () => { Utils.handlePostMessage([("fullscreen", false->JSON.Encode.bool)]) - Utils.postFailedSubmitResponse( - ~errortype="confirm_payment_failed", - ~message="An unknown error has occurred", - ) } - let submitCallback = (ev: Window.event) => { + let submitCallback = React.useCallback((ev: Window.event) => { let json = ev.data->JSON.parseExn let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper @@ -65,7 +61,7 @@ let make = (~sessionObj: SessionsType.token) => { }, ) } - } + }, [status]) useSubmitPaymentData(submitCallback) React.useEffect(() => {