ProductTransfer

Transfer

URL

domain + /order/thirdFacade/transfer/doTransfer

REQUEST

PARAMETER TYPE REQUIRED MAX LENGTH DESCRIPTION EXAMPLE VALUE
merchantOrderNumber String true 64 The merchant order number you send,ensure unique in your merchant, max length is 64 04ae304b5a2f4da2bf21190f0cf367f7
accountNumber String true 64 TENN account number (The TENN account of the transfer beneficiary.) 2389656826
amount Long true 64 The transfer amount (Kobo) 20000
bankCode Integer true 20 Bank code 0505

RESPONSE

PARAMETER TYPE DESCRIPTION
id String TENN transfer id
merchantId Integer merchant id
merchantType Integer merchant type
merchantName String merchant name
merchantOrderNumber String merchant order number
amount Long transfer amount (Kobo)
status Integer 30001:Initiate
30003:Pending
30004:Successful
30005:Failed
30007:Closed
originatorAccountNumber String Originator account number
beneficiaryAccountNumber String Beneficiary account number
beneficiaryAccountName String Beneficiary account name
beneficiaryFirstName String Beneficiary first name
beneficiaryMiddleName String Beneficiary middle name
beneficiaryLastName String Beneficiary last name
beneficiaryPhone String Beneficiary phone
beneficiaryUserId String Beneficiary user id
beneficiaryBvn String Beneficiary bvn
beneficiaryLevel Integer Beneficiary level
currency String Currency
createdTime LocalDateTime Create time
expireTime LocalDateTime ExpireTime
transferTime LocalDateTime Transfer time
updateTime LocalDateTime Update time
notifyUrl String Webhook url
msg String Msg
splitFlag Boolean If the transfer amount is too large, the order will be split.
batchNumber String The batch number of order splitting.

Implementation method

SDK

TransferBean transferBean = new TransferBean(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";
  }
});
MerchantTransferParam param = new MerchantTransferParam();
param.setAccountNumber("1841010515");
param.setAmount(20600L);
param.setMerchantOrderNumber("04ae304b5a2f4da2bf21190f0cf367f7");
R transfer = transferBean.transfer(param);
System.out.println(JacksonUtil.toJsonString(transfer));

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/transfer/transfer";
    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("merchantOrderNumber", "test-20241129-01");
    paramMap.put("accountNumber","1841010515");
    paramMap.put("amount","30000");
    return paramMap;
}