#Matt11

1 messages · Page 1 of 1 (latest)

lime glacierBOT
surreal cargo
#

hello! how can I help?

merry birch
#

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?

surreal cargo
#

gimme a while, taking a look

merry birch
#

thanks thankyou

tawdry lotus
#

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

merry birch
#

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?

tawdry lotus
merry birch
#

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

tawdry lotus
#

yes I think we covered that already

merry birch
#

Ok but in testing worked correctly and for the live PI doens't and I don't see differences in the flow

tawdry lotus
#

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