|
|
@@ -4,18 +4,16 @@ package com.minpay.common.service.impl;
|
|
|
import com.huilian.api.open.huilianjavademo.HttpsMain;
|
|
|
import com.huilian.api.open.huilianjavademo.MyConfig;
|
|
|
import com.huilian.api.open.huilianjavademo.XmlSignUtil;
|
|
|
+import com.huilian.api.open.huilianjavademo.XmlUtil;
|
|
|
import com.minpay.common.pay.bean.Huilianpay;
|
|
|
-import com.minpay.common.pay.bean.PrePay;
|
|
|
import com.minpay.common.service.IHuilianPayService;
|
|
|
-import com.startup.minpay.frame.exception.MINBusinessException;
|
|
|
import com.startup.minpay.frame.target.MINComponent;
|
|
|
-import com.huilian.api.open.huilianjavademo.XmlUtil;
|
|
|
+import com.sun.jmx.snmp.Timestamp;
|
|
|
+
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
-import com.sun.jmx.snmp.Timestamp;
|
|
|
-
|
|
|
/**
|
|
|
* @author ZHANGZZ
|
|
|
*
|
|
|
@@ -29,14 +27,14 @@ public class HuilianPayServiceImpl implements IHuilianPayService {
|
|
|
String function = "ant.mybank.bkmerchanttrade.prePay";
|
|
|
XmlUtil xmlUtil = new XmlUtil();
|
|
|
|
|
|
- Map<String, String> form = new HashMap<>();
|
|
|
+ /* Map<String, String> form = new HashMap<>();
|
|
|
// form.put("OutTradeNo", UUID.randomUUID().toString().replaceAll("-", ""));
|
|
|
form.put("Appid",MyConfig.newAppid);
|
|
|
form.put("OutTradeNo", huilianpay.getOutTradeNo());
|
|
|
form.put("Body", "反扫测试");
|
|
|
form.put("TotalAmount", huilianpay.getTotalAmount());
|
|
|
form.put("Currency", "CNY");
|
|
|
- form.put("HlMerchantId", MyConfig.hlMerchantId);
|
|
|
+ form.put("HlMerchantId", huilianpay.getHlMerchantId());
|
|
|
form.put("IsvOrgId", MyConfig.isvOrgId);
|
|
|
|
|
|
form.put("ProviderType", huilianpay.getProviderType());
|
|
|
@@ -44,6 +42,7 @@ public class HuilianPayServiceImpl implements IHuilianPayService {
|
|
|
form.put("OpenId", huilianpay.getOpenId());
|
|
|
form.put("NotifyUrl", huilianpay.getNotifyUrl());
|
|
|
|
|
|
+
|
|
|
form.put("DeviceCreateIp", "127.0.0.1");
|
|
|
form.put("SettleType", "T1");
|
|
|
form.put("SubAppId", MyConfig.oldAppid);
|
|
|
@@ -57,12 +56,46 @@ public class HuilianPayServiceImpl implements IHuilianPayService {
|
|
|
form.put("ExpireExpress", "5");
|
|
|
|
|
|
form.put("Attach", "test");
|
|
|
+ form.put("Function", function);
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ Date date = cal.getTime();
|
|
|
+ String reqTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(date);
|
|
|
+ form.put("ReqTime", reqTime);
|
|
|
+ //reqMsgId每次报文必须都不一样
|
|
|
+ form.put("ReqMsgId", UUID.randomUUID().toString());
|
|
|
+ form.put("ReqMsgId", "12321312");*/
|
|
|
|
|
|
+
|
|
|
+ Map<String, String> form = new HashMap<>();
|
|
|
+// form.put("OutTradeNo", UUID.randomUUID().toString().replaceAll("-", ""));
|
|
|
+ form.put("OutTradeNo",huilianpay.getOutTradeNo());
|
|
|
+ form.put("Body", "反扫测试");
|
|
|
+ form.put("TotalAmount", huilianpay.getTotalAmount());
|
|
|
+ form.put("Currency", "CNY");
|
|
|
+ form.put("HlMerchantId", MyConfig.hlMerchantId);
|
|
|
+ form.put("IsvOrgId", MyConfig.isvOrgId);
|
|
|
+ form.put("ProviderType", huilianpay.getProviderType());
|
|
|
+ form.put("ChannelType", huilianpay.getChannel());
|
|
|
+ form.put("OpenId", huilianpay.getOpenId());
|
|
|
+ form.put("DeviceCreateIp", "127.0.0.1");
|
|
|
+ form.put("SettleType", "T1");
|
|
|
+ form.put("SubAppId", MyConfig.oldAppid);
|
|
|
+
|
|
|
+ //可选参数
|
|
|
+ form.put("GoodsTag", "test");
|
|
|
+ form.put("GoodsDetail", "test");
|
|
|
+ form.put("OperatorId", "test");
|
|
|
+ form.put("StoreId", "test");
|
|
|
+ form.put("DeviceId", "1");
|
|
|
+ form.put("ExpireExpress", "5");
|
|
|
+ form.put("NotifyUrl", huilianpay.getNotifyUrl());
|
|
|
+ //form.put("NotifyUrl", "http://1k7s239485.51mypc.cn/pay/notify");
|
|
|
+ form.put("Attach", "test");
|
|
|
form.put("Function", function);
|
|
|
form.put("ReqTime", new Timestamp(System.currentTimeMillis()).toString());
|
|
|
//reqMsgId每次报文必须都不一样
|
|
|
form.put("ReqMsgId", UUID.randomUUID().toString());
|
|
|
- form.put("ReqMsgId", "12321312");
|
|
|
+ //form.put("ReqMsgId", "12321312");
|
|
|
|
|
|
//封装报文
|
|
|
String param = xmlUtil.format(form, function);
|