Test the full lifecycle
Every integration should exercise:- Session or payment creation.
- Customer redirect or embedded checkout.
- Successful confirmation.
- Decline or failure.
- Customer cancellation.
- Session expiry.
- Duplicate create request with the same idempotency key.
- Duplicate and delayed webhook delivery.
- Refund and subscription cancellation.
What to assert
- The expected amount, currency, order ID, and metadata are retained.
- The API rejects invalid amounts, methods, origins, tokens, and webhook signatures.
- A retry with an idempotency key does not create a second payment.
- A browser return does not fulfill an order by itself.
- Webhook processing is safe to repeat.
- Fulfillment happens only after a verified confirmation event.
Local development
Use the repository’s local merchant and integration test commands fromzahlo-app. Keep test credentials and database URLs outside committed files. Use a disposable database for integration tests.