prepareAuthInfoMPP → Alipay+
The prepareAuthInfo API is used by Mobile Payment Partners (MPPs) for transactions conducted in mainland China. After a consumer scans the QR code presented by the merchant, the merchant is redirected to the AlipayCN authorization page. The wallet intercepts this redirection and forwards the AlipayCN authorization URL to Alipay+. Alipay+ then parses it and returns the authorization information, such as the merchant's redirect URL, back to the wallet. The authorization information is used for the subsequent process where the merchant obtains the user ID.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Note:
1. Set the data type of each parameter (except array) as String. This means that you must use double quotation marks (" ") to enclose the parameter value. For example:
- If the data type of a parameter is Integer and its value is 20, set it as "20".
- If the data type of a parameter is Boolean and its value is true, set it as "true".
2. For optional parameters that are not required in your case, you can take one of the following actions:
- Exclude the parameters from the request body.
- Set the parameter values as null (without the double quotation marks).
Do NOT leave the optional parameters empty by setting their values as ""; otherwise, an error might occur.
Request parameters
authUrl string REQUIRED
The redirection URL to the AlipayCN authorization page, obtained by intercepting the merchant's redirection process.
More information:
- Maximum length: 2048 characters
acquirerId string REQUIRED
The unique ID that is assigned by Alipay+ to identify an ACQP.
The fixed value of AlipayCN is 1022088000000000001
.
More information:
- Maximum length: 64 characters
Response parameters
result Result REQUIRED
The result of the processing, including the result code, result status, and result message. For more information about how to handle the result in different payment scenarios, see How to return the result.
acquirerId string
The unique ID that is assigned by Alipay+ to identify an ACQP.
Note: This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS
.
More information:
- Maximum length: 64 characters
pspId string
The unique ID that is assigned by Alipay+ to identify an MPP.
Note: This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS
.
More information:
- Maximum length: 64 characters
authClientId string
The authorization object.
Note: This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS
.
More information:
- Maximum length: 64 characters
authRedirectUrl string
The merchant's redirect URL. After generating the authCode, the wallet appends the authCode to the redirect URL and redirects back to the merchant with the URL.
Note: This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS
.
More information:
- Maximum length: 1024 characters
scopes Array
The authorization scope. The value must be BASE_USER_INFO
.
Note: This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS
.
Request
Response
More information
How to handle the result
You might receive different results from Alipay+. Follow the instructions below to handle the result.
result.resultStatus result.resultCode Request status Actions Successful Continue processing. Multiple possible values exist, such as Failed Take action based on the result code (specified in result.resultCode ). For more information, see the result codes in the below section. Multiple possible values exist, such as Unknown Retry the request.S
SUCCESS
F
PARAM_ILLEGAL
and PROCESS_FAIL
.U
REQUEST_TRAFFIC_EXCEED_LIMIT
and UNKNOWN_EXCEPTION
.
No result received
Unknown
Retry the request.
Result/Error codes
Code | Value | Message |
---|---|---|
SUCCESS | S | Success |
ACCESS_DENIED | F | Access is denied. |
INVALID_API | F | API is invalid or not active. |
INVALID_CLIENT | F | The client is invalid. |
INVALID_SIGNATURE | F | The signature is invalid. |
KEY_NOT_FOUND | F | The key is not found. |
METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTP method. |
MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that would be acceptable to the client. |
PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input or an invalid date. |
PROCESS_FAIL | F | General business failure. Do not retry. |
QUOTE_NOT_FOUND | F | There is no valid quote. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
UNKNOWN_EXCEPTION | U | The API call failed because of unknown reasons. |