#amirasol_saved-pm-consumed

1 messages ยท Page 1 of 1 (latest)

frank prismBOT
#

๐Ÿ‘‹ 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.

oblique kiln
#

Hello, let me take a look

spice bay
#

Thank you!

oblique kiln
#

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.

frank prismBOT
spice bay
#

We sent the customer ID in the most recent successful payment intent request -- does that not attach it to the customer?

tribal timber
#

Hi ๐Ÿ‘‹

I'm stepping in as my colleague needs to go.

spice bay
#

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

tribal timber
#

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

spice bay
#

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?

tribal timber
#

This card works because it was saved with a Customer

#

That is doing exactly what I am telling you to do

spice bay
#

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

tribal timber
#

It looks like you are using WooCommerce

spice bay
#

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.

tribal timber
#

In that case, that would be up to WooCommerce's devs

spice bay
#

Yeah, WC dev here... sorry, that is why I want to dig deeper.

#

This is for one of our high-touch clients.

tribal timber
#

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

spice bay
#

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?

tribal timber
#

Yes that is correct

spice bay
#

Alright, since this is only for a small number of transactions, I think I can suggest a way forward.

tribal timber
#

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.

spice bay
#

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 the card PM -- 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.

tribal timber
#

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

spice bay
#

Yes, thank you! I will re-open another thread if I can glean anything useful.

tribal timber
#

Happy to help ๐Ÿ™‚

We'll be here to help investigate if/when you find anything new