#blackbirdgunner
1 messages · Page 1 of 1 (latest)
are not setting any default card for the user once payment is done. It was working fine before this.
Checkout has never automatically set a saved card as the default on a Customer object
It'll attach the card to the Customer, but it won't be set as the invoice_settings[default_payment_method]
that's weird, because I don't have any code that explicitly sets a card as default and it used to set the one I enter first time as default card for that customer
Can you share some examples?
I don't have the previous customer objects with me right now, but for this one cus_OaX9imm3LYIwc2 I had initially used the 4242 card to buy a plan which I'm most certain was set as the default payment before I added another card.
Taking a look, but I'd be surprised
If user has a card on their account but it's not set as default, does stripe use that in case of plan upgrade/downgrade later on?
Not automatically no. You'd need to use that specific pm_xxx to confirm the upgrade/downgrade
Looks like the default PM was initially set via the customer portal: https://dashboard.stripe.com/test/logs/req_sYK39pLmn7Shy2
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So when I'm creating the checkout session, I'm passing payment_method_types=['card'] and then later on for the upgrade/downgrade part, I'm just simply using stripe.Subscription.modify() to change the plans.
would that use the initially saved non-default card? Because the subscription change in that case worked for me.
Well Checkout will set the same PM as the default_payment_method on the Subscription, which is that would be automatically used for any recurring payments
okay
so in that case even if the card is not marked as default, it will still use that, right?
It there's a default_payment_method set on the Subscription, which Checkout does automatically, then that takes precedence over the default on the Customer. As noted here: https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.