Which case are you in
| Your situation | Go to |
|---|---|
| You use an existing system (card shop, panel, API relay) and wrote no code | It can only be configuration. See “Existing systems” |
| You wrote the integration and the gateway rejects your order | See “Your own code” |
| Orders work, but your system rejects the notification | See “Notification signatures” |
Existing systems: check the settings
- Copy
keyagain, paste and save. Make sure there are no leading or trailing spaces or line breaks. - Make sure
pidandkeycome from the same integration app. Do not mix values from two apps. - Make sure the key is in the right field. In legacy Dujiaoka, for example, the key goes into 商户密钥 while 商户 KEY holds the order URL.
- If the key was reset, the old one no longer works and every system using it must be updated.
For what goes into each field, see the guide for your system: Dujiaoka, ACG-Faka, New-API, One-Hub, Xboard / V2Board.
Your own code: follow the signing rules
Signing has four steps. Check them one by one:
- Filter: drop
sign,sign_typeand any parameter with an empty value. - Sort: order by parameter name, ASCII ascending (a→z).
- Join: build
k1=v1&k2=v2without URL-encoding the values. - Sign: append the merchant key directly to the end, with no
&key=separator, then take the 32-character lowercase MD5.
Test your code with the data below. The key is a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6. If you do not get the same result, the bug is in your signing function:
String to sign (then append the key directly):
clientip=1.2.3.4&money=1.00&name=VIP会员¬ify_url=https://shop.com/notify&out_trade_no=MCH20260728001&pid=100001&return_url=https://shop.com/return&type=alipay
MD5 result:
77c46b1a2cb7063f4d01003379863f5e| Common mistake | Details |
|---|---|
| URL-encoding values before signing | The most common one. Non-ASCII text, :// and & are signed as-is; encoding happens only when the request is sent |
| Including empty parameters | If you send an empty parameter such as param=, it must not appear in the string to sign |
Adding &key= before the key | EPay appends the key right after the last value with no separator |
| Uppercase MD5 | It must be 32 lowercase characters |
| Sending a different value than you signed | A product name with surrounding spaces or angle brackets, or an amount signed as 1.00 but sent as 1, causes intermittent failures |
The full step-by-step example is under Signing, and ready-made code is under Code samples.
Notification signatures
The async notification is a GET request to your notify_url with parameters in the query string. It is verified by the same rules, plus three things to watch:
- Verify with the URL-decoded values. Most frameworks decode them for you, so use those values rather than parsing the raw URL yourself.
- Use only the parameters the platform sent. Parameters added by your framework or rewrite rules, such as routing parameters, must not be included.
- Drop
sign,sign_typeand empty parameters here as well.
Still failing
Send official support the string to sign without the key together with the sign you computed. Never expose the key in a group chat or screenshot; if you already did, ask support to reset it.
For other errors see Troubleshooting; for protocol details see Signing and Async notification.
More integration docs
Get your merchant ID and key
Contact official support to open an integration app. Your gateway URL, pid and key are issued directly, with hands-on help during testing.
Contact support