Payment Service
serviceCollects payments for finalised invoices and reconciles settlements.
- Owner
- Payments Team
- Technology
- Go
- Runtime
- Go 1.22
- Surface
- 11 endpoints · 3 events
kimtu/paymentsdocs/overview.mdb4d7f52last commit 9 hours ago by @skoval
Written by the team in docs/overview.md · rendered by Kimtu, ownership and connections below are generated
Overview
Payment Service attempts collection when an invoice is finalised, talks to the payment provider, and reports the outcome back onto the bus.
Responsibilities
- Consumes invoice.finalized and schedules collection attempts
- Calls the external payment provider with idempotency keys
- Emits payment.settled and payment.failed
- Stores attempts and settlement records
This repository has no mkdocs.yml, so pages are ordered by folder structure.
Connections
UpstreamPayment ServiceDownstream
| Component | Direction | Contract |
|---|---|---|
| API Gateway | Called by | REST /v1/payments · PaymentAttempt |
| Event Bus | Consumes | amqp · invoice.finalized |
| Event Bus | Calls | amqp · payment.settled, payment.failed |
| Payment Provider | Calls | POST /charges · ChargeRequest, ChargeResult |
| Postgres · payments | Calls | postgres · PaymentAttempt, Settlement |
Published events
events/payment.settled.json
1{2 "type": "payment.settled",3 "version": 2,4 "data": {5 "payment": "pay_31c8",6 "invoice": "in_9d41",7 "amount": 48200,8 "settled_at": "2026-09-02T11:04:19Z"9 }10}Technology
GoPostgreSQLKafka