Skip to content

Commit

Permalink
fix: redirect loader issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed May 23, 2024
1 parent 4ce0c7f commit 0eb6dec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/Components/PayNowButton.res
Original file line number Diff line number Diff line change
Expand Up @@ -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 => ()
}
}
Expand Down
7 changes: 1 addition & 6 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0eb6dec

Please sign in to comment.