From fb2d5b78d4ab1c7a69c513f32846d8cc9d51130f Mon Sep 17 00:00:00 2001 From: Praful Koppalkar Date: Fri, 26 Apr 2024 15:04:17 +0530 Subject: [PATCH] fix: update with small change --- src/orca-loader/Elements.res | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 1de1198f0..287e70c44 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -458,13 +458,10 @@ let make = ( ->then(json => { let dict = json->JSON.Decode.object->Option.getOr(Dict.make()) let status = dict->getString("status", "") - if status === "succeeded" || status === "failed" { - Window.Location.replace( - `${url}?payment_intent_client_secret=${clientSecret}&status=${status}`, - ) - } else { - Window.Location.replace(url) - } + let returnUrl = dict->getString("return_url", "") + Window.Location.replace( + `${returnUrl}?payment_intent_client_secret=${clientSecret}&status=${status}`, + ) resolve() }) ->catch(_ => {