#Carlos Mascarenhas - Default Payment Method
1 messages · Page 1 of 1 (latest)
We don't change the default PM to the one used in the payment because that might not necessarily be what you want
You have to explicitly set the payment method to be the customer's default if you want it as that
Use stripe.confirmCardPayment when the customer submits your payment form. When called, it will confirm the PaymentIntent with data you provide and carry out 3DS or other next actions if they are required.
If you are using Dynamic 3D Secure, stripe.confirmCardPayment will trigger your Radar rules to execute and may open a dialog for your customer to authenticate their payment.
When you confirm a PaymentIntent, it needs to have an attached PaymentMethod. In addition to confirming the PaymentIntent, this method can automatically create and attach a new PaymentMethod for you. It can also be called with an existing PaymentMethod, or if you have already attached a PaymentMethod you can call this method without needing to provide any additional data. These use cases are detailed in the sections that follow.
the documentation says that this method can automatically create and attach a payment method to the customer, in my case this is not happening.
Attaching a payment method to a customer and setting it as the customer's default are different. The payment method must first be attached to the customer before it is set as the default. You are not even seeing a payment method being attached to your customer?
So the confirmCardPayment library attaches a payment method to the customer but I didn't set it as default?
Yes! to setup the payment method as default https://stripe.com/docs/api/customers/update#update_customer-default_source
You want https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method instead but that's only for Invoicing and Billing
What are you really trying to do? Why are you trying to set a default Payment Method?
I got confused now
Can you explain better what the confirmCardPayment library does besides confirming a payment intent?
It just confirms a payment intent
I will try to explain my subscription creation flow
ah so you do use Subscriptions!
First I create a customer just by entering personal data, without collecting payment information.
Then I create a subscription with a default status of incomplete.
after that I collect the payment data and confirm it using the confirmCardPayment library
In a situation of monthly subscription renewal, would the customer have to insert a credit card again?
all good I got it
When you confirm the PaymentIntent it will attach the card to the customer but it doesn't set it as the default. You have to do this yourself manually afterwards by setting https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method properly
We know it's not great and our engineering team is literally working on trying to fix this this week. It will take a few weeks/months to ship but hopefully that will make integrations easier in the future
What happens if I don't set a default payment method?
I passed this parameter as off_session and set it as default
I'm sorry you're overthinking this a little bit
you shouldn't have to pass anything
But really all you need to do is after the PaymentMethod is attached successfully, make it the default, either on the Customer or on the Subscription, so that future invoices are paid with that card
does setting setup_future_usage to off_session solve my problem?
not at all
it's completely unrelated
you're just missing this step in https://stripe.com/docs/billing/subscriptions/build-subscription?ui=elements#default-payment-method
that's the guide you need to follow end to end
sure! and I do agree it's annoying that's why we want to fix it
If you have a customer id after you make the code change I can have a look to confirm it works
How do you intend to resolve this?