Skip to content

Commit

Permalink
fix: allow customer to pay with different payment method on cancel of… (
Browse files Browse the repository at this point in the history
#409)

Co-authored-by: Arush <arush.kapoor@juspay.in>
Co-authored-by: Pritish Budhiraja <pritish.budhiraja@gmail.com>
  • Loading branch information
3 people authored May 30, 2024
1 parent cc00bb0 commit d48c5c2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Payments/KlarnaSDK.res
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -65,7 +61,7 @@ let make = (~sessionObj: SessionsType.token) => {
},
)
}
}
}, [status])
useSubmitPaymentData(submitCallback)

React.useEffect(() => {
Expand Down

0 comments on commit d48c5c2

Please sign in to comment.