#nils_93415

1 messages · Page 1 of 1 (latest)

alpine crestBOT
fiery forge
#

Hmm where do you see redirect_status?

#

Could you give an example?

open trench
#
  1. User selects payment method like P24 from the Payment Element, where he gets redirected to another page
  2. User enters payment element and gets redirect again to the url which is passed as "return_url" to "confirmPayment()" in the client
  3. There are query parameters in the Url the user gets redirected to, like payment_intent, but also the redirect_status. payment_intent is documented, redirect_status isn't. Can I expect it to always be passed to us?
fiery forge
#

Yeah I understand, but can you give an example Url when it returned?

#

There could be undocumented parameters there, but it's generally not a good idea to rely on them

open trench
#

https://.../checkout/details?payment_intent=pi_3OJXssGuZMihDWtE0j5cOeAG&payment_intent_client_secret=pi_3OJXssGuZMihDWtE0j5cOeAG_secret_yL7eI2zmCUg3RMVrBtlBs0LUy&redirect_status=failed

The path is our own checkout page. The query parameters are added by Stripe. payment_intent and payment_intent_client_secret are documented for the payment method

#

For other payment methods "redirect_status" is documented. That's what's wondering me

fiery forge
#

Um I am seeing redirect_status=failed but it did successfully, right?

#

Yep I don't think we documented it, and things like that could subject to change, so let' just ignore it if it doesn't block you

open trench
#

No, it actually failed, just did a quick run to have the query parameter included 😄

Our problem with P24 is that payment intents in production are updated from "requires_action" to "succeeded" seconds after the user gets redirected back to us. With the redirect_status we want to determine if we can wait and poll the result until it is succeeded

alpine crestBOT
untold ore
#

The redirect_status does not necesarily indicate payment success so shouldn't be relied on in that instance. The recommendation is to use a webhook for async post-payment actions/fulfilment

open trench
#

Yes, we don't rely on it to complete the order on our side. We just want it as an indicator that the payment intent may switch to succeeded in the next couple of seconds so that we wait for a webhook without showing the user that the payment failed or similar, since the payment_intent status is still on "requires_action" when the user gets redirect from P24 payments

untold ore
#

I think our recommendation would be to just show a 'payment pending' page in those scenarios, as opposed to polling the API based on an undocumented query parameter