From c53a0b934ed45aef7bd6ac458cf89a5375515070 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Tue, 11 Jun 2024 14:09:10 +0530 Subject: [PATCH] fix: demo app docker url needed --- Hyperswitch-React-Demo-App/server.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Hyperswitch-React-Demo-App/server.js b/Hyperswitch-React-Demo-App/server.js index caddd6e02..916978a7a 100644 --- a/Hyperswitch-React-Demo-App/server.js +++ b/Hyperswitch-React-Demo-App/server.js @@ -107,18 +107,19 @@ app.get("/create-payment-intent", async (req, res) => { }, }; if (SERVER_URL) { - const apiResponse = await fetch( - `${process.env.HYPERSWITCH_SERVER_URL}/payments`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Accept: "application/json", - "api-key": process.env.HYPERSWITCH_SECRET_KEY, - }, - body: JSON.stringify(request), - } - ); + const url = + process.env.HYPERSWITCH_SERVER_URL_FOR_DEMO_APP || + process.env.HYPERSWITCH_SERVER_URL; + + const apiResponse = await fetch(`${url}/payments`, { + method: "POST", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + "api-key": process.env.HYPERSWITCH_SECRET_KEY, + }, + body: JSON.stringify(request), + }); paymentIntent = await apiResponse.json(); if (paymentIntent.error) {