Reputation: 832
I am trying to understand the stripe events but am confused/unsure if I have understood it correctly. I've italics my questions. My customer cycle is below.
#1
Using checkout.session.completed
event to determine if they have subscribed. Then use the subscription
id to obtain information about the subscription. This this the correct event to use?
#2a and #2b
I do not know what event to use here. There are so many events I get like charge.succeeded
, payment_intent.succeeded
, invoice.finalized
, invoice.paid
etc. Which do I use to determine if the customer has paid or not paid and extend or end their subscription?
#3a and #3b
Assuming I use invoice.payment_succeeded
for #3a. Which events do I use to determine the invoice information?
#4a and #4b
This is things I do on my website from the information I obtained from Stripe. How I can convert Stripe's timezone in Sydney/Australia timezones.
Upvotes: 6
Views: 2486
Reputation: 2011
#1 -> You can use checkout.session.completed
to determine if your customer has finished the checkout flow of the subscription. However, it event doesn't guarantee the payment is succeeded or subscription is active because the payment confirmation can be delayed. Some payment methods (i.e., BECS debit) might take days to process. If you only want to allow your customer to start using your service when the first invoice of the subscription is paid. I'll recommend you to listen to invoice.paid
or invoice.payment_succeeded
, and also check if the associated subscription status has become active
.
#2a -> You can listen to invoice.paid
or invoice.payment_succeeded
events. The difference between these two is that invoice.paid
is also fired for out-of-band payments. If you only use Stripe to process payments then you can just listen to invoice.payment_succeeded
.
#2b -> You can use invoice.payment_failed
to track for the events when your customers payments are unsuccessful. However, there's no events to notify you if your customer doesn't attempt to make a payment at all.
#3a -> Stripe can help you send the invoice emails on your behalf. If you want more branding exposure, there are options to customize the logo, color and even the sender email address.
#3b -> You can configure to send payment reminder emails, and as configured in your subscription lifecycle settings, a subscription may cancel automatically after up to four unsuccessful attempts to bill the customer.
#4 -> Stripe uses UTC for all time-related resource, you should be able to easily convert it to any timezone with language's built-in utility.
Upvotes: 12