|
@@ -375,4 +375,33 @@ public class THuifuMchServiceImpl extends ServiceImpl<THuifuMchMapper, THuifuMch
|
|
|
|
|
|
return data;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public JSONObject payQuery(String queryId, String companyType) throws Exception {
|
|
|
+ String url = "https://api.huifu.com/v2/trade/payment/scanpay/query";
|
|
|
+ HuifuBaseCommon.doInit(OppsMerchantConfig.getMerchantConfig());
|
|
|
+ JSONObject request = new JSONObject();
|
|
|
+ if (StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
+ request.put("huifu_id", HuifuConstant.SC_DIV_HUIFU_ID);
|
|
|
+ } else {
|
|
|
+ request.put("huifu_id", HuifuConstant.SZ_DIV_HUIFU_ID);
|
|
|
+ }
|
|
|
+ request.put("org_req_date", DateTools.getCurrentDateYYYYMMDD());
|
|
|
+ request.put("org_hf_seq_id", queryId);
|
|
|
+ // 签名:sign
|
|
|
+ String s = JSON.toJSONString(request);
|
|
|
+ String s1 = JSON.toJSONString(JSONObject.parseObject(s, TreeMap.class));
|
|
|
+ String sign = HuifuUtils.sign(s1, HuifuConstant.RSA_PRIVATE_KEY);
|
|
|
+ // 公共参数
|
|
|
+ JSONObject requestData = new JSONObject();
|
|
|
+ requestData.put("sys_id", HuifuConstant.SYS_ID);
|
|
|
+ requestData.put("product_id", HuifuConstant.PRODUCT_ID);
|
|
|
+ requestData.put("sign", sign);
|
|
|
+ requestData.put("data", request);
|
|
|
+ String success = OkHttpClientTools.httpPost(url, requestData.toString(), HuifuConstant.PRODUCT_ID);
|
|
|
+ // 拿到返回参数
|
|
|
+ JSONObject result = JSONObject.parseObject(success);
|
|
|
+ JSONObject data = result.getJSONObject("data");
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|