Access Guide
Access Guide

Preparation instructions for connection
Application path for public and private keys
During the official launch phase, we strongly recommend that you bind the server IP address. An APIKey without a bound IP address can only be used for 15
days, and the APIKey will become effective again after modifying and binding the server IP address.

System PublicKey
03029c655932f22aee81034d109795fbd7e23ca173ca27e195091d434e593a2e0f
Public and Private Key & System Public Key Usage Instructions

Request domain
https://payment.tarspay.com
Request structure
POST
request to the server address of the Tarspay API and adding the corresponding request parameters in the HTTP body
and header
according to the request structure, the Tarspay system responds with the returned parameters based on the request parameters.Communication Protocol
Character encoding
Parameter format
Content-Type: application/json;charset=utf-8
Return parameter
{
"code":0,
"msg":"SUCCESS",
"data":{
...
}
}
|field | type | description |
---|---|---|
code | integer | 0 success, others is failed |
data | object | Description of the return value of business calls, please refer to the data value of each interface in the business interface. |
msg | string | Response message |
Notification mechanism
notifyUrl
via the server side, carrying relevant parameters, and submit it in POST
form. Merchants need to verify the signature of the result information to prevent forged notification messages; and they must judge the order status in the returned result to determine the order status.OK
string. If the character feedback from the merchant to Tarspay is not the OK
character, the Tarspay server will continuously resend the notification.Signature Mechanism
X-API-SIGNATURE
to Tarspay.HTTP_METHOD
+ "|" + HTTP_REQUEST_PATH
+ "|" + TIMESTAMP
+ "|" + PARAMS
After the connection is completed, perform an ECDSA signature on the data, and then encode the signed bytes in Hex format.HTTP_METHOD:
POST
HTTP_REQUEST_PATH:
https://payment.tarspay.com/api/pay/unifiedOrder
The request path is /api/pay/unifiedOrder
TIMESTAMP:
PARAMS:
Note: Business fields are not fixed and immutable. All business fields participate in the signature, and it is recommended to handle them dynamically to cope with possible additions or deletions of fields.
Complete example
HTTP_METHOD | HTTP_REQUEST_PATH | TIMESTAMP |
---|---|---|
POST | /api/v1/test | 1537498830736 |
Parameter | value |
---|---|
amount | 100 |
price | 100 |
1.
Hint: content does not require URL encoding
The Tarspay verification public key can be obtained on the "Web Management Interface - Account Management - apikey" page.
Signature Tool Reference
java
Maven Dependency
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.64</version>
<scope>compile</scope>
</dependency>
Signature Tool Class
Utils