Alipay
Channel Overview
Alipay is China's largest third-party payment platform. DaxPay supports both direct and ISV (service provider) integration, covering QR code, JSAPI, APP, H5, PC web, and barcode methods, with profit-sharing receivers and transfers supported as well.
The full integration tutorial for Alipay (direct) — channel-side preparation, key configuration, sandbox testing, public-key vs certificate modes — lives in Channel Integration; this page is the parameter and structure reference.
Payment Products
| Product | Mode | Suitable for |
|---|---|---|
alipay (direct) | Merchant direct | Merchants with their own Alipay merchant account |
alipay_isv (ISV) | ISV collects on behalf of sub-merchants | Service providers collecting for contracted merchants |
Supported Payment Methods
| Method | Description | Prerequisite |
|---|---|---|
alipay_qr (QR code) | Returns a QR code for the user to scan | — |
alipay_jsapi (JSAPI) | In-app invocation, including mini-programs | Requires openId; app type must be mini-program |
alipay_app (APP) | Invokes Alipay from the merchant app | App type must be mobile app |
alipay_h5 (H5) | Payment inside a mobile web page | — |
alipay_pc (PC web) | Payment on a desktop website | — |
alipay_barcode (barcode) | Merchant scans the user's payment code | — |
Configuration Structure
Alipay is organized in three layers — channel merchant → app → app keys. Keys are configured per app, not per channel merchant:
- Create the channel merchant: Merchant Workbench → Channel Merchants → Create, pick the product and fill in:
- Direct: merchant name + Alipay merchant user ID (the PID starting with
2088) - ISV: merchant name + Alipay app (dropdown) + sub-merchant ID + app authorization token (can be added later)
- Direct: merchant name + Alipay merchant user ID (the PID starting with
- Register apps (direct: Channel Merchant Detail → App Management; ISV: the "Alipay ISV Apps" page): app name, app type (mini-program / mobile app / web app), and the Alipay AppId
- Configure app keys: App detail → Key Configuration, pick one auth type:
| Group | Field | Notes |
|---|---|---|
| Basic | Environment | Production / sandbox |
| App ID | Alipay AppId | |
| Auth type | Public key mode or certificate mode | |
| Keys (public-key mode) | Alipay public key | From the open platform "Keys" page |
| App private key | Generated by the key tool | |
| Certificate mode | App public key cert / Alipay public key cert / Alipay root cert | All three are required; more secure |
| Communication key | AES communication key | Optional |
Callback Handling
- Async notifications are POSTed to the callback URL; the platform verifies, updates the order, and answers
success; WAIT_BUYER_PAYis an intermediate state, not a payment success — the platform records and ignores it;- Callback URLs are generated by the platform; no per-app configuration in the Alipay console is needed.
Notes
- Switch the environment before creating merchants: keep one set of channel merchants per environment; mismatched merchants are excluded by routing;
- Certificate mode is more secure and recommended for production;
- JSAPI requires an openId and a mini-program type app;
- The sub-merchant authorization token expires; update it from the channel merchant detail ("app authorization token") manually or via delegated authorization;
- See the FAQ for troubleshooting.