#dvir_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1247163615279058968
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there ๐ jumping in as my teammate needs to step away soon. Yes, if you plan to use a Payment Method for multiple intents, it should be attached to a Customer. Typically you don't explicitly do that yourself, but instead allow the first Payment Intent to handle that attachment, or use a Setup Intent prior to any payments to set up the Payment Method.
When our members' clients attempt to pay, we first create the customer and payment method, and then we store them both in our DB, so clients will not have to re-enter their CC details on next payments.
So if they added a CC that fails, and stripe won't attach the customer to the payment method on this case, they will still be able to try and pay with the same customer and payment method, which will then pop that error.
Is the only workaround is to attach the customer to the payment method prior creating the payment intent?
I'm worried about how it'll affect optimizing for future payments.
Are you trying to process a payment while simultaneously setting up the Payment Method for future usage, or do you collect the payment method first and then try to process payments against them later?
This is what we do:
- Collect CC information with Stripe.js
- pass this
pm_*to our BE - our BE creates a customer, and then saves the pair of customer <> payment method in our DB.
- When creating a payment intent, we pass the customer <> payment method duo to the payment intent request (alongside confirm=true)
- Clients are then able to reuse this payment method (by seeing our DB record).
So, assuming stripe doesn't attach customer to payment method when the charge fails, we can not use that DB record anymore (as stripe will fail future requests because the payment method was not attached to a customer).
Yup, I believe that all sounds expected.
so the workaround will be to attach the customer to the payment method prior to that?