#paragonn_subscription-defaultpm
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1263906697446162662
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
You can configure the "default payment method" either at the Invoice level, Subscription or globally on the Customer.
ok, so if I just create a subscription with a payment method will it by default be the default payment method for the subscription?
Hi ๐
I'm stepping in as my colleague needs to go.
Yes you can specify the default payment method on a per Subscription basis by providing a payment method ID in the default_payment_method parameter
https://docs.stripe.com/api/subscriptions/create#create_subscription-default_payment_method
got it
That payment method must belong to the Customer the Subscription is created for.
roger that
in addition to locking the payment method to the subscription I would like to update the default payment method for the customer to the last used credit card.
In that case, you would update the invoice_settings.default_payment_method on the Customer object: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
This is the setting I am using the Payment Intent for the Subscription: 'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
In that case, the default payment method will be saved once the payment intent succeeds
so is that setting it as the default payment method for the subscription or for the customer?
Subscription. Here's the description from our API ref doc
Configure whether Stripe updates subscription.default_payment_method when payment succeeds.
Ok so if a customer creates another subscription with a difference credit card with the same setting. It won't affect the payment method used on the first subscription?
Correct
excellent
So in the Stripe dashboard in the Invoice for the subscription when it says Billing Method: Charge default payment method it is referring to the default payment method of the subscription?
Both. If you have a default payment method on the Subscription, that will take precedence because it's more specific. If you don't have a default on the Subscription, it will fall back to the default on the Customer
ok that is good
so this setting on the payment intent: 'payment_settings' => ['save_default_payment_method' => 'on_subscription'], only affects the default for the subscription or also sets the default for the customer?
Sorry, which setting?
This line of code in the Payment Intent: 'payment_settings' => ['save_default_payment_method' => 'on_subscription']
Does that just sent the default payment method for the subscription or does it also update the default payment method of the Customer as well?
payment_settings isn't a property on the Payment Intent object: https://docs.stripe.com/api/payment_intents/object
Sorry I meant when creating the Subscription
Okay, in that case it will only apply to the Subscription.
ok got it
I would need to also set the default payment method separately for the customer
Correct. You said you wanted it to be the last payment method used. Do you want that to always be the case?
Like, every time the customer pays for something?
yes i think that makes sense. Is that good practice?
It might be overkill
well i wouldn't want to do it if it is the same payment method
i suppose I don't really need to do it
IF the customer re-enters the same card information it will still create a different payment method. But you could use the card.fingerprint property to identify the same card being entered multiple times
https://docs.stripe.com/api/payment_methods/object#payment_method_object-card-fingerprint
Sure thing! I think you might be able to use webhooks to update the customer payment method. But I think you would want to consider how your customers interact with your application and when it would make the most sense to update their payment methods.