Skip to content

Commit

Permalink
update redirect url
Browse files Browse the repository at this point in the history
  • Loading branch information
ih-abir committed Feb 8, 2024
1 parent 95fbb55 commit f03bd6a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/workers/dilmahtea-me-stripe/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const handlePOST = async (request, env, ctx) => {
currency: 'eur',
metadata: { paymentID, payment_type },
confirm: true,
return_url: successUrl,
});

// const confirmPaymentIntent = await stripe.paymentIntents.confirm(paymentIntent.id, {
Expand Down Expand Up @@ -141,9 +140,8 @@ const handlePOST = async (request, env, ctx) => {
}),
);

const return_url = paymentIntent.status === 'succeeded' ? successUrl : cancel_url;

return Response.redirect(return_url, 303);
return Response.redirect(redirectUrl, 303);
};

handlePOST.catchError = true;
Expand Down

0 comments on commit f03bd6a

Please sign in to comment.