For recurring billing with Stripe integration, when it comes time for the user's next bill to be generated, does
- ASP.NET Zero generate the invoice, and then sends a payment request to Stripe, then ASP.Net Zero marks the invoice as paid when the Webhook is called by Stripe? OR
- Stripe initiates the recurring payment request and then call the Webhook to let ASP.NET Zero know that the invoice was paid, and then ASP.NET Zero creates the invoice, marked as paid. [I guess, in this case, if something went wrong in Stripe and the Webhook is never called, there would never be a new Invoice in ASP.Net Zero and the user's account would be made inactive (or moved to a new addition) after the grace period, with no visible "unpaid invoice"? OR
- something else?
Thanks in advance for your reply.
-Eric
2 Answer(s)
-
0
Hi @eric_pulaski
Your understanding is correct, and among the options you listed, the second one is how ASP.NET Zero + Stripe recurring billing actually works.
What Really Happens in Recurring Billing
Stripe is fully responsible for recurring billing. ASP.NET Zero is passive in this flow.
The actual sequence is:
Stripe initiates the recurring charge
- When the subscription was first created, ASP.NET Zero created a Stripe Subscription
- For each billing cycle, Stripe automatically generates its own invoice and charges the customer
- ASP.NET Zero does not generate an invoice or send any payment request for renewals
Stripe notifies ASP.NET Zero via webhook
- When the payment succeeds, Stripe sends an
invoice.paidwebhook - ASP.NET Zero listens for this event (specifically
billing_reason == subscription_cycle) - At this point, ASP.NET Zero reacts to Stripe it does not initiate anything
- When the payment succeeds, Stripe sends an
ASP.NET Zero creates its internal record retroactively
Upon receiving the webhook:
- A
SubscriptionPaymentrecord is created - It is immediately marked as Paid
- The tenant’s
SubscriptionEndDateUtcis extended
- A
So to be explicit:
ASP.NET Zero does not create an invoice first and then wait for Stripe to pay it. Stripe creates and pays the invoice first, then ASP.NET Zero records the result.
If the Webhook Never Arrives
Your assumption here is also correct:
- No
SubscriptionPaymentrecord is created in ASP.NET Zero - There is no unpaid invoice concept for recurring payments on the ASP.NET Zero side
- The system relies solely on
SubscriptionEndDateUtc
Then:
SubscriptionExpirationCheckWorkerdetects expirationAfter
WaitingDayAfterExpire:- Tenant is deactivated or
- Moved to
ExpiringEditionId
Notification email is sent
A missed webhook means the system behaves as if the payment never happened, even if Stripe actually charged the customer.
Stripe owns the recurring billing lifecycle; ASP.NET Zero only listens to Stripe webhooks and records successful payments after the fact it never proactively generates renewal invoices or payment requests.
If you have any questions, please do not hesitate to contact us.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks. I really appreciate the detailed response. Just the info I needed.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)