From 1df705fa5f13b05830c1cc5492bd2864cc44f3a8 Mon Sep 17 00:00:00 2001 From: Arush Date: Mon, 29 Apr 2024 18:32:37 +0530 Subject: [PATCH 1/2] revert(webpack): reverting back the CDN changes --- webpack.common.js | 12 ++++++------ webpack.dev.js | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/webpack.common.js b/webpack.common.js index c8fc54102..6802ee965 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -39,12 +39,12 @@ let backendEndPoint; if (envBackendUrl === undefined) { backendEndPoint = sdkEnv === "prod" - ? "https://checkout.hyperswitch.io/api" + ? "https://api.hyperswitch.io" : sdkEnv === "sandbox" - ? "https://beta.hyperswitch.io/api" + ? "https://sandbox.hyperswitch.io" : sdkEnv === "integ" ? "https://integ-api.hyperswitch.io" - : "https://beta.hyperswitch.io/api"; + : "https://sandbox.hyperswitch.io"; } else { backendEndPoint = envBackendUrl; } @@ -53,12 +53,12 @@ let confirmEndPoint; if (envBackendUrl === undefined) { confirmEndPoint = sdkEnv === "prod" - ? "https://checkout.hyperswitch.io/api" + ? "https://api.hyperswitch.io" : sdkEnv === "sandbox" - ? "https://beta.hyperswitch.io/api" + ? "https://sandbox.hyperswitch.io" : sdkEnv === "integ" ? "https://integ-api.hyperswitch.io" - : "https://beta.hyperswitch.io/api"; + : "https://sandbox.hyperswitch.io"; } else { confirmEndPoint = envBackendUrl; } diff --git a/webpack.dev.js b/webpack.dev.js index 89044d741..d702a8003 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -6,12 +6,12 @@ const sdkEnv = process.env.sdkEnv; let backendEndPoint = sdkEnv === "prod" - ? "https://checkout.hyperswitch.io/api/payments" + ? "https://api.hyperswitch.io/payments" : sdkEnv === "sandbox" - ? "https://beta.hyperswitch.io/api/payments" + ? "https://sandbox.hyperswitch.io/payments" : sdkEnv === "integ" ? "https://integ-api.hyperswitch.io/payments" - : "https://beta.hyperswitch.io/api/payments"; + : "https://sandbox.hyperswitch.io/payments"; let devServer = { contentBase: path.join(__dirname, "dist"), @@ -20,7 +20,7 @@ let devServer = { port: 9050, historyApiFallback: true, proxy: { - "/api/payments": { + "/payments": { target: backendEndPoint, changeOrigin: true, secure: true, From 998534b21b790139b7a87d2d2769170b71c459f1 Mon Sep 17 00:00:00 2001 From: Vrishab Srivatsa Date: Tue, 30 Apr 2024 12:56:25 +0530 Subject: [PATCH 2/2] fix: added alert on event.isTrusted --- src/orca-loader/Elements.res | 5 +++++ src/orca-loader/Types.res | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 5ea77b0d5..57adb5e1c 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -10,6 +10,8 @@ type trustPayFunctions = { executeGooglePayment: (string, GooglePayType.paymentDataRequest) => Promise.t, } @new external trustPayApi: JSON.t => trustPayFunctions = "TrustPayApi" +@val @scope("window") +external alert: 't => unit = "alert" let make = ( options, @@ -452,6 +454,9 @@ let make = ( switch dict->Dict.get("applePayButtonClicked") { | Some(val) => if val->JSON.Decode.bool->Belt.Option.getWithDefault(false) { + alert(event) + alert("event.isTrusted handleApplePayThirdPartyFlow") + alert(event.isTrusted) let applePaySessionTokenData = dict ->Dict.get("applePayPresent") diff --git a/src/orca-loader/Types.res b/src/orca-loader/Types.res index af364c201..efcb52b4d 100644 --- a/src/orca-loader/Types.res +++ b/src/orca-loader/Types.res @@ -10,7 +10,7 @@ type eventData = { confirmTriggered: bool, oneClickConfirmTriggered: bool, } -type event = {key: string, data: eventData} +type event = {key: string, data: eventData, isTrusted: bool} type eventParam = Event(event) | EventData(eventData) | Empty type eventHandler = option => unit @send external onload: (Dom.element, unit => Promise.t<'a>) => Promise.t<'a> = "onload"