Skip to content

Commit

Permalink
revert(webpack): reverting back the CDN changes (#338)
Browse files Browse the repository at this point in the history
Co-authored-by: Vrishab Srivatsa <[email protected]>
  • Loading branch information
ArushKapoorJuspay and Vrishab Srivatsa authored Apr 30, 2024
1 parent 3967bd8 commit 5401d4e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/orca-loader/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ type trustPayFunctions = {
executeGooglePayment: (string, GooglePayType.paymentDataRequest) => Promise.t<JSON.t>,
}
@new external trustPayApi: JSON.t => trustPayFunctions = "TrustPayApi"
@val @scope("window")
external alert: 't => unit = "alert"

let make = (
options,
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/orca-loader/Types.res
Original file line number Diff line number Diff line change
Expand Up @@ -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<JSON.t> => unit
@send external onload: (Dom.element, unit => Promise.t<'a>) => Promise.t<'a> = "onload"
Expand Down
12 changes: 6 additions & 6 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -20,7 +20,7 @@ let devServer = {
port: 9050,
historyApiFallback: true,
proxy: {
"/api/payments": {
"/payments": {
target: backendEndPoint,
changeOrigin: true,
secure: true,
Expand Down

0 comments on commit 5401d4e

Please sign in to comment.