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