SDK Download
To begin integration, download the official SDK packages below:HTTP Request
Endpoint :/trade/v1/paymentMethod :
POST
| PayType | Description |
|---|---|
801110 | Alipay In-App (Overseas Merchants) |
801510 | Alipay In-App (HK Merchants) |
Required Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
txamt | Yes | Int | Transaction amount in cents. Example: 100 = $1 |
txcurrcd | Yes | String(3) | Currency code (e.g. HKD) |
pay_type | Yes | String(6) | Use 801110 for Alipay CN, 801510 for AlipayHK |
out_trade_no | Yes | String(128) | Unique merchant transaction ID |
txdtm | Yes | String(20) | Format: YYYY-MM-DD hh:mm:ss |
goods_name | Yes | String | Product name |
return_url | Yes | String | Redirect URL after payment |
seller_id | Yes | String | Alipay seller account |
mchid | Yes | String(16) | QFPay assigned Merchant ID |
Optional Parameters
| Parameter Name | Parameter Key | Required | Type | Description |
|---|---|---|---|---|
| Product Description | goods_info | No | String | Required by Alipay. Special characters are not allowed. |
| Payment Tag | pay_tag | No | String(16) | Default: ALIPAYHK For Alipay Mainland use: ALIPAYCN |
| Order Expiry Time | expired_time | No (Main-scan only) | String(3) | Expiration time in minutes. Default is 30 minutes. Min: 5, Max: 120. Applicable to WeChat Pay and Alipay |
Sample Request (Form Payload)
Response Fields (pay_params)
These fields are returned by QFPay and should be passed into the Alipay SDK.| Parameter Key | Sub Parameter Key | Description |
|---|---|---|
pay_params | partner | Partner ID |
seller_id | Unique Alipay user ID of the receiving account | |
subject | Product title / trade title / order title | |
body | Detailed description of the transaction. For multiple items, concatenate descriptions into this field | |
total_fee | Total order amount | |
notify_url | Notification callback URL | |
service | Service name | |
cardcd | Card number | |
payment_type | Payment type | |
_input_charset | Character encoding format | |
it_b_pay | Custom timeout parameter | |
return_url | Redirect URL after payment | |
payment_inst | Payment institution | |
currency | Currency code | |
product_code | Product code | |
sign | RSA signature (Required) | |
sign_type | Signature type | |
secondary_merchant_id | Secondary merchant ID | |
secondary_merchant_name | Secondary merchant name | |
secondary_merchant_industry | Secondary merchant industry | |
chnlsn | Channel transaction number | |
| Common Response Parameters | — | — |
Sample QFPay Response
Using Alipay SDK
After receiving thepay_params in the response, construct the orderInfo string required by the SDK in the following format:
- Join all fields in the format:
key="value" - Sort keys in ascending order (alphabetical)
- Concatenate with
& - Place
signandsign_typeat the end
Sample
Make sure you:
- Follow the correct SDK version and region (HK vs CN)
- Use the exact
keynames andvaluesreturned inpay_params - Keep your sign logic consistent with Alipay SDK format
