A simple payment transaction simulation system built with Go.
- Create transaction
- Complete transaction using ISO 8583 response codes
- Transaction lifecycle:
- PENDING → SUCCESS
- PENDING → FAILED
- Idempotency handling
- Retry logic for issuer unavailable scenarios
- Transaction history tracking
- Playwright API regression tests
POST /transactions
Request: { "amount": 150000 }
Response: { "id": "TXN-xxxx", "amount": 150000, "status": "PENDING", "iso_code": "", "message": "Awaiting processor result" "idempotency_key": "unique-key" }
POST /simulate/complete?id=TXN-xxxx
Request: { "iso_code": "51" }
Response: { "id": "TXN-xxxx", "amount": 150000, "status": "FAILED", "iso_code": "51", "message": "Insufficient funds" }
Create Transaction → PENDING
↓
Complete Transaction
↓
SUCCESS (00) | FAILED (others) | RETRY (91)
00 → Approved
14 → Invalid card
51 → Insufficient funds
54 → Expired card
91 → Issuer unavailable
- Go (net/http)
- Playwright (API Testing)
- In-memory storage (map)
Start backend:
go run .
Run Playwright API tests:
npx playwright test
- Create transaction success
- Idempotency validation (same request returns same transaction)
- Retry scenario (ISO 91 → RETRY)
- Full flow regression (PENDING → SUCCESS with history validation)
This project simulates real-world payment transaction flows, including:
- Status transitions
- Failure handling
- ISO 8583 response mapping
Built to demonstrate system-level thinking for SDET / QA Automation roles.