Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Arjun16-png/txnflow-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TxnFlow Engine

A simple payment transaction simulation system built with Go.


🚀 Features

  • 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

📦 API Endpoints

Create Transaction

POST /transactions

Request: { "amount": 150000 }

Response: { "id": "TXN-xxxx", "amount": 150000, "status": "PENDING", "iso_code": "", "message": "Awaiting processor result" "idempotency_key": "unique-key" }


Complete Transaction

POST /simulate/complete?id=TXN-xxxx

Request: { "iso_code": "51" }

Response: { "id": "TXN-xxxx", "amount": 150000, "status": "FAILED", "iso_code": "51", "message": "Insufficient funds" }


🔁 Transaction Flow

Create Transaction → PENDING

Complete Transaction

SUCCESS (00) | FAILED (others) | RETRY (91)


🧠 ISO 8583 Codes

00 → Approved
14 → Invalid card
51 → Insufficient funds
54 → Expired card
91 → Issuer unavailable


🛠 Tech Stack

  • Go (net/http)
  • Playwright (API Testing)
  • In-memory storage (map)

▶️ Run Locally

Start backend:

go run .

Run Playwright API tests:

npx playwright test


🧪 Test Coverage

  • Create transaction success
  • Idempotency validation (same request returns same transaction)
  • Retry scenario (ISO 91 → RETRY)
  • Full flow regression (PENDING → SUCCESS with history validation)

🎯 Purpose

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.

About

Payment transaction simulation system with idempotency, retry logic, and API test automation (Go + Playwright)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors