|
@@ -50,6 +50,8 @@ public class WithdrawSdk {
|
|
|
//结算第三方url
|
|
|
@Value("${withdraw.apiUrl}")
|
|
|
private String apiUrl;
|
|
|
+ @Value("${withdraw.privateKey}")
|
|
|
+ private String privateKey;
|
|
|
|
|
|
/**
|
|
|
* 签署协议
|
|
@@ -243,4 +245,33 @@ public class WithdrawSdk {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ public String balanceQuery(){
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ requestMap.put("outMemberNo", memberNo);
|
|
|
+ requestMap.put("charset", "UTF-8");
|
|
|
+ requestMap.put("service", "bpotop.zx.pay.order");
|
|
|
+ requestMap.put("version", "2.0");
|
|
|
+ requestMap.put("signType", "RSA");
|
|
|
+
|
|
|
+ String jsonStr = JSONObject.toJSONString(requestMap);
|
|
|
+ String encryptStr = null;
|
|
|
+ try {
|
|
|
+ encryptStr = RSA.encryptPub(jsonStr, publicKey);
|
|
|
+ requestMap.put("sign", encryptStr);
|
|
|
+ logger.info("查询余额请求参数:{}", requestMap);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new ThirdpartyException("加密失败:{}", e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ String resultJsonStr = null;
|
|
|
+ try {
|
|
|
+ resultJsonStr = HttpUtil.postForHttp(apiUrl + "/bpotop_trade/balance_query", JSONObject.toJSONString(requestMap), null);
|
|
|
+ logger.info("查询余额响应参数:{}", resultJsonStr);
|
|
|
+ return resultJsonStr;
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|