Overview
Brief Description
- This section describes the parameters to be obtained before interconnection
Merchant Number
- The merchant number is the parameters obtained after the merchant receives the information that sent to you by text /Telegram/ email after the Paypro workbench staff opens the account
Parameter | Description |
---|---|
Merchant Backstage | https://partner-test.paypro.tech/admin/login |
Merchant Number | 10-digit merchant number (example: 0000000001) |
Merchant Login Account | Usually log in by email account |
Merchant Login Password | Change your password immediately after logging in by agreed email account |
Merchant Key | Can be obtained by operation in homepage after the merchant logs in the system |
API Request URL
- Sandbox URL๏ผhttps://openapi-test.paypro.tech/pak-pay
- Sandbox merchant number: 4610351925
- Sandbox key:
Please contact the business development officer
- Production URL๏ผ
Please contact the business development officer
The information returned by the interface prioritizes determining whether the first
layer's request is successful, and only after the request is successful, the second
layer's transaction results could be checked
Signature Logic
- 1๏ผThe interface must report the sign parameter and the signing logic
Step 1: All requested parameters are judged from a to z according to the first letter of the parameter name, and combined into key1=value1key2=value2......
List<String> keys = Lists.newArrayList(map.keySet());
Collections.sort(keys);
StringBuilder request = new StringBuilder();
for (String key : keys) {
String value = String.valueOf(map.get(key));
if (StrUtil.isNotEmpty(value) && !"sign".equals(key)) {
request.append(key).append("=").append(value);
}
}
log.error("encrypt string : {}", request);
Step2๏ผUse app secret as salt for md5 encryption.
Parameter | Description |
---|---|
SIGN_TYPE | MD5 |
CHARSET_NAME | UTF-8 |
salt | Private Key |
try {
MessageDigest md5 = MessageDigest.getInstance(SIGN_TYPE);
md5.update((str + salt).getBytes(CHARSET_NAME));
return byte2hex(md5.digest());
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("md5 ๅ ๅฏๅผๅธธ", e);
}
}
return "";
public static String byte2hex(byte\[\] bytes) {
StringBuilder sign = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(bytes\[i\] & 0xFF);
if (hex.length() == 1) {
sign.append("0");
}
sign.append(hex.toLowerCase());
}
return sign.toString();
}
- 2๏ผThe requested merchant number is required to be added in the header submission.
- 3๏ผIP whitelists need to be added during the test. For this operation, please contact Paypro business development officer.
Request Parameter Acquisition
public static Long getMilliByTime(LocalDateTime time) {
return time.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
}
Request method
- All requests are
Post
requests, and the data format isjson