#corollamango74
1 messages · Page 1 of 1 (latest)
I thought it would trigger my checkout.session.completed webhook again, but it didn’t.
No, it would not. The session was already completed.
Instead, you likely want to listen for invoice.paid but it depends on what you're trying to do.
if the payment does not go through, I created a invoice.payment_failed webhook. Will this webhook trigger if a subscriber’s payment does not go through?
Yes
Great! I will create a invoice.paid webhook. I would like to receive the same information I originally received from the checkout.session.completed webhook.
It is for a membership program, so I would like to receive the start and end date of the new month of membership, the subscription Id, payment status, customer id, amount paid, and the item name
If I receive the invoice id from the invoice.paid webhook, can I receive all of the above values from an API request to Retrieve an Invoice?
You can get most of that from invoice.paid event, you should test this and ensure you've got what you need
For item name, depending on exactly what you want you may need to retrieve the product explicitly
Awesome, thank you! I'll try it. I have one more question.
I would like to create a 14 day free trial that is linked to the checkout session and subscription I mentioned before.
What would be the best way to do this?
Set subscription_date[trial_period_days] (or trial_end) when you create teh checkout session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_period_days
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I completely missed that. Thanks again!