PAY-26Recommended
Let the provider run the billing schedule
Use the payment provider's subscription engine for renewals, proration and retries, and mirror its state in your database from events.
How to do it
Renewal dates, time zones, short months, proration and retries are easy to get wrong. A billing engine such as Stripe Billing, Chargebee or Paddle has solved them. Store the subscription ID, status, price ID and current period end. Change them only from provider events and API reads, as in events drive fulfilment. Never charge renewals from your own scheduled job. Events can arrive out of order, so follow Don't rely on event order.
How to check
Search the code for scheduled jobs that create charges. None exist. Every write to the subscriptions table comes from the event handler or the sweep job.
Sources
Related rules
- PAY-18 Let provider events move the order in Payments and billing
- EVT-12 Don't rely on event order in Integration and events
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/payments/subscriptions/provider-billing-engine">Agent Wranglers payments and billing playbook</a>. In code you write, add a comment next to it with the same link.