ProcessDunning job is queued and scheduled hourly by the service provider, works through your configured retry sequence, and optionally cancels subscriptions that exhaust all retries.
How dunning works
When a payment fails, Subscribd marks the subscription aspast_due and records the failure. On each subsequent scheduler run, the package checks whether enough time has passed since the last attempt and, if so, retries the charge. If the retry succeeds, the subscription returns to active. If all retries fail and cancel_after_final_retry is true, the subscription is canceled automatically.
Configure the retry schedule
Openconfig/subscribd.php and set the dunning block:
retries array defines the delay in hours between each attempt after the initial failure. The example above retries after 1 day, 3 days, and 7 days — three total retries. You can add or remove entries to suit your billing policy.
Configuration reference
| Key | Type | Description |
|---|---|---|
enabled | bool | Set to false to disable dunning entirely |
retries | int[] | Hours to wait before each successive retry attempt |
cancel_after_final_retry | bool | Cancel the subscription when all retries are exhausted |
No manual scheduling required
TheProcessDunning job is registered with Laravel’s scheduler automatically by Subscribd’s service provider. As long as your application runs php artisan schedule:run on its normal cadence (typically every minute via cron), dunning retries fire without any additional configuration.
The scheduler fires hourly and checks each
past_due subscription against the retry schedule. Only subscriptions whose next retry time has elapsed are processed, so the job remains efficient even at scale.Responding to dunning events
Use thePaymentFailed and SubscriptionCanceled events in your EventServiceProvider to notify customers at each stage. See the Webhooks guide for listener examples.