#H Panseriya
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ which part of that flow are you running into problems implementing that you're looking for assistance with?
- How to deduct the amount from the backup card instead of the default card when a payment fails for subscription model?
If you want to trigger those fallback payments from your code, then you'll trigger a request to try to confirm the failed Payment Intent but provide the ID of the fallback Payment Method that you would like to use.
https://stripe.com/docs/api/payment_intents/confirm
In which API need to put the ID of stripe card to deduct amount for subscription?
The request to confirm the Payment Intent, the one that I provided a link for.
Then how does payment intent relate to the subscription?
We also want to know from which card stripe has deducted the amount.
Every billing period a Subscription creates an Invoice, and each Invoice will create a Payment Intent to process the payment for that invoice, so Subscriptions still use Payment Intents to handle their payments.
Payment Intents also have a payment_method field to track the ID of the Payment Method that it used:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-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.
Ok. Thanks. Let me take a look and get back to you.
@dark lichen
One another use case.
-
Let's consider the above use case solved.
-
Now, we want to deduct the subscription amount from the default card When the next renewal happens.
-
For next renewal, From which card stripe will deduct the amount for active subscription?
That depends on how you set the default payment method fields on the Subscription and Customer objects. We will try to use the payment method specified in the default_payment_method field on the Subscription, but if no payment method was specified there then we will fall back to other fields. You can see the exact fields that we fall back on, and in what order, in the description of this field:
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.
You mean to say when we want to deduct the amount from another card instead of default card for a specific renewal (Ex: Nov Month) THEN use a confirm-payment-intent. Correct? https://stripe.com/docs/api/payment_intents/confirm
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you want the renewal to automatically charge a card other than the one currently set as the default, then you will need to update the default before the Subscription renewal occurs.
If the typical renewal payment fails, and you want to retry with a different card, that is when you confirm the Payment Intent and provide the ID of the backup Payment Method that you want to use.
Ok. Tomorrow, I will try and update you.
Sounds good!