#jmadlena_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
- 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?
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.
Is that using the payment intent from the invoice?
In this case there is no invoice. I am creating a Payment Intent directly. I am using the same PI that failed previously.
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
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!
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
That makes sense. Thanks again!