Unified Payment API
Endpoint
POST {BASE_URL}/api/v2.0/payments/pay
The unified payment API supports various payment scenarios, and the specific payment scenario can be designated based on the scenarioCode.
For different scenarioCode, the required parameters may vary slightly. Please reference to Request Body for more details.
Create a QR Code order ONLINE_QRCODE
QR Code orders are suitable for payment via PC and mobile browsers. Customer pay by scanning QR code with WeChat or Alipay.
Payment Methods
- Pay by scanning the QR code generated from merchant payment page. Using:
paymentQRImage: Base64-encoded QR code image, this can be directly used as the "src" attribute of the "img" tag;paymentUrl: Payment URL that can be used to generate the QR code.
- Using
payUrlfor redirecting to AlphaPay payment page.
QR Code Request Body
{
"scenarioCode": "ONLINE_QRCODE",
"paymentRequestId": "string",
"order": {
"orderAmount": {
"value": "string",
"currency": "CAD"
},
"description": "string",
"notifyUrl": "string",
"redirectUrl": "string"
},
"paymentMethod": {
"paymentMethodType": "Alipay"
}
}
QR code Response
{
"scenarioCode": "ONLINE_QRCODE",
"paymentRequestId": "string",
"order": {
"orderAmount": {
"value": "string",
"currency": "CAD"
},
"notifyUrl": "string",
"redirectUrl": "string",
"description": "string"
},
"paymentMethod": {
"paymentMethodType": "string",
},
"paymentInfo": {
"paymentUrl": "string",
"paymentQRImage": "string",
"payUrl": "string"
},
"paymentCreateTime": "2019-08-24T14:15:22Z",
"paymentExpireTime": "2019-08-24T14:15:22Z",
"paymentId": "string",
"result": {
"resultCode": "string",
"resultMessage": "string",
"resultStatus": "S"
}
}