Skip to content

v0.1.0

Choose a tag to compare

@AkibUllah AkibUllah released this 25 Oct 11:55

First public release of FastAPI Payment Gateway.

Highlights

  • Provider adapter pattern: BkashAdapter, SSLCommerzAdapter, StripeAdapter (sandbox) and a MockProvider for tests, all behind one PaymentProvider protocol
  • Payment lifecycle state machine (CREATED → AUTHORIZED → CAPTURED → PARTIALLY_REFUNDED/REFUNDED, plus FAILED/CANCELLED); illegal transitions are rejected with HTTP 409 and never persisted
  • Idempotency-Key header on create/capture/refund: stored responses are replayed byte-for-byte, reuse with a different body is rejected
  • Merchant API keys stored as SHA-256 hashes with a lookup prefix; per-merchant data isolation
  • Outgoing merchant webhooks signed with HMAC-SHA256 (X-Gateway-Signature: t=…,v1=…), bounded retries, delivery log queryable via the API
  • Inbound provider webhook verification (bare HMAC for bKash/SSLCommerz, timestamped Stripe-style signature with replay window) with idempotent event application
  • Fee-aware routing: cheapest provider for a currency/method pair, overridable per request; fees computed in basis points with half-up integer rounding, no floats anywhere near money
  • Full and partial refunds with refundable-balance enforcement; partial captures re-quote the fee
  • Daily settlement batches per provider and currency, CSV export, reconciliation that diffs the provider report against the ledger (mismatches, missing, unexpected) and a PAID close-out
  • Health endpoint, request-id middleware, structured error envelope, OpenAPI docs at /docs

Getting started

Quality

  • Full test suite, lint and build run in CI on every push and pull request.
  • MIT licensed.