提交代码

dev-discount
胡锐 3 years ago
parent 121de813d9
commit cfe9ed31e6
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 19
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  3. 33
      hai-service/src/main/java/com/hai/config/UnionStagingPayConfig.java
  4. 2
      hai-service/src/main/resources/dev/commonConfig.properties
  5. 7
      hai-service/src/main/resources/pre/commonConfig.properties
  6. 7
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  7. 7
      hai-service/src/main/resources/prod/commonConfig.properties

File diff suppressed because one or more lines are too long

@ -404,4 +404,23 @@ public class UnionPayController {
}
}
@RequestMapping(value = "/stagingNotify", method = RequestMethod.POST)
@ApiOperation(value = "银联分期支付 -> 异步回调")
public void stagingNotify(@RequestBody String params,HttpServletRequest request, HttpServletResponse response) {
try {
System.out.println(params);
log.info(params);
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
JSONObject result = new JSONObject();
result.put("tradeRetCode", "000000");
out.write(result.toJSONString().getBytes());
out.flush();
out.close();
} catch (Exception e) {
log.error("UnionPayController --> stagingNotify() error!", e);
}
}
}

@ -1,6 +1,7 @@
package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.utils.DateUtil;
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
import org.apache.commons.codec.binary.Base64;
import com.hai.common.pay.util.sdk.WXPayConstants;
@ -24,15 +25,16 @@ public class UnionStagingPayConfig {
/**
* 银联分期支付H5预下单-标准
* 文档地址 https://doc.eycard.cn/web/#/42?page_id=1516
* 文档地址 https://doc.eycard.cn/web/#/222?page_id=3183
* @param orderNo 订单号
* @param orgTrace 订单号
* @param appId 支付宝微信云闪付商户应用ID一般情况下与获取openId时的应用一致
* @param openId 支付宝微信云闪付用户授权唯一标识(如果没有:-)
* @param payPrice 支付金额 单位
* @return 响应信息
* @throws Exception
*/
public static JSONObject advancePay(String orderNo, String orgTrace, BigDecimal payPrice, String openId, String notifyUrl) throws Exception {
public static JSONObject advancePay(String orderNo, String orgTrace, BigDecimal payPrice, String appId,String openId, String notifyUrl) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
paramMap.put("orgMerCode", CommonSysConst.getSysConfig().getUnionStagingPayOrgMerCode());
@ -44,6 +46,7 @@ public class UnionStagingPayConfig {
Map<String, Object> bizDataMap = new HashMap<>();
bizDataMap.put("transAmt", payPrice.multiply(new BigDecimal("100")).intValue());
bizDataMap.put("appId", appId);
bizDataMap.put("openId", openId);
bizDataMap.put("notifyUrl", notifyUrl);
paramMap.put("bizData", bizDataMap);
@ -53,7 +56,7 @@ public class UnionStagingPayConfig {
return responseParam;
}
public static JSONObject query(String orderNo, String orgTrace, BigDecimal payPrice, String openId, String notifyUrl) throws Exception {
public static JSONObject query(String orgTrace, String prodCode) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
paramMap.put("orgMerCode", CommonSysConst.getSysConfig().getUnionStagingPayOrgMerCode());
@ -63,9 +66,8 @@ public class UnionStagingPayConfig {
paramMap.put("signType", "RSA");
Map<String, Object> bizDataMap = new HashMap<>();
bizDataMap.put("transAmt", payPrice.multiply(new BigDecimal("100")).intValue());
bizDataMap.put("openId", openId);
bizDataMap.put("notifyUrl", notifyUrl);
bizDataMap.put("oriOrgTrace", null);
bizDataMap.put("oriBizDate", null);
paramMap.put("bizData", bizDataMap);
paramMap.put("sign", generateSign(bizDataMap));
@ -73,6 +75,25 @@ public class UnionStagingPayConfig {
return responseParam;
}
public static JSONObject queryStaging(String orgTrace, String prodCode,Date oriBizDate) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orgId", CommonSysConst.getSysConfig().getUnionStagingPayOrgId());
paramMap.put("orgMerCode", CommonSysConst.getSysConfig().getUnionStagingPayOrgMerCode());
paramMap.put("orgTermNo", CommonSysConst.getSysConfig().getUnionStagingPayOrgTermNo());
paramMap.put("orgTrace", orgTrace);
paramMap.put("prodCode", "ISYH");
paramMap.put("signType", "RSA");
Map<String, Object> bizDataMap = new HashMap<>();
bizDataMap.put("oriOrgTrace", orgTrace);
bizDataMap.put("oriBizDate", DateUtil.date2String(oriBizDate, "yyyyMMdd"));
paramMap.put("bizData", bizDataMap);
paramMap.put("sign", generateSign(bizDataMap));
JSONObject responseParam = HttpsUtils.doPost(CommonSysConst.getSysConfig().getUnionStagingPayUrl()+"cashier/trade/queryStaging", paramMap, new HashMap<>());
return responseParam;
}
/**
* 参数排序
* @param param

@ -42,7 +42,7 @@ unionStagingPayOrgId=ORG000000000001
unionStagingPayOrgMerCode=890000000123679
unionStagingPayOrgTermNo=W0616228
unionStagingPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/notify
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/stagingNotify
# ??????
wx_cert=/home/project/wx_cert/

@ -30,6 +30,13 @@ unionPaySignKey=sa72ivadl84273dlj2kdaia2idiadik5
unionPayNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notify
unionPayTelNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notifyTel
unionStagingPayUrl=https://mtest.eycard.cn/
unionStagingPayOrgId=ORG000000000001
unionStagingPayOrgMerCode=890000000123679
unionStagingPayOrgTermNo=W0616228
unionStagingPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/stagingNotify
wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18

@ -30,6 +30,13 @@ unionPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionPayNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notify
unionPayTelNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notifyTel
unionStagingPayUrl=https://mtest.eycard.cn/
unionStagingPayOrgId=ORG000000000001
unionStagingPayOrgMerCode=890000000123679
unionStagingPayOrgTermNo=W0616228
unionStagingPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/stagingNotify
wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18

@ -30,6 +30,13 @@ unionPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionPayNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notify
unionPayTelNotifyUrl=https://hsg.dctpay.com/crest/unionPay/notifyTel
unionStagingPayUrl=https://mtest.eycard.cn/
unionStagingPayOrgId=ORG000000000001
unionStagingPayOrgMerCode=890000000123679
unionStagingPayOrgTermNo=W0616228
unionStagingPaySignKey=1dfk0i0fl7ild07l2k5oj8dddikkivd0
unionStagingPayNotifyUrl=https://hsgcs.dctpay.com/crest/unionPay/stagingNotify
wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18

Loading…
Cancel
Save