Skip to content

Commit

Permalink
fix: sdk pay now redirect fix (#715)
Browse files Browse the repository at this point in the history
Co-authored-by: Saksham Sharma <[email protected]>
  • Loading branch information
sakksham7 and Saksham Sharma authored Oct 4, 2024
1 parent 7d6c337 commit 2bdf260
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/orca-loader/Hyper.res
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,13 @@ let make = (publishableKey, options: option<JSON.t>, analyticsInfo: option<JSON.
}
postSubmitMessage(dict)

if isSdkButton {
let submitSuccessfulValue = val->JSON.Decode.bool->Option.getOr(false)

if isSdkButton && submitSuccessfulValue {
Window.replaceRootHref(returnUrl)
} else if val->JSON.Decode.bool->Option.getOr(false) && redirect === "always" {
} else if submitSuccessfulValue && redirect === "always" {
Window.replaceRootHref(returnUrl)
} else if !(val->JSON.Decode.bool->Option.getOr(false)) {
} else if !submitSuccessfulValue {
resolve1(json)
} else {
resolve1(data)
Expand Down

0 comments on commit 2bdf260

Please sign in to comment.