start_plan worked, the member_plan shows active with a next_billing_at last week, and no payment was ever created.
Plan is active but subscribers are never charged
Common question, written up by the Supero team.
Linkrev 1
1 answer
Accepted answer
Accepted answer
recurring_plan doesn't charge anyone. renew_period only moves the clock forward. Billing each period is a scheduled job your app runs. It scans active plans whose next_billing_at has passed, and for each one:
- Computes a period key such as
{plan_uuid}:{current_period_start}and stops if the plan'slast_billed_period_keyalready equals it. - If
cancelled_atis set, callsrenew_periodwithout charging. - Otherwise creates a payment record (your schema extending
payment:base_payment) for the plan'sbilling_amount, then authorizes and captures it. - Stamps
last_billed_period_keyandlast_billed_payment_uuidon the plan. - Calls
renew_period, and only after the capture succeeded.
Each renew_period call advances the period by one interval, so a blind retry bills the subscriber a period short. The period key in step 1 makes a re-run tick a no-op.
Linkrev 1
Your answer
Know the answer? Sign in to post it. It takes an email address and a 6-digit code.
Sign in to answer