# Ethiopian Payment Receipt Verifier (Golang)
An enterprise-grade, high-performance Go service to verify payment receipts from **Telebirr**, **CBE (Commercial Bank of Ethiopia)**, **BOA (Bank of Abyssinia)**, and **Amhara Bank** against expected transaction details.
Built with **Gin**, native Go goroutine worker pools, structured logging, rate limiting, and an extensible provider plugin architecture.
## Supported Banks & Digital Wallets
- **✓ Telebirr**
- **✓ CBE (Commercial Bank of Ethiopia)**
- **✓ BOA (Bank of Abyssinia)**
- **✓ Amhara Bank**
---
## Features
- **Extensible Provider Architecture (`providers/`)**: Modular `Provider` interface (`Name()`, `ParseID()`, `CanHandle()`, `Verify()`) allowing easy community contributions for new Ethiopian banks.
- **Parallel Batch Processing**: Concurrently verifies up to 10+ receipts using native Go goroutines and semaphore worker pools.
- **Asynchronous Webhooks**: Process large verification batches asynchronously by passing a `callbackUrl`.
- **Health Checks & Observability**:
- `GET /health` for Kubernetes / Docker liveness & readiness probes.
- `GET /metrics` for tracking uptime, request counts, valid vs. invalid counts.
- **Structured JSON Logging**: Powered by Go standard `log/slog` with auto-generated `X-Request-ID` tracing.
- **API Protection & Rate Limiting**:
- In-memory token-bucket rate limiter per client IP.
- Optional `API_KEY` authentication (`X-API-Key` header).
- **Proxy Support**: Configurable HTTP/HTTPS proxy support for Telebirr requests.
---
## Getting Started
### Clone & Setup
```bash
git clone
cd payment_verifier
cp .env.example .env
go mod download
```
### Environment Variables
Configure your expected payment details in `.env`:
```env
PORT=5000
API_KEY=your-optional-secret-key
PROXY=proxy-host:proxy-port:proxy-username:proxy-password
# Telebirr
TELEBIRR_EXPECTED_AMOUNT=100
TELEBIRR_EXPECTED_RECIPIENT_ACCOUNT=1000123456789
TELEBIRR_EXPECTED_RECIPIENT_NAME=Abrham Yalew
TELEBIRR_EXPEC …