#Sapna Verma
1 messages · Page 1 of 1 (latest)
You may follow this guide for Subscription integration and it allows saving the payment method at the same time: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
You don't have to use additional SetupIntent to save payment method details
when is that I need to use the Setup and paymentIntent api..please clarify?
If you use Subscription, it will automatically create Payment Intent (non-zero amount) or Setup Intent (zero amount) for you. You don't have to create any of them manually or in extra step as described in the doc above.
The only time when you need to create Payment Intent by yourself is for one-time payment and Setup Intent for saving payment method only
okay, so the webhook event that I should listen to will be payment_intent.succeeded instead of checkout.session.completed
that depends on what you're looking for - what are you trying to do by listening for the webhook event? I'd suggest going through this documentation : https://stripe.com/docs/billing/subscriptions/webhooks
what trigger will be sent if the payment fails...i am using subscription api....
there are two events on successful payments - charge.suceeded and payment_intent.suceeded, which one will be fired
For successful payment on the invoice of the subscription, you should listen to invoice.paid
If you're using Subscription API, the payment will be made through Invoices under the hood and invoice.paid event will be sent for successful payment
while upgrading using update subscription call, the new price will be reflected in which parameter?
The new price should be reflected in items.data.price: https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
shouldnt we be passing the new value in update subscription in https://stripe.com/docs/api/subscriptions/update#update_subscription-items-price
Oops sorry! I sent the response parameters instead of request parameters. To change the price, it will be set on items.price. You can find the integration details of upgrading the subscription price here: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#changing
there is an event customer.subscription.created ...may I know when will I receive it...on subscription creation? At the same time, I will get the invoice.paid event as you said. Please clarify my confusion
When a subscription is created on the customer, customer.subscription.created event will be sent. If the payment on the invoice of the subscription is made, then invoice.paid event will be sent
You may refer to the Webhook event details that will be sent as part of Subscription integration here: https://stripe.com/docs/billing/subscriptions/webhooks