#Matt11
1 messages · Page 1 of 1 (latest)
hello! how can I help?
Hello Alex, thanks for your time. The PI is pi_3MSmK4ApMCw5clA31XakLhTL.
I'm going to explaing which is my logic
As you can see at "22/01/23, 11:09:11" I tried to confirm the PI with this piece of API:
Stripe::PaymentIntent.confirm(
stripe_payment_intent.id,
{ payment_method: stripe_customer['default_source'] }
)
Stripe responded with 'requires_actions' status.
If the PI is in the 'requires_actions' status I do this:
Stripe::PaymentIntent.confirm(
intent_id,
{
return_url: return_url
}
)
but the "next_action" il null, so I wasn't able to perform a next action. What I'm I missing?
gimme a while, taking a look
thanks 
there's no next_action because it succeeded
when you did that second snippet, it attempted payment again(every use of .confirm is a new payment attempt), and that attempt succeeded (the response was a PaymentIntent with status:suceeded) and didn't require 3D Secure
thanks. So I don't understand how to do.
If I have a payment in 'requires_payment_method' -> I perform an update on the credit card and confirm the PI
the payment goes into 'requires_action' status -> redirect into 3DS page
In which part of the flow can I achieve the next_action field? Am I confirming the payment too much times?
if you attempt an off_session payment on a PaymentIntent(as you did here) and that requires 3DS, you get a decline, and the next step is to contact the customer and bring them to your website. Once they're there you should use https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-existing on the frontend to do 3DS with them and attempt payment.
https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-method
This is what I do inside my app. If the payment is in 'required_payment_method' status:
- I update the card and then confirm the PI with this:
Stripe::PaymentIntent.confirm(
stripe_payment_intent.id,
{ payment_method: stripe_customer['default_source'] }
)
- if 'suceeded' ok but if is 'requires_action' I do another confirm with the return_url:
intent = Stripe::PaymentIntent.confirm(
intent_id,
{
return_url: return_url
}
)
this worked for this testing PI: pi_3MWycLApMCw5clA30UOnNB42
yes I think we covered that already
Ok but in testing worked correctly and for the live PI doens't and I don't see differences in the flow
the difference is that the bank happened to approve one of the payments here
your flow is attempting three payments(an off-session confirm, then you confirm again to set payment_method, and you confirm again to set a return_url), and each of those is a separate payment attempt, and in this case the bank decided to approve one of them, for whatever reason.
Our recommended flow for handling this case is the one I described above and is in the docs linked there