#amirasol_saved-pm-consumed
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/1324415913163755585
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello, let me take a look
Thank you!
In order to re-use the payment method (pm_xxx), it needs to be attached to a customer afaik. The PaymentMethod was created using CardElement but there was no customer attached - https://dashboard.stripe.com/logs/req_EC0GguC7qkwJzh
Even if you use setup_future_usage parameter, you'd still need to attach it to a customer to re-use it.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
We sent the customer ID in the most recent successful payment intent request -- does that not attach it to the customer?
Hi ๐
I'm stepping in as my colleague needs to go.
We sent the customer ID in the most recent successful payment intent request
No, this will not be sufficient. You need to either use a Setup Intent with a Customer ID to create/attach a Payment Method to a Customer
https://docs.stripe.com/payments/save-and-reuse
Or attach a saved Payment Method to a Customer before you attempt payment
https://docs.stripe.com/api/payment_methods/attach
Hmm, so we haven't really changed our code, but only a few of the customers are failing. And for these customers, only their most recent one.
Can you help me understand what was missing in this last successful charge? This is for one of the customers. After this, recurring payments are failing for them. https://dashboard.stripe.com/payments/ch_3QS3IsLQBKvCmVQC0cuKPp7d
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This is a successful charge. It is using a saved Payment Method (pm_1QQZWvLQBKvCmVQCuQK8YeRT) that is not attached to a customer. So, after this charge, this is marked as consumed and cannot be re-used
I recommend you follow our guide here: https://docs.stripe.com/payments/save-and-reuse to save payment methods and attach them to customers.
Okay... before that charge we were using a payment method that started with card_... -- and we don't know why it suddenly switched to that single-use pm_...
The card_... payment method was working fine. Can we just go back to using that for our transactions?
https://dashboard.stripe.com/payments/ch_3QF2EULQBKvCmVQC1DUSvA3D is one such charge
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This card works because it was saved with a Customer
In this request: https://dashboard.stripe.com/logs/req_b29dF5R8SrzxfE
That is doing exactly what I am telling you to do
Yeah... we didn't change our code and it was scheduled, recurring off-session payments... so I'm just trying to understand where we got that single-use pm... suddenly
It looks like you are using WooCommerce
When we go to the customer page, we see two payment methods attached, one card... and one pm... that is different from the single-use PM, so I was wondering if somehow the wrong PM got attached to the payment intent request.
In that case, that would be up to WooCommerce's devs
Yeah, WC dev here... sorry, that is why I want to dig deeper.
This is for one of our high-touch clients.
Okay well the difference between a card_ and a pm_ would not change anything about re-usability
It all has to do with whether or not the Card/PM was saved to a Customer
Okay. My take-away here:
- Most recent successful charge somehow used a single-use PM -- the reason is unclear, at least to me.
- There is an existing PM
card...that is attached to the customer, and that's what we've been using before the last charge, and we can go back to using that since it's been set up properly.
Is that accurate?
Yes that is correct
Alright, since this is only for a small number of transactions, I think I can suggest a way forward.
Perhaps it would be useful to try and understand how the later PM was created without the Customer?
Since, if the customer was included, all these charges would have succeeded.
Perhaps it would be useful to try and understand how the later PM was created without the Customer?
Yes, it's all off-session and scheduled, using thecardPM -- we don't know why the PM changed. Another mystery is that this also happened for other customers (changed payment method IDs) but their new payment methods are attached properly.
I will look at the logs again and maybe a pattern will emerge that helps me figure it out.
Hmmm... yeah that is definitely odd
I would look at the requests associated with the creation of each of those cards/PMs and try to trace that back to your server code that generated those API requests
Yes, thank you! I will re-open another thread if I can glean anything useful.
Happy to help ๐
We'll be here to help investigate if/when you find anything new