#jmadlena_api

1 messages ¡ Page 1 of 1 (latest)

robust wadiBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1228072793208389783

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

delicate fernBOT
jagged hinge
#
  1. Collect new payment method details using the PI client secret
    How are you doing this step, exactly?
#

The PM you collect in step 1 is attached, correct?

shut flume
#

Yes, the PM I collect in step 1 is attached. To collect the new payment details I create a Payment Element and then do stripe.confirmPayment using the client secret from the failed Payment Intent.

#

This successfully completes the payment, and I can see the new card number as part of the payment details, but it is not attached to the customer, and I am not able to attach it afterwards.

jagged hinge
#

Is that using the payment intent from the invoice?

shut flume
#

In this case there is no invoice. I am creating a Payment Intent directly. I am using the same PI that failed previously.

jagged hinge
#

The PM is saved for future use only when setup_future_usage is set on the payment intent, which is not initially set because you're doing the first attempt off session (so you dont want this)

#

After that failure then, before collecting the new PM, you'll want to update the PI to set setup_future_usage= 'off_session',

#

Then when you confirm with the new details you should find it is attached to the customer

shut flume
#

Ah, that makes sense. I tried to use the setup_future_usage option when creating it, but it conflicted with the off_session = true when I originally create it. I'll give that a shot. Thanks so much for your help!

jagged hinge
#

NP!

#

yes, you can do that for the first off session attempt

#

but you can update it after failure to change it, since the later attempt is no longer off session

shut flume
#

That makes sense. Thanks again!