#PSN - PaymentMethod

1 messages · Page 1 of 1 (latest)

dapper wraith
#

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.

ionic cove
#

ok

#

I'm getting multiple subscriptions while making payment

#

Not sure why

subtle cargo
#

do you have IDs of the multiple subscriptions? sub_xxx

ionic cove
#

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

subtle cargo
#

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.

ionic cove
#

Anything I can do in the backend to prevent this from happening?