#Benoît

1 messages · Page 1 of 1 (latest)

tranquil swallowBOT
main estuary
#

Where do you see redirect_status?

jaunty wedge
#

In my URL

#

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

main estuary
#

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

jaunty wedge
#

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

main estuary
#

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

jaunty wedge
#

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

main estuary
#

Yep that's how

#

Although I don't think we redirect away with cards if payment fails

tranquil swallowBOT
main estuary
#

You'd need to use another payment method where you'd be redirected away i believe

jaunty wedge
#

It seems the redirect is done only when the payment is successful

#

Otherwise, confirmPayment only return a Promise, without redirecting anywhere

main estuary
#

Yeah see my above message

#

If you only accept card payments, you won't be redirected after failed payment

jaunty wedge
#

Ah ! Ok

#

Do you have an advice ?

main estuary
#

Which payment methods do you accept?

#

Is it just card?

jaunty wedge
#

Yes :/

main estuary
#

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

jaunty wedge
#

I need to handle the fail status because we'll open more than just Cards. We intend to open Google Pay and Apple Pay

main estuary
#

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

jaunty wedge
#

Ok

vocal shard
#

Hello! Lurking in... Apple Pay and Google Pay are both subsets of cards, and will not redirect.

jaunty wedge
#

Such a pity that the statuses are not listed in the doc :/

main estuary
#

Yeah but the 2 statuses are succeeded and failed AFAIK

jaunty wedge
vocal shard
#

Can you tell us more about why and how you want to use redirect_status?

jaunty wedge
#

I need to handle the redirect_status parameter of a confirmPayment response that redirect on a callback page

vocal shard
#

Why?

jaunty wedge
#

In case of the redirection must be done ( redirect: 'if_required' )

#

I need to print a message to the user who made the attempt

vocal shard
#

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.

jaunty wedge
#

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

vocal shard
#

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.

jaunty wedge
#

Yes i understand that's overkill for the moment

#

Thank you for your help 👍

#

(both of you)

vocal shard
#

Mmmm... might also be canceled as a possible value.