Bank account query
# Code Example
- The code example is for reference only, please refer to request parameter description for specific parameter description
import com.google.gson.JsonObject;
public class OrderQuery {
private static final String MCH_ID = "S820211021094748000001"; // merchant code
private static final String PLAT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2JoMfFqLsSJjAiCahEnlP3aRj8yCT+WHzR+VvPBTw9S1i7iYWb+MY09CG/HYuHF4+IxshXDJygmndxKf/esuwPybS8mAd//yubHpmZsmBqg1FffT8VH1APa6ZRWASUp4U01ZrbCCp35QA8FuWrJGMJxGx4xk7KUtV2yujxC8noQIDAQAB"; // platform public key
private static final String MCH_PRIVATE_KEY = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAJU8gKFKD0luIYx7X8+JRdCIE0UDBctS6LjXxWLEv/EO7jDBTid6zYP1KmNgpd2DAWWtBFBSQ+gcNwVZZSBHJiSDqVvvJVs2FEbeBvfdv4X93+IYRAXksBasSW5Tpdshbo82pVL4V7wuKCuFLk9UxBHbpQjWAbfyF66RmwIbZD71AgMBAAECgYBjPe7UU2nDDSfmQg0++CyjNjqKRC5QPfxhH6w1uF1kMueXKJWOj42n2RutJpJmsj31nY8m0u4xpsG4HvCu/GGSFhhKZCHLvzp41oY2ubYj9nuFNU//81LycQjulWo2y0UUBY0k2piEt+SwPaiUNbT6nMxNMjlnjRe2okp/3rw+KQJBANG3YlZWoVbCEqzy64bJJLxiPsCA5ErGB0NzRGitq44xkhqGtR8ZZQyVz40pruNa58d73O2xyJSy5+fmZGn4E+sCQQC2LBnguj0CSCKub0mPDcunTTz9V79VXBBZdlB1/YGmRUx2s4sQrJNZS7rL4EqBQ3maIRnG+s+AXCSTfsYrV6CfAkEAxugnVfpelhoGepEAgNuggyivmgfl/2Gpm/jk5l/qOjib+ZrQiQmeBPzGWX4yiSM8eMDrP2sC8r5pJFMp5DRONwJBAJ4n4XuSFJ9jgwCPy3vvzSv9SYLk6E6yM9uHdUlKgoGYzk6Lh6M9QFuY/J49plFdBDiEnj16yCU3WeXXfTJpzB8CQQDMNMR/rIOTE9xGybS3mlQbt22AUnO6XhupWcckEKW4nPGxATwYBQzCY3i/9FTGN0vA+9ZPC2cwHtNxI2kXf3Vp"; // merchant private key
private static final String orderQueryUrl = "https://id-openapi.toppay.asia/gateway/query";
public static void main(String[] args) throws Exception {
query();
}
private static void query() throws Exception {
Map<String, String> requestParams = new TreeMap<>();
requestParams.put("merchantCode", MCH_ID);
requestParams.put("bankCode", "014");
requestParams.put("accountNumber", "123456789");
requestParams.put("dateTime", "20220101105500");
StringBuilder stringBuilder = new StringBuilder();
for (String key : requestParams.keySet()) {
stringBuilder.append(requestParams.get(key));
}
String keyStr = stringBuilder.toString();
System.out.println("keyStr:" + keyStr);
String signedStr = TopPayRequestUtil.privateEncrypt(keyStr, TopPayRequestUtil.getPrivateKey(MCH_PRIVATE_KEY));
requestParams.put("sign", signedStr);
String postJson = new Gson().toJson(requestParams);
System.out.println("Post Json Params:" + postJson);
String responseJson = TopPayRequestUtil.doPost(orderQueryUrl, postJson);
System.out.println("Response Msg:" + responseJson);
}
}
# Request Address
- Request method: POST
- Request address: https://id-openapi.toppay.asia/gateway/verify
Note: The accuracy rate of the account verification interface is not completely accurate, there are certain errors, and verification failure does not necessarily mean that the account is unavailable, please use it with caution!
# Request parameters
Param | Description | Example |
---|---|---|
merchantCode | Merchant ID,Get it in Merchant Platform-Personal Center-Personal Information | S820211021094748000001 |
bankCode | bank code | View supported bank codes |
accountNumber | account number | 123456789 |
dateTime | Timestamp (format:yyyyMMddHHmmss) | 20220101105500 |
sign | RSA sign | ja6R8eukQ... |
# Request example
{
"dateTime": "20220101105500",
"bankCode": "014",
"merchantCode": "S820211021094748000001",
"sign": "X/o+IQUzLJqYe9Feid9Uww72mJGOvhJS9dps+EBO7oSWh1P4gboeIfGjVggYViuYsFgYgYR/DZGJEIfo1EUChrZyVZnzGHtd61QhOqRmXCtAwfMGlDgBerEGEl6/JMKmcJbFEjxxJf8fl9HzVUp0T+Q6W5kR/9yWPT7Aask7V7k=",
"accountNumber": "123456789"
}
# Response parameters
Parameters | Type | Required | Description | Example |
---|---|---|---|---|
platRespCode | String | Y | response code | FAIL\SUCCESS |
platRespMessage | String | Y | response message | Request Transaction Success |
accountName | String | Y | account name | OKTAVIANE KAEMPE |
# Response example
{
"accountName": "OKTAVIANE KAEMPE",
"platRespCode": "SUCCESS",
"platRespMessage": "SUCCESS"
}