Updated donate URL and fetch request
This commit is contained in:
parent
e9e7794027
commit
b98d95d3a5
1
.env
1
.env
@ -1,4 +1,5 @@
|
||||
REACT_APP_BROKER_URL=http://localhost:9000
|
||||
REACT_APP_ICE_SERVERS_URL=http://localhost:9000/iceservers
|
||||
REACT_APP_STRIPE_API_KEY=pk_test_8M3NHrF1eI2b84ubF4F8rSTe0095R3f0My
|
||||
REACT_APP_STRIPE_URL=http://localhost:9000
|
||||
REACT_APP_VERSION=$npm_package_version
|
@ -1,4 +1,5 @@
|
||||
REACT_APP_BROKER_URL=https://test.owlbear.rodeo
|
||||
REACT_APP_ICE_SERVERS_URL=https://test.owlbear.rodeo/iceservers
|
||||
REACT_APP_STRIPE_API_KEY=pk_live_MJjzi5djj524Y7h3fL5PNh4e00a852XD51
|
||||
REACT_APP_STRIPE_API_KEY=pk_test_8M3NHrF1eI2b84ubF4F8rSTe0095R3f0My
|
||||
REACT_APP_STRIPE_URL=https://payment.owlbear.rodeo
|
||||
REACT_APP_VERSION=$npm_package_version
|
@ -49,7 +49,17 @@ function Donate() {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await fetch("/create-session", { method: "POST" });
|
||||
const response = await fetch(
|
||||
process.env.REACT_APP_STRIPE_URL + "/create-checkout-session",
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ currency: "usd", amount: value * 100 }),
|
||||
}
|
||||
);
|
||||
const session = await response.json();
|
||||
const result = await stripe.redirectToCheckout({ sessionId: session.id });
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user