#kado-kaelan-subscription-trial
1 messages ยท Page 1 of 1 (latest)
subscription.latest_invoice.payment_intent.client_secret,
this worked before i added trial_period
I looked in the subscription object and couldnt find it anywhere. may have missed it though
If you have a trial there is no payment due immediately, so there is no payment intent on the trial invoice.
Instead, the subscription should have a pending_setup_intent with a client_secret you can use with confirmCardSetup
got it, so instead of using confirmCardPayment I use confirmCardSetup. and will charging the card be taken care of on your side? or do I have to set up a webhook
You'll need to set the default payment method, either for the subscription or the customer invoice settings: https://stripe.com/docs/billing/subscriptions/build-subscription?ui=elements#default-payment-method
like that, but based on the successful setup intent
you can do this by listening to webhooks, or from the response from confrimCardSetup. We recommend webhooks, but it's up to you.
That's the setup intent -- when you create the subscription you can expand it like you're doing wiht the invoice & payment intent
https://stripe.com/docs/api/expanding_objects
expand[]=pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ahhhh got it!
Are you all set here, or need more help?
I've gotten to the point where a customer is created, subscription is created with trial and associated with customer, card payment is collected
now they will be billed at end of trial correct? unless they cancel
and those two actions can be handled with webhooks?
assuming you set the default payment method, then yes
(note there is always the chance they hit an extra 3ds authentication and you'll need a recovery flow for that)
and those two actions can be handled with webhooks?
which tow actions, specifically?
subscription cancellation and the user payment confirmation
Gotcha. The cancellation has a webhook, yes: customer.subscription.deleted https://stripe.com/docs/api/events/types#event_types-customer.subscription.deleted
and you can use Stripes automatic help for invoice payment recovery: https://stripe.com/docs/invoicing/automatic-collection
but if you need to manage payment authentication yourself: invoice.payment_action_required (or payment_failed) https://stripe.com/docs/api/events/types#event_types-invoice.payment_action_required
Awesome, thanks for all the help. AMAZING service! I'm going to set the default payment method, look into 3d authentication, and webhooks
You're very welcome! Glad I was able to help ๐