#vu nguyen-cards
1 messages · Page 1 of 1 (latest)
@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.
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?
what was the specific error message you got? Do you have the request ID req_xxx https://support.stripe.com/questions/finding-the-id-for-an-api-request
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.
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.
yep, you already charged that PaymentMethod, so you can't add it to a customer afterwards.
you have to explicitly pass some parameters on the PaymentIntent to save the card to a customer during the payment if that's the goal : https://stripe.com/docs/payments/save-during-payment
or since you mentioned subscriptions, maybe just use https://stripe.com/docs/billing/subscriptions/checkout instead as it handles most of this for you
that doesn't make any difference. You processed a payment/charged the card/authorised a payment, whatever you want to call it, that consumes the PaymentMethod. Capturing the funds later is unrelated.
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