ProductDispute
Dispute Query
URL
domain + /order/thirdFacade/dispute/queryDispute
REQUEST
| PARAMETER | TYPE | REQUIRED | MAX LENGTH | DESCRIPTION | EXAMPLE VALUE |
|---|---|---|---|---|---|
| id | String | false | 32 | Dispute id | 61101202409120629180012303760 |
| accountNumber | String | false | 64 | TENN account number | 2389656826 |
| transactionId | String | false | 64 | Tenn payment transaction reference | 202310230547501586187366 |
| startCreateTime | String | false | 64 | query dispute start create time (UTC) | 2024-09-01 23:00:00 |
| endCreateTime | String | false | 64 | query dispute end create time (UTC) | 2024-09-02 23:00:00 |
| complaintStatus | Integer | false | - | 1 Uncompleted (The dispute has not been processed yet.) 2 Completed (The dispute has been processed and completed.) |
1 |
| currentPage | Integer | false | - | Query's current page number, The default value is 1 | 1 |
| pageSize | Integer | false | - | Number of items per page in the query,The default value is 10 | 10 |
RESPONSE
| PARAMETER | TYPE | DESCRIPTION |
|---|---|---|
| total | Integer | Total number of disputes |
| id | String | Dispute id |
| complainantName | String | TENN user name |
| complaintStatus | Integer | 1 Uncompleted (The dispute has not been processed yet.) 2 Completed (The dispute has been processed and completed.) |
| accountNumber | String | TENN account number (the account has been desensitized) |
| emailAddress | String | user email address |
| mobileNumber | String | user mobile number |
| complaintType | String | complaintType :Online payment or Transfer |
| transactionId | String | Tenn payment transaction reference |
| transactionAmount | Long | transaction amount (Kobo) |
| purpose | String | the purpose of the dispute |
Implementation method
SDK
DisputeBean disputeBean = new DisputeBean(new DeepxinPayConfig() {
@Override
public String getMerchantCode() {
return "Your merchant code";
}
@Override
public String getPublicKey() {
return "Your public key";
}
@Override
public String getPrivateKey() {
return "Your private key";
}
@Override
public String getServerAddress() {
return "https://tenn.deepxin.com";
}
});
R queryDisputeResultR = disputeBean.queryDispute(QueryDisputeParam.builder().complaintStatus(1).build());
System.out.println(JacksonUtil.toJsonString(queryDisputeResultR.getData()));
HTTP
public static void main(String[] args) {
// Replace with the merchant's public key for either the testing environment or the production environment
String merchantPublicKey = "your public key";
// Replace with the merchant's private key for either the testing environment or the production environment
String merchantPrivateKey = "your private key";
// MerchantCode
String merchantCode = "your merchant code";
// Parameters
Map<String, Object> paramMap = getParamMap();
// Encrypt the parameters using the merchant's public key.
String encryptStr = encryptWithPublicKey(paramMap, merchantPublicKey);
// Sign the encrypted parameters using the merchant's public key.
String sign = sign(encryptStr, merchantPublicKey);
// Get Request parameters
Map<String, Object> requestMap = getRequestMap(encryptStr, merchantCode, sign);
String requestStr = JSONUtil.toJsonStr(requestMap);
String tennServerUrl = "https://tenn.deepxin.com/order/thirdFacade/dispute/queryDispute";
try {
String result = HttpUtil.post(tennServerUrl, requestStr);
if (!JSONUtil.isTypeJSON(result)) {
System.out.println("Result is not a JSON type.");
return;
}
JSONObject entries = JSONUtil.parseObj(result);
String toDecryptStr = entries.getStr("data");
String responseSign = entries.getStr("sign");
if (SUCCESS_CODE == entries.getInt("code")) {
boolean verifySign = verify(responseSign, toDecryptStr, merchantPublicKey);
if (verifySign) {
String decryptStr = decryptWithPrivateKey(toDecryptStr, merchantPrivateKey);
System.out.println(decryptStr);
} else {
System.out.println("Signature verification failed.");
}
}else{
System.out.println(result);
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public static Map<String, Object> getParamMap() {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("complaintStatus", "1");
return paramMap;
}