#vu nguyen-cards

1 messages · Page 1 of 1 (latest)

shell pewter
#

@cloud cairn you can't attach the same Token/PaymentMethod object to two different Customer objects yes(they can only be attached to one customer). You can collect the same card information from the end-user twice (creating two different Tokens/PaymentMethods though) and attach those, if you have that use case for some reason.

cloud cairn
#

Hi @shell pewter, thank you for your help. I'm trying to work on the subscription feature of stripe (as well as the feature that allows future charge). I may understand it wrong but it seems like i need to attach customers in these cases? Since we offer streaming services, sometimes members in the same family use the same card.

#

This does not happen a lot, but when it happens, we get error froms tripe saying the payment method/intent is already attached to another custoemr

#

what would be the best way to get around this?

shell pewter
#

as I said above, we don't generally stop you from saving the same underlying card information to multiple Customers. If you're trying to attach the same PaymentMethod to multiple Customer objects then that's a bug in your code since it's not possible to do that.

cloud cairn
#

give me a few mins, i will replicate the error to get an id for you

#

pm_1JjLOJKSaeiwGYES21z94tMK

#

The provided PaymentMethod was previously used with a PaymentIntent without Customer attachment, shared with a connected account without Customer attachment, or was detached from a Customer. It may not be used again. To use a PaymentMethod multiple times, you must attach it to a Customer first.

shell pewter
#

yep, you already charged that PaymentMethod, so you can't add it to a customer afterwards.

cloud cairn
#

huhm, but the payment is authrorized only, not charged?

shell pewter
shell pewter
cloud cairn
#

I will try the sub. From time to time I need to change the amount charge on a specific month though. Just to clarify though, my current js looks like this:

#

very straight forward, I just call confirmCardPayment with a card element

#

then once submitted to the server, I create PaymentItent from the PaymentMethod with confirm= true

#

sorry, paymentIntent -> paymentMethod