Skip to main content

Alipay in-APP Payments

Alipay APP Payment process-flow

To download Alipay Oversea SDK , please refer to this link.
To download Alipay HK SDK, please refer to this link.
To know how to trigger Alipay HK SDK , please refer to this link.

HTTP Request

Endpoint : /trade/v1/payment

Method : POST

PayType :

PayTypeDescription
801110Oversea Merchants
801510Hong Kong Merchants

Request Parameters


Request Body:

txamt=1&txcurrcd=HKD&pay_type=801510&out_trade_no=052711570017898&txdtm=2021-05-27+11%3A57%3A00&goods_name=goods_name&goods_info=goods_info&mchid=nDB64h9qJ1An&trade_name=trade_name&goods_detail=goods_detail&return_url=http%3A%2F%2Fwww.qfpay.com%2F&pay_tag=ALIPAYHK&seller_id=testoverseas9191%40alipay.com

QFPay Response:

{
"pay_type": "801510",
"sysdtm": "2021-05-27 11:57:02",
"paydtm": "2021-05-27 11:57:02",
"udid": "qiantai2",
"txcurrcd": "HKD",
"txdtm": "2021-05-27 11:57:00",
"txamt": "1",
"resperr": "交易成功",
"respmsg": "",
"out_trade_no": "052711570017898",
"syssn": "20210527154100020004180921",
"pay_params": {
"body": "goods_info",
"forex_biz": "FP",
"seller_id": "2088231067382451",
"secondary_merchant_id": "1000007081",
"service": "mobile.securitypay.pay",
"payment_inst": "ALIPAYHK",
"it_b_pay": "30m",
"secondary_merchant_name": "IFlare Hong Kong Limited (external) - online",
"_input_charset": "UTF-8",
"sign": "iU1yXUnsCK7rJAu0DoN61arVexbIfo3GLR5jr3QzjkZ29INSPhcA4e%2F2%2BdPrsf5huzQAkxVKP0CTfvaGPMYqNkxmhoaJWUH0ZhgYDgKugMvtweBvRqOX2W0h3A%2F%2FIdJuxeyOAuh7bHiuazSB3ZH%2BEQwRGP%2Bkk8Jpha930gHwPtw%3D",
"currency": "HKD",
"out_trade_no": "20210527154100020004180921",
"payment_type": "1",
"total_fee": 0.01,
"sign_type": "RSA",
"notify_url": "https://test-o2-hk.qfapi.com/trade/alipay_hk/v1/notify",
"partner": "2088231067382451",
"secondary_merchant_industry": "5941",
"product_code": "NEW_WAP_OVERSEAS_SELLER",
"return_url": "http://www.qfpay.com/",
"subject": "goods_name"
},
"respcd": "0000",
"chnlsn": "",
"cardcd": ""
}
Request using Alipay SDK:

(After you receive the content of pay_params, when you call Alipay SDK,
the orderinfo request parameters need to be adjusted in the following format:
Combine all the array values in the format of key="value", request parameters
in ascending order of parameter name, then use "&" to link the parameters,
"sign" and "sign_type" parameters need to be placed at the end.)

Sample:

_input_charset="UTF-8"&body="goods_info"&currency="HKD"&forex_biz="FP"&it_b_pay="30m"&notify_url="https://test-o2-hk.qfapi.com/trade/alipay_hk/v1/notify"&out_trade_no="20210527154100020004180921"&partner="2088231067382451"&payment_inst="ALIPAYHK"&payment_type="1"&product_code="NEW_WAP_OVERSEAS_SELLER"&return_url="http://www.qfpay.com/"&secondary_merchant_id="1000007081"&secondary_merchant_industry="5941"&secondary_merchant_name="IFlare Hong Kong Limited (external) - online"&seller_id="2088231067382451"&service="mobile.securitypay.pay"&subject="goods_name"&total_fee="0.01"&sign="iU1yXUnsCK7rJAu0DoN61arVexbIfo3GLR5jr3QzjkZ29INSPhcA4e%2F2%2BdPrsf5huzQAkxVKP0CTfvaGPMYqNkxmhoaJWUH0ZhgYDgKugMvtweBvRqOX2W0h3A%2F%2FIdJuxeyOAuh7bHiuazSB3ZH%2BEQwRGP%2Bkk8Jpha930gHwPtw%3D"&sign_type="RSA"

AttributeMandatoryTypeDescription
Public payment parametersPlease refer to the Public Payment Section for more details
goods_infoNoStringProduct description, must not contain special characters
pay_tagNoString(16)Payment mark, the default value is: ALIPAYHK
Alipay Continental version: ALIPAYCN
expired_timeNo
(MPM only)
String(3)Order expiration time, QRC expiration time in unit minutes. The default expiration time is 30 minutes. The parameter can manually be adjusted to a minimum of 5 minutes, and up to a maximum of 120 minutes.
Available for WeChat and Alipay

Response Parameters

AttributeSecondary AttributeDescription
pay_paramspartnerPartner
seller_idUnique Alipay user number referencing the Alipay payment account
subjectProduct name / transaction number / order number / order keyword, etc.
bodyA specific description of a transaction. If it refers to a basket of products, please accumulate the product description string in the body.
total_feeTotal amount
notify_urlNotification address
serviceService
cardcdCard number
payment_typePayment type
\_input_charsetEncoding format
it_b_payCustom timeout parameter
return_urlRedirect URL
payment_instPayment institution
currencyCurrency
product_codeProduct code
signRequired or not
sign_typeSignature type
secondary_merchant_idSecondary merchant identification
secondary_merchant_nameSecondary business name
secondary_merchant_industrySecondary merchant industry
chnlsnChannel coding
Public response parametersPlease refer to the Public Payment Section for more details