#Daniel M.
1 messages · Page 1 of 1 (latest)
Some payment methods require return_url, so there's no way to avoid it when it's required
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: window.location.href
}
});
ok so this function is definetly refreshing the page and there is no "preventdefault" like you have it for forms or so?
Yeah for redirect based payment methods, that's what the above does. It sends you to the return url. You can set redirect to if_required here: https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-redirect. That will prevent redirection if you use a non-redirect based payment method