#Bharat-subscriptions
1 messages · Page 1 of 1 (latest)
hi! you can use either, or both. The subscription level one takes precedence over the customer level one if they ever differ
It's mainly up to you what to do, depends on if you envision the same customer having multiple subscriptions and how you'd like them to pay for those (all using the same card, or making it possible for each subscription to charge different cards).
generally our recommendation leans closer to "set the default payment method on the subscription object" and that's what e.g. Checkout does.
Got, that makes sense! I think we're envisioning the customer having one subscription at any given time and that they can look up their cards on file, etc. based on customer. I suspect it might be good to set on both given this.
Related question, outside of setting the default payment method, is it necessary to have setup_future_usage: "off_session", via confirmCardPayment on the client and the server to have customers get charged successfully at the next payment period? Want to make sure that when a customer's next invoice or when a trial ends, that charges happen successfully
it's necessary, but if you're using the PaymentIntent that is created by creating the subscription (subscription.latest_invoice.payment_intent) it should already have that set so you don't need to pass it again at confirmation
Ah yep, that's what we're using. Is it also set automatically with pending_setup_intent that we use when we're creating a subscription trial that we then use confirmCardSetup with?
customer: stripeCustomerId,
items: [
{
price: selected.priceId,
},
],
trial_period_days: 7,
expand: ["pending_setup_intent"],
});```
Yes, that setup intent should also be able to set up cards for future offline usage
Awesome, thanks!
One other follow up. When setting up webhooks to add a default payment method on either the subscription or the customer, it's clear how to do it when you start with a payment_intent. Per the docs, you can do it using invoice.payment_succeeded.
But when you have a trial on the subscription, there's only the setup_intent and there's no invoice.payment_succeeded event. Should we use the setup_intent.succeeded event? (Though this doesn't give you access to the subscription)
Yes that should be the event to do it on. By that point the payment method should already be set as the default for the Subscription so you can probably just set it as the default on the Customer if each user will only ever have one subscription and one default PM
Great, got it. Thanks @shy falcon !