#harolold
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Are you specifing redirect always or if_required?
That shouldn't matter
It's a setting that handles redirecting your customers if they use a payment method that requires a redirect to a 3rd party site
What Stripe tech are you using? Payment Element? Checkout Session?
payment element
And what is the behavior you expect when a user confirms their payment method setup?
to redirect to a page
also it seems my alternative payment methods with redirect do not work
it just refreshes the screen on submit rather than opening a new tab for entering ideal or cash app
Cash app loads a modal window in Test mode. Is your page preventing modal windows perhaps?
how would I fix that?
I don't even know if it's happening, I just suggested it as something you may want to look into.
With respect to your confirmSetup not redirecting, Can you share an API request ID for this? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
It will be a setup intent confirmation API call
I just tested my own redirection on confirmation
my JS looks like this
stripe.confirmSetup({
elements,
confirmParams: {
return_url: `${window.location.origin}/success`
}
})
Are you always using the LInk payment method in your tests?
no
So what happened when you completed the payment? Were you redirected at all?
no it just refreshed the page
Hmmm... and you didn't see anything change in the URL?
it just put a ? at the end
And how does your framework handle redirect requests?
hey btw I found the error
You did? what was it?
for this part I had e.preventdefault(); commented out
async function handleSubmit(e) {
e.preventDefault();
setLoading(true);
// //Send email to next page in queryparameters
//// //email is a route
//redirect_url = "https://www.google.com";
console.log(redirect_url);
//setTimeout(function () {
// window.location.href = redirect_url;
//}, 1000000);
const { error } = await stripe.confirmSetup({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: 'https://stripe.com'
},
redirect : "always"
});
console.log("error=" + error);
//response.then((data) => { console.log("response=" + data) });
// This point will only be reached if there is an immediate error when
// confirming the payment. Otherwise, your customer will be redirected to
// your `return_url`. For some payment methods like iDEAL, your customer will
// be redirected to an intermediate site first to authorize the payment, then
// redirected to the `return_url`.
if (error.type === "card_error" || error.type === "validation_error") {
showMessage(error.message);
} else if (error.type == "") {
//doesn't get triggered
window.location.href = redirect_url;
}
else{
showMessage("An unexpected error occurred.");
}
setLoading(false);
}
Oooooohhhhh. So including prevented the default POST behavior, right?