|
@@ -71,22 +71,53 @@ public class SaoBeiPayController {
|
|
|
// 终端号:33336510
|
|
|
// 密钥(token):dbea558077934b95a2f2adf57d278c40
|
|
|
|
|
|
+ //测试
|
|
|
// 商户号码:852105942000011
|
|
|
// 终端号:18237172
|
|
|
// 密钥:2ef428f4f76c414282e831baea9e4b0e
|
|
|
|
|
|
-
|
|
|
+ //智慧易加
|
|
|
// 商户号码:845104816000034
|
|
|
// 终端号:18241101
|
|
|
// 密钥:23570b46a955484d92038f6a18d2b9d6
|
|
|
|
|
|
public static final String PAY_VER = "110"; //版本号
|
|
|
public static final String KEY = ""; //机构秘钥
|
|
|
- public static final String ACCESS_TOKEN = "23570b46a955484d92038f6a18d2b9d6"; //支付秘钥
|
|
|
+ public static final String ACCESS_TOKEN = "2ef428f4f76c414282e831baea9e4b0e"; //支付秘钥
|
|
|
public static final String INST_NO = ""; //机构号
|
|
|
- public static final String MERCHANT_NO = "845104816000034"; //商户号
|
|
|
- public static final String TERMINAL_ID = "18241101"; //终端号
|
|
|
+ public static final String MERCHANT_NO = "852105942000011"; //商户号
|
|
|
+ public static final String TERMINAL_ID = "18237172"; //终端号
|
|
|
+
|
|
|
|
|
|
+ @RequestMapping(value = {"/payAmtInfoOld"}, consumes = {"application/json"}, method = {RequestMethod.POST})
|
|
|
+ @ResponseBody
|
|
|
+ public String payAmtInfoOld(@RequestBody PayInfoRequest payInfoRequest) throws Exception {
|
|
|
+ Gson gson = new Gson();
|
|
|
+ ResultData resultData = null;
|
|
|
+ DefaultSaobeiApiClient defaultSaobeiApiClient = new DefaultSaobeiApiClient("2ef428f4f76c414282e831baea9e4b0e");
|
|
|
+ SaobeiMiniPayRequest requst = new SaobeiMiniPayRequest();
|
|
|
+ requst.setPay_ver("110");
|
|
|
+ requst.setPay_type("010");
|
|
|
+ requst.setService_id("015");
|
|
|
+ requst.setMerchant_no("852105942000011");
|
|
|
+ requst.setTerminal_id("18237172");
|
|
|
+ requst.setTerminal_trace("202003252204310000");
|
|
|
+ requst.setTerminal_time("20200325220431");
|
|
|
+ String amt = payInfoRequest.getAmt();
|
|
|
+ requst.setTotal_fee("1");
|
|
|
+ String openId = payInfoRequest.getOpenId();
|
|
|
+ requst.setOpen_id("obnG9jhDLvom5fGwuhYysmQTW4qQ");
|
|
|
+ requst.setOrder_body("sdk测试");
|
|
|
+ String notifyUrl = "https://" + this.domainName + "/" + this.globalPrefix + "/getSaobeiCallback";
|
|
|
+ logger.info("回调地址"+ notifyUrl);
|
|
|
+ requst.setNotify_url(notifyUrl);
|
|
|
+ requst.setSub_appid("wxe568c727d466aef9");
|
|
|
+ System.out.println("请求报文"+ JSON.toJSONString(requst));
|
|
|
+ SaobeiMiniPayResponse response = (SaobeiMiniPayResponse)defaultSaobeiApiClient.execute(requst);
|
|
|
+ System.out.println("返回报文"+ JSON.toJSONString(response));
|
|
|
+ resultData = ResultData.success(response);
|
|
|
+ return gson.toJson(resultData);
|
|
|
+ }
|
|
|
|
|
|
/***
|
|
|
* 支付接口,前台上传支付信息,支付数据落地生产订单,调用第三方扫呗支付
|
|
@@ -118,14 +149,15 @@ public class SaoBeiPayController {
|
|
|
String ordNo_1 = System.nanoTime() + result;
|
|
|
|
|
|
//202003252204310000
|
|
|
- requst.setTerminal_trace(ordNo_1); //终端流水号,填写商户系统的订单号
|
|
|
- requst.setTerminal_time(new SimpleDateFormat("yyyyMMddhhmmss").format(new Date())); //交易时间
|
|
|
+ requst.setTerminal_trace("202003252204310000"); //终端流水号,填写商户系统的订单号
|
|
|
+ // new SimpleDateFormat("yyyyMMddhhmmss").format(new Date())
|
|
|
+ requst.setTerminal_time("20200325220431"); //交易时间
|
|
|
String amt = payInfoRequest.getAmt();
|
|
|
requst.setTotal_fee("0.01"); //订单金额
|
|
|
String openId = payInfoRequest.getOpenId();
|
|
|
|
|
|
//oRwjv4iHjSUgxNxOJOQ_60Ln7cno obnG9jhDLvom5fGwuhYysmQTW4qQ
|
|
|
- requst.setOpen_id("oRwjv4iHjSUgxNxOJOQ_60Ln7cno"); //微信用户openId
|
|
|
+ requst.setOpen_id("obnG9jhDLvom5fGwuhYysmQTW4qQ"); //微信用户openId
|
|
|
requst.setOrder_body("sdk测试");
|
|
|
|
|
|
String notifyUrl = "https://"+domainName+"/"+globalPrefix+"/getSaobeiCallback";
|
|
@@ -134,12 +166,14 @@ public class SaoBeiPayController {
|
|
|
|
|
|
//wxe568c727d466aef9
|
|
|
//wxe1135cd390b38a54
|
|
|
- requst.setSub_appid("wxe1135cd390b38a54");
|
|
|
+ requst.setSub_appid("wxe568c727d466aef9");
|
|
|
//发送请求
|
|
|
System.out.println("小程序预支付请求报文:"+JSON.toJSONString(requst));
|
|
|
SaobeiPreAuthMiniPayResponse response = client.execute(requst);
|
|
|
System.out.println("小程序预支付权返回报文:"+JSON.toJSONString(response));
|
|
|
System.out.println("=========================================================================================");
|
|
|
+
|
|
|
+
|
|
|
//创建client
|
|
|
SaobeiApiClient<SaobeiMiniPayRequest, SaobeiMiniPayResponse> clientMiniPay = new DefaultSaobeiApiClient<>(ACCESS_TOKEN);
|
|
|
//创建requst
|