Core Positioning
The Pay Payment Center is the platform’s “unified checkout counter.” The mall sells goods and needs to collect payments, ERP procurement needs to make payments, member top-ups need to collect payments — all these payment and collection scenarios are handled uniformly through the Payment Center, without business modules needing to care whether the underlying payment method is WeChat Pay or Alipay.
In one sentence: Integrate with the Payment Center once, and all business modules can collect and make payments.
Problems Solved
| Pain Point | How Payment Center Solves It |
|---|---|
| Each business separately integrates WeChat/Alipay | Unified integration once, all businesses reuse |
| Payment channel switching requires changing business code | Channel changes are transparent to business |
| Payment callback handling is scattered | Unified callback → dispatch to each business module |
| Payment records are nowhere to be found | Payment Center records all transactions, unified reconciliation |
User Roles
Integrate payment APIs
Handle payment callbacks"] ADMIN2["Operations/Finance
View payment records
Process refunds
Reconciliation"] ENDUSER["End User
Initiate payments
View payment results"] end
Architecture Design
Order Payment"] ERP2["ERP
Purchase Payment"] OTHER["Other Modules
Top-up/Transfer"] end subgraph PaymentCenter["Payment Center yudao-module-pay"] API_LAYER["API Layer
PayOrderApi / PayRefundApi"] CHANNEL["Channel Adapter Layer
PayClient Unified Client"] CALLBACK["Callback Handling Layer
Unified Callback → Dispatch to Business"] end subgraph ChannelLayer["Payment Channels"] WXPAY["WeChat Pay
Official Account/Mini Program/QR Code"] ALIPAY["Alipay
PC/Wap/Transfer"] MOCK["Mock Payment
For development/debugging"] end BusinessLayer --> API_LAYER API_LAYER --> CHANNEL CHANNEL --> ChannelLayer ChannelLayer --> CALLBACK CALLBACK --> BusinessLayer
Payment Application Design
Callback URL: /mall/order/callback
Order Prefix: MALL-"] APP2["Payment App: ERP Procurement
Callback URL: /erp/purchase/callback
Order Prefix: ERP-"] APP3["Payment App: Member Top-up
Callback URL: /member/recharge/callback
Order Prefix: MBR-"] end
Each business module corresponds to a “payment application” with independent callback URL and order number prefix, ensuring payment callbacks are accurately routed to the correct business processing logic.
Full Payment Flow
Supported Payment Methods
| Channel | Payment Method | Use Case |
|---|---|---|
| WeChat Pay | Official Account Payment | WeChat Official Account H5 store |
| WeChat Pay | Mini Program Payment | WeChat Mini Program store |
| WeChat Pay | Transfer | Commission withdrawal, refunds |
| Alipay | PC Payment | PC-side store |
| Alipay | Wap Payment | Mobile H5 store |
| Alipay | Transfer | Commission withdrawal, refunds |
| Mock Payment | Mock | Development/debugging, no real account needed |
Dependencies
Mall E-Commerce → Pay Payment Center ← ERP Purchase-Sales-Inventory
↑
System Management Module (Permissions)
Both Mall and ERP depend on the Payment Center, which depends on the System Management module for permissions and configuration management.