This chapter covers the core features and capabilities of Payment Retry Logic.
# Run the full demo
python src/payment_retry_logic.py --action demo
# Classify an error code
python src/payment_retry_logic.py --action classify --error-code insufficient_funds
# Schedule a retry
python src/payment_retry_logic.py --action schedule --payment-id pay_001 --error-code network_error
# View backoff tables
python src/payment_retry_logic.py --action backoff-table
# Process pending retries
python src/payment_retry_logic.py --action process-queueFollow this guide to get Payment Retry Logic up and running in your environment.
| Flag | Description |
|---|---|
--action, -a | Action to perform (required) |
--error-code | Payment error code to classify |
--payment-id | Payment ID for retry scheduling |
--task-id | Retry task ID for execution |
--amount | Payment amount in cents |
--simulate-success | Simulate a successful retry |
--data-dir | Data storage directory (default: ./retry_data) |
--verbose, -v | Enable debug logging |
| Category | Retryable | Strategy |
|---|---|---|
soft_decline | Yes | Retry after 1-24 hours |
hard_decline | No | Ask customer to update payment |
network_error | Yes | Retry in 1-15 minutes |
fraud | No | Never retry |
processing_error | Yes | Retry in 15-60 minutes |
authentication | No | Redirect customer to 3DS |
rate_limit | Yes | Exponential backoff from 2 min |
Get the full Payment Retry Logic and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.