How mageg-x/gopay works
GoPay is an aggregate payment gateway with a Vue merchant/admin interface and a Go HTTP backend. The primary workflow is a payer selecting a payment method in the cashier, submitting an order, and completing payment through a configured provider; merchants then track orders and manage funds, while administrators configure channels and operations. The graph also preserves documented risk, settlement, transfer, plugin, and management capabilities. Several backend implementation links are based on documented responsibilities and module paths; the sampled backend excerpts do not show all call sites.
Main entry points: pay.go Payment endpoints · admin.go Admin endpoints · model Domain models · router.go HTTP router
Components 24
Web experience
- Cashier UI
web/src/views/cashier/index.vue - Merchant portal
web/src/views/user - Admin console
web/src/views/admin - Web API clients
web/src/api - Web router
web/src/router/index.ts
HTTP application
- HTTP router
server/src/router/router.go - Payment endpoints
server/src/handler/api/pay.go - Merchant endpoints
server/src/handler/user/user.go - Admin endpoints
server/src/handler/admin/admin.go
Payment processing
- Order service
server/src/service/order.go - Payment service
server/src/service/payment.go - Plugin interface
server/src/plugin/interface.go - Alipay and WeChat
server/src/plugin/channels - Risk controls
server/src/service/risk.go
Merchant operations
- Authentication
server/src/service/auth.go - Settlement service
server/src/service/settle.go - Transfer service
server/src/service/transfer.go - Profit sharing
server/src/service/profitsharing.go - Domain models
server/src/model - SQLite database
server/src/config/config.go
Other components
- Payer
- Merchant
- Administrator
- Payment providers
Connections 30
- Payer → Cashier UI: opens cashier
- Cashier UI → Web API clients: requests payment
- Merchant → Merchant portal: uses portal
- Administrator → Admin console: uses console
- Merchant portal → Web API clients: requests data
- Admin console → Web API clients: requests management
- Web router → Cashier UI: routes to
- Web router → Merchant portal: routes to
- Web router → Admin console: routes to
- Web API clients → HTTP router: calls API
- HTTP router → Payment endpoints: dispatches payment
- HTTP router → Merchant endpoints: dispatches merchant
- HTTP router → Admin endpoints: dispatches admin
- Payment endpoints → Authentication: validates signatures
- Payment endpoints → Risk controls: checks risk
- Payment endpoints → Order service: manages orders
- Payment endpoints → Payment service: processes payment
- Payment service → Plugin interface: uses interface
- Alipay and WeChat → Plugin interface: implements
- Alipay and WeChat → Payment providers: requests payment
- Merchant endpoints → Authentication: authenticates
- Admin endpoints → Authentication: authenticates
- Admin endpoints → Settlement service: manages settlements
- Admin endpoints → Transfer service: manages transfers
- Admin endpoints → Profit sharing: manages sharing
- Order service → Domain models: uses order data
- Settlement service → Domain models: uses settlement data
- Transfer service → Domain models: uses transfer data
- Profit sharing → Domain models: uses sharing data
- Domain models → SQLite database: persists records