#PSN - PaymentMethod
1 messages · Page 1 of 1 (latest)
Hi there!
A Customer object can have multiple PaymentMethod, but only a single default PaymentMethod that is set here: https://stripe.com/docs/api/customers/create#create_customer-invoice_settings-default_payment_method
But you could also set a default PaymentMethod on a subscription (https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method) or on an invoice (https://stripe.com/docs/api/invoices/create#create_invoice-default_payment_method) depending on what you want to do.
do you have IDs of the multiple subscriptions? sub_xxx
Yes
This is the customer
cus_MBXoOantD4eg6t
I mean multiple payments against one subsription
There were 2 more payment methods (which are the same card). I deleted them an hour ago
if you look at the logs https://dashboard.stripe.com/logs?object=cus_MBXoOantD4eg6t you can see you are creating mutliple subscriptions(you called /v1/subscriptions multiple times)
usually that's because you have a bug where you don't handle the case of a user double-clicking some "Pay now" button on your frontend, so if the user clicks twice you call your backend twice. You should make sure to set the disabled property on the button after it's clicked and while you're calling your backend.
Anything I can do in the backend to prevent this from happening?