Skip to content

Commit

Permalink
fix: demo app docker url needed
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja committed Jun 11, 2024
1 parent 7429831 commit c53a0b9
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Hyperswitch-React-Demo-App/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c53a0b9

Please sign in to comment.