Make use of "pay_info" returned from Payment API to invoke Alipay In-App Payment module via Alipay SDK in merchant's mobile app.
URL: https://pay.ionlinepay.com/gateway/
Request Method: POST Form-Data
| Name | ID | Required | Type | Description |
| API Name | service | Yes | String(32) | ionline.pay.alipay.inapp.intl |
| API Version | version | No | String(8) | Default value: 1.0 |
| Charset | charset | No | String(8) | Default value: UTF-8 |
| Signature Type | sign_type | No | String(8) | Default value: MD5 |
| Merchant ID (MID) | mch_id | Yes | String(32) | Specifies Merchant ID assigned by iOnline Pay |
| Order Number | out_trade_no | Yes | String(32) | out_trade_no is an internal order number within the Vendor’s system. |
| Item Description | body | Yes | String(127) | Item Description |
| Additional Data | attach | No | String(127) | Allow merchants an additional field to be returned in the payment notification after submitting a payment to the Query Order API |
| Total order amount | total_fee | Yes | Int | Specifies the total order amount. The units are expressed in cents as integers. The default currency is HKD. |
| Terminal IP | mch_create_ip | Yes | String(16) | Specifies the machine IP that calls Payment API |
| Payment Notification URL | notify_url | Yes | String(255) | Specifies the callback URL for receiving payment notifications Support port 80 or 443 only |
| Random String | nonce_str | Yes | String(32) | 32 characters or fewer. |
| Signature | sign | Yes | String(32) | Signature Hash. For more information, see "Security Specification" |
Response Format: JSON
| Name | ID | Required | Type | Description |
| API Version | version | Yes | String(8) | Default value: 1.0 |
| Charset | charset | Yes | String(8) | Default value: UTF-8 |
| Signature Type | sign_type | Yes | String(8) | Default value: MD5 |
| Return Status Code | status | Yes | String(16) | This parameters indicates whether the API call is successful or not but this doesn't indicate to have a successful transaction. If the value is 0, then it indicates sucecssful. Otherwise, it indicates failure. |
| Return Message | message | No | String(128) | The description of the Return Status Code if the value of parameter "status" is not 0. |
| The below parameters will be returned if the value of the parameter "status" is 0. | ||||
| Service Result | result_code | Yes | String(16) | If the value is 0, then it indicates sucecssful. Otherwise, it indicates failure. |
| Merchant ID (MID) | mch_id | Yes | String(32) | Specifies Merchant ID assigned by iOnline Pay |
| Random String | nonce_str | Yes | String(32) | 32 characters or fewer. |
| Error Code | err_code | No | String(32) | Error code |
| Error Message | err_msg | No | String(128) | The description of error code |
| Signature | sign | Yes | String(32) | Signature Hash. For more information, see "Security Specification" |
| The below parameters will be returned if the value of the both parameters "status" and "result_code" are 0. | ||||
| Payment Data | pay_info | Yes | String |
The value should be passed as input parameters of Alipay SDK to invoke In-App Payment.
* Demo Code and Alipay SDK can be downloaded from Alipay Global Official Website: Download here * Let’s take iOS as example. The value of "pay_info" should be passed to orderString" [[AlipaySDK defaultService] payOrder:orderString fromScheme:appScheme callback:^(NSDictionary *resultDic) { NSLog(@"Payment result = %@",resultDic); }]; If resultDic.resultStatus = 9000, it means payment is sucessful. Otherwise, resultStatus indicates different errors. Please see the below return code list for details. |
|
Return code |
Description |
|
8000 |
Under processing, unknown payment result (payment might have been made successfully), please inquiry order payment status in sellers’ orders list. (This code returns from Alipay server side.) |
|
4000 |
Failed order payment |
|
6001 |
Canceled by user during the process |
|
6002 |
Error in network connection |
|
6004 |
Unknown payment result (payment might have been made successfully), please inquiry order payment status in sellers’ orders list. (Usually caused by network issue, causing Alipay client cannot receive response from Alipay server side) |
|
Others |
Other payment errors |