Skip to content

Commit

Permalink
refactor: Updated backend endpoints to CDN endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrishab Srivatsa committed Feb 1, 2024
1 parent fe49a56 commit 3b260f1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions aws/hyperswitch_web_aws_production_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ echo $( (aws s3api put-bucket-policy --bucket $MY_AWS_S3_BUCKET_NAME --policy "$

echo "Bucket configuration updated"

echo "Enter the backend endpoint your Hyperswitch Client will hit (hosted Hyperswitch Backend, https://sandbox.hyperswitch.io is taken by default):"
echo "Enter the backend endpoint your Hyperswitch Client will hit (hosted Hyperswitch Backend, https://beta.hyperswitch.io/api is taken by default):"
read AWS_BACKEND_URL </dev/tty

if [ -z $AWS_BACKEND_URL ]; then
echo "Setting backend URL value to https://sandbox.hyperswitch.io by default"
AWS_BACKEND_URL="https://sandbox.hyperswitch.io"
echo "Setting backend URL value to https://beta.hyperswitch.io/api by default"
AWS_BACKEND_URL="https://beta.hyperswitch.io/api"

fi

Expand Down
12 changes: 6 additions & 6 deletions aws/hyperswitch_web_aws_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ command_discovery() {
command_discovery curl
command_discovery aws

echo "Please enter the URL where you have hosted Hyperswitch Backend (https://sandbox.hyperswitch.io) "
echo "Please enter the URL where you have hosted Hyperswitch Backend (https://beta.hyperswitch.io/api) "
read HYPERSWITCH_SERVER_URL < /dev/tty

if [ -z "$HYPERSWITCH_SERVER_URL" ]; then
echo "Using default api url: https://sandbox.hyperswitch.io"
HYPERSWITCH_SERVER_URL="https://sandbox.hyperswitch.io"
echo "Using default api url: https://beta.hyperswitch.io/api"
HYPERSWITCH_SERVER_URL="https://beta.hyperswitch.io/api"
fi

# echo "Please enter the api url (https://sandbox.hyperswitch.io) "
# echo "Please enter the api url (https://beta.hyperswitch.io/api) "
# read apiBaseUrl < /dev/tty

# if [ -z "$apiBaseUrl" ]; then
# echo "Using default api url: https://sandbox.hyperswitch.io"
# apiBaseUrl="https://sandbox.hyperswitch.io"
# echo "Using default api url: https://beta.hyperswitch.io/api"
# apiBaseUrl="https://beta.hyperswitch.io/api"
# fi

echo "Please enter the URL where you have hosted Hyperswitch Client SDK (https://beta.hyperswitch.io/v1) "
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/ApiEndpoint.res
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let getApiEndPoint = (~publishableKey="", ~isConfirmCall=false, ()) => {
| None =>
let backendEndPoint = isConfirmCall ? GlobalVars.confirmEndPoint : GlobalVars.backendEndPoint
if GlobalVars.isProd {
testMode ? "https://sandbox.hyperswitch.io" : backendEndPoint
testMode ? "https://beta.hyperswitch.io/api" : backendEndPoint
} else {
backendEndPoint
}
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://api.hyperswitch.io"
? "https://checkout.hyperswitch.io/api"
: sdkEnv === "sandbox"
? "https://sandbox.hyperswitch.io"
? "https://beta.hyperswitch.io/api"
: sdkEnv === "integ"
? "https://integ-api.hyperswitch.io"
: "https://sandbox.hyperswitch.io";
: "https://beta.hyperswitch.io/api";
} else {
backendEndPoint = envBackendUrl;
}
Expand All @@ -53,12 +53,12 @@ let confirmEndPoint;
if (envBackendUrl === undefined) {
confirmEndPoint =
sdkEnv === "prod"
? "https://api.hyperswitch.io"
? "https://checkout.hyperswitch.io/api"
: sdkEnv === "sandbox"
? "https://sandbox.hyperswitch.io"
? "https://beta.hyperswitch.io/api"
: sdkEnv === "integ"
? "https://integ-api.hyperswitch.io"
: "https://sandbox.hyperswitch.io";
: "https://beta.hyperswitch.io/api";
} else {
confirmEndPoint = envBackendUrl;
}
Expand Down
6 changes: 3 additions & 3 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://api.hyperswitch.io/payments"
? "https://checkout.hyperswitch.io/api/payments"
: sdkEnv === "sandbox"
? "https://sandbox.hyperswitch.io/payments"
? "https://beta.hyperswitch.io/api/payments"
: sdkEnv === "integ"
? "https://integ-api.hyperswitch.io/payments"
: "https://sandbox.hyperswitch.io/payments";
: "https://beta.hyperswitch.io/api/payments";

let devServer = {
contentBase: path.join(__dirname, "dist"),
Expand Down

0 comments on commit 3b260f1

Please sign in to comment.