Sale
- Description: Create sale payment, supports WeChat Pay and Alipay payment method
- Path:
/direct/sale
- Method:
POST
- Request Header:
Content-Type: application/json
#
Request ParametersParameter | Type | Required | Description |
---|---|---|---|
merchantId | string | Required | Merchant identifier |
amount | number | Required | The payment amount |
merchantReference | string | Required | A reference for you to identify this payment, must be unique |
paymentType | string | Required | Payment type. Value can be ALIPAY , ALIPAYHK , WECHAT |
paymentTerminal | string | Required | Payment terminal type. Value can be SDK : mobile SDK, WAP : mobile browser, PCWEB : PC browser |
notifyUrl | string | Optional | An API URL in merchant's backend to receive notification |
referer | string | Optional | The website URL where customers are visiting it from |
userAgent | string | Optional | The characteristic string of the browser application, common format: User-Agent: Mozilla/5.0 (<system-information>) <platform> (<platform-details>) <extensions> |
postLink | string | Optional | The URL posted the payment request |
merchantSite | string | Optional | Merchant's own website URL |
lineItems | array | Required | |
lineItems[index].quantity | number | Required | Number of items, must be an integer, must be an integer |
lineItems[index].priceData | object | Required | Price data object with details |
lineItems[index].priceData.unitAmount | number | Required | Unit amount of the item |
lineItems[index].priceData.name | string | Required | Name of the item |
Example request:
#
Response ParametersParameter | Type | Required | Description |
---|---|---|---|
responseCode | string | Required | Payment Gateway response code |
message | string | Required | Payment Gateway response message |
wechatOrder | object | Optional | |
wechatOrder.appId | string | Optional | This identifier is issued after vendors apply for official account supporting WeChat payment |
wechatOrder.partnerId | string | Optional | Specifies vendor ID assigned by WeChat Payment. It is the sub mch_id when calling the unified order API |
wechatOrder.packageValue | string | Optional | WeChat package value |
wechatOrder.nonceStr | string | Optional | Random string to ensure unpredictability for signatures |
wechatOrder.timeStamp | string | Optional | Specifies the current time |
wechatOrder.sign | string | Optional | Specifies a signature |
alipayData | string | Optional | Alipay response data |
checkoutUrl | string | Optional | URL for generating payment QRCode or redirecting to payment webpage |
#
Example Response:caution
The response varies under different paymentTerminal
values.
- SDK
- WAP
- PCWEB
Example Wechat Pay Response
Example Alipay Response
Example Wechat Pay Response
Example Alipay Response
Example Wechat Pay Response
Example Alipay Response