Quick Start
request to the HOST
For details, please refer to the account opening information or consult the staff.
Request structure
By sending an HTTP POST request to the server address of the Starpago API and adding the corresponding request parameters into the HTTP body according to the request structure, the Starpago system responds to the return parameters according to the request parameters.
Communication protocol
For greater security, the Starpago API interface only supports request communication over the HTTPS channel. When calling the Starpago system API, follow the following security requirements:
All requests must use SSL, otherwise the request will be rejected. Only TLS 1.2 or TLS 1.1 is supported. SSLv3 and TLS 1.0 are not supported.
Character encoding
Both the request and return results are encoded using the UTF-8 character set.
Parameter format
Request parameters and return parameters are in JSON format.
Content-Type: application/json; charset=utf-8
Return parameter
| field | The name of the | instructions |
|---|---|---|
| code | Status code | HTTP status code. The value of this field indicates only the status of interface requests, but does not indicate that service parameters are normal |
| msg | State description | Description of the interface invocation result |
| error | The error message | Exception information |
| data | Business return value | The return value that describes the business invocation. For details, see the data value of each interface in the business interface |
Notification Mechanism
Notice can be divided into two ways. Due to the possibility of user simulation operation in synchronous callback, or the user manually closes the browser when the synchronous notification is not redirected, which may cause loss to the merchant, we strongly suggest the merchant to confirm the payment result of the order with the result of asynchronous notification.
Synchronous callback
Upon successful payment, or cancellation of payment, Starpago redirects the consumer's browser to the Returnurl provided by the merchant with the relevant parameters. The synchronous callback uses GET to jump, and the corresponding splicing parameters will be processed by URLencode encoded as UTF-8 for each parameter value, and then jump.
Asynchronous callback
Starpago will send the consumer payment result message to the notifyurl provided by the merchant through the server, and carry relevant parameters, and submit it in the form of post. The merchant needs to judge the order status in the result to determine the order status.
Upon receiving the request, the merchant server must respond with HTTP 200 and print SUCCESS or OK. If the merchant's feedback to Starpago is not 7 characters (SUCCESS) or 2 characters (OK), the Starpago server will continuously resend the notification until 24 hours and 47 minutes have passed. In general cases, 25 hours complete nine times resend notice (notice the interval of frequency is commonly: 30 s, 2 m, 4 m, 10 m, 30 m, 1 h, 2 h, 6 h, 15 h). In some cases, a merchant may receive multiple notifications from Starpago for a single order, and the merchant will need to check its logic to be able to uniquely process orders that may receive repeated notifications of success or failure status.
