#Benoît
1 messages · Page 1 of 1 (latest)
Where do you see redirect_status?
In my URL
Here is the callback URL Stripe send me back :
the status is "succeeded" but it could be something else, and i need to know what other status it could be, to be able to catch them
Oh I think that's either succeeded or failed
But recommend you not rely on return_url being reached for important logic
Recommend you implement webhooks to get notified async of succeeded or failed payments
Since client could disconnect, browser could crash, etc and customer might not reach return url
That's already what i've done. And i use the confirmPayment parameter redirect: 'if_required', but i need to be able to catch all the use case possible
Ok, i see what you mean
Whatever the status is, i could create a settimeout function that wait 10 seconds for example, to let the webhooks be triggered and for my app to be rid of them
Sorry for my english
No need to apologize
It's fine to use return_url params to populate/render certain things in your UI. I just suggest not relying on it for important app logic. Webhooks are really the best way to do that
But it sounds like you already do that which is good
Yes, my app is fully aware of webhooks and work only with them
I just need the statuses to be able to print a success message or a fail message to my user
Is there a way to know if "failed" is a true possible status ? It would make sense, but i need to be sure
I'll try with a Stripe Test Card that generate a payment error, i think i'll have my answer
You'd need to use another payment method where you'd be redirected away i believe
It seems the redirect is done only when the payment is successful
Otherwise, confirmPayment only return a Promise, without redirecting anywhere
Yeah see my above message
If you only accept card payments, you won't be redirected after failed payment
Yes :/
Then you shouldn't ever be redirected away for failed payments
So there's no failed status you need to handle
Actually try testing with one of our 3ds test cards and then click the option to fail the authentication. We might redirect in that case. I don't remember exactly. Recommend trying that out
Nope, i tried this, that's what i was talking of
I need to handle the fail status because we'll open more than just Cards. We intend to open Google Pay and Apple Pay
So add those payment methods and test then
I'm not certain those redirect either for failed payments, but I don't think they do because they're generally treated like cards by us
You'll need to test
Ok
Hello! Lurking in... Apple Pay and Google Pay are both subsets of cards, and will not redirect.
Such a pity that the statuses are not listed in the doc :/
Yeah but the 2 statuses are succeeded and failed AFAIK
Ok, will we'll open SEPA later
Can you tell us more about why and how you want to use redirect_status?
I need to handle the redirect_status parameter of a confirmPayment response that redirect on a callback page
Why?
In case of the redirection must be done ( redirect: 'if_required' )
I need to print a message to the user who made the attempt
That's not really how this works. If a redirect is required redirect_status doesn't really matter. That's a separate thing. The redirect_status is only used for some specific methods of payment, like CashApp for example: https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=elements#handle-redirect
If you needed to worry about it the docs would explain how to use it, but for a cards-only integration you can ignore it.
Ok but i don't know what we will open in the future. Apple Pay, Google Pay and SEPA at least, but maybe some others 🤷♂️ That's why i would like to handle this now, even if it's overkill for the moment
The redirect_status parameter is not involved in Apple Pay, Google Pay, or SEPA either.
For what it's worth, looking at our code internally, I believe the possible values for that are succeeded, pending, and failed. But, again, there's no reason for you to worry about that parameter for what you're building.
Yes i understand that's overkill for the moment
Thank you for your help 👍
(both of you)
Mmmm... might also be canceled as a possible value.