How hirotomasato/paygateme works
PayGateMe is a Go SDK for Shopee and GoPay merchant payments. Its main workflow is provider authentication (OTP or restored session), merchant/store and QRIS setup, payment creation with a unique amount and dynamic QR, then transaction-feed polling and settlement callbacks. The graph includes both provider integrations, shared payment reconciliation, and QRIS conversion. Some wiring is documented in the README rather than shown in sampled source; those relationships are limited to documented calls and data flow.
Main entry points: service.go Payment service · provider.go Shopee provider · gopay/http.go GoPay HTTP client · shopee/http.go Shopee HTTP client
Components 23
Shared domain
- Domain types/errors
core - Shared utilities
utils
Shopee provider
- Shopee provider
shopee/provider.go - OTP and SSO auth
shopee/auth.go - Shopee HTTP client
shopee/http.go - Merchant and stores
shopee/merchant.go - Shopee transaction feed
shopee/feed.go - Shopee API
GoPay provider
- GoPay provider
- OTP and token auth
gopay/auth.go - Token manager
gopay/token.go - GoPay HTTP client
gopay/http.go - Merchant profile
gopay/merchant.go - GoPay transaction feed
gopay/feed.go - GoID and GoBiz APIs
Payment runtime
- Payment service
payment/service.go - Unique amount allocator
payment/allocator.go - Settlement matcher
payment/matcher.go - Payment store
payment/store.go - QRIS parse and convert
qris/convert.go - EMV and CRC
qris/emv.go
Other components
- SDK caller
- Payment callbacks
Connections 33
- SDK caller → Shopee provider: calls
- Shopee provider → OTP and SSO auth: delegates auth
- Shopee provider → Merchant and stores: manages merchant
- Shopee provider → Payment service: creates service
- Shopee provider → QRIS parse and convert: binds and converts
- OTP and SSO auth → Shopee HTTP client: sends requests
- Merchant and stores → Shopee HTTP client: sends requests
- Shopee transaction feed → Shopee HTTP client: fetches feed
- Shopee HTTP client → Shopee API: HTTP requests
- SDK caller → GoPay provider: calls
- GoPay provider → OTP and token auth: delegates auth
- GoPay provider → Merchant profile: resolves profile
- GoPay provider → Payment service: creates service
- GoPay provider → QRIS parse and convert: uses static QRIS
- OTP and token auth → GoPay HTTP client: sends requests
- Token manager → OTP and token auth: refreshes through
- GoPay HTTP client → Token manager: gets valid token
- Merchant profile → GoPay HTTP client: sends requests
- GoPay transaction feed → GoPay HTTP client: fetches feed
- GoPay HTTP client → GoID and GoBiz APIs: HTTP requests
- Payment service → Unique amount allocator: allocates amount
- Payment service → Payment store: reads and writes
- Payment service → Shopee transaction feed: fetches transactions
- Payment service → GoPay transaction feed: fetches transactions
- Payment service → Settlement matcher: reconciles feed
- Payment service → QRIS parse and convert: builds payment QR
- QRIS parse and convert → EMV and CRC: parses and builds
- EMV and CRC → Shared utilities: computes CRC
- Payment service → Payment callbacks: emits settlement
- OTP and SSO auth → Shared utilities: validates phone
- Shopee provider → Domain types/errors: uses domain types
- Payment service → Domain types/errors: uses payment types
- Settlement matcher → Domain types/errors: matches transactions