Contract first, adapter second
Own an internal interface for each integration. Keep vendor-specific details behind an adapter so a provider change does not ripple through the whole product.
Make failures visible
- Use idempotency keys on creates and payments.
- Retry with backoff for transient network errors.
- Dead-letter failed events instead of dropping them.
- Alert on webhook lag and repeated 4xx/5xx patterns.
