Repository navigation
Post MVP Improvements
Feature enhancements, reliability improvements, and documentation updates added after the initial MVP implementation.
Features
- [PAYGATE-20] Idempotency key support — Optional
Idempotency-Keyheader (UUID) on POST prevents duplicate bank charges on client retries. Cached responses are returned
without calling the bank again. - [PAYGATE-21] Luhn algorithm validation — Card numbers are validated against the Luhn checksum before contacting the bank, catching typos and clearly fake numbers early.
- [PAYGATE-22] HTTP 201 Created — POST
/v1/paymentnow returns201 Createdwith aLocationheader pointing to the created payment resource, following REST
conventions. - [PAYGATE-23] Retry with exponential backoff — Bank calls are retried up to 3 times (500ms base, 2x multiplier) on transient failures before falling through to the
circuit breaker. - [PAYGATE-24] Correlation ID in error responses — Non-validation errors (404, 429, 502, 500) now include
correlationIdandtimestampin the JSON body for
traceability. - [PAYGATE-25] Bank failure logging — Failed bank authorization attempts are logged with payment context (paymentId, cardLast4, currency, amount) for incident
investigation.
Tests
- [PAYGATE-26] Rejected payment verification — Added tests confirming that rejected payments (expired card, Luhn-invalid) are not stored and return 404 on GET.
Documentation
- [PAYGATE-27] Error reference — Added comprehensive
doc/ERROR_REFERENCE.mdcovering all error types, HTTP status codes, validation rules, and troubleshooting guide. - [PAYGATE-28] README and manual testing guide — Updated README and
doc/MANUAL_TESTING_GUIDE.mdwith all new features: idempotency, Luhn validation, 201 status, retry
config, correlation ID in errors.
Fixes
- [PAYGATE-29] Dockerfile JAR version — Replaced hardcoded JAR version in Dockerfile with wildcard glob to prevent build failures on version bumps.
- [PAYGATE-30] Luhn-valid test cards — Replaced test card numbers that fail Luhn validation with valid alternatives (declined:
2222405343248828, bank error:
2222405343248810).