wangqifan 3 жил өмнө
parent
commit
3eb42ea5ac

+ 28 - 24
src/main/java/com/izouma/nineth/service/SandPayService.java

@@ -188,32 +188,36 @@ public class SandPayService {
             }
         }
         JSONObject header = new JSONObject();
-        header.put("version", "1.0");                      //版本号
-        header.put("method", "sandPay.fastPay.quickPay.index");   //接口名称:统一下单并支付
-        header.put("productId", "00000016");               //产品编码
-        header.put("mid", sandPayProperties.getMid());     //商户号
-        header.put("accessType", "1");                     //接入类型设置为普通商户接入
-        header.put("channelType", "07");                   //渠道类型:07-互联网   08-移动端
-        header.put("reqTime", getReqTime());               //请求时间
+        header.put("version", "1.0");                         //版本号
+        header.put("method", "sandpay.trade.pay");            //接口名称:统一下单
+        header.put("mid", sandPayProperties.getMid());        //商户号
+        header.put("accessType", "1");                        //接入类型设置为平台商户接入		//接入类型设置为普通商户接入
+        header.put("channelType", "07");                      //渠道类型:07-互联网   08-移动端
+        header.put("reqTime", getReqTime());                  //请求时间
+        header.put("productId", "00000008");                  //产品编码
 
         JSONObject body = new JSONObject();
-        body.put("userId", userId);//支付工具: 固定填写0401
-        body.put("orderCode", orderId);
-        body.put("orderTime", getReqTime());  //商户订单号
-        body.put("totalAmount", convertAmount(amount));               //订单金额 12位长度,精确到分
-        //body.put("limitPay", "5");                                  //限定支付方式 送1-限定不能使用贷记卡	送4-限定不能使用花呗	送5-限定不能使用贷记卡+花呗
-        body.put("subject", subject);                                 //订单标题
-        body.put("body", desc);                                       //订单描述
-        body.put("txnTimeOut", timeout);
-        body.put("currencyCode", 156);   //订单超时时间
-        body.put("notifyUrl", sandPayProperties.getNotifyUrl());
-        body.put("frontUrl", frontUrl);
-        //异步通知地址
-//        body.put("bizExtendParams", "");                              //业务扩展参数
-//        body.put("merchExtendParams", "");                            //商户扩展参数
-        body.put("extend", extend);
-
-        return requestServer(header, body, "https://cashier.sandpay.com.cn/fastPay/quickPay/index");
+        body.put("orderCode", orderId);                                           //商户订单号
+        body.put("totalAmount", convertAmount(amount));                           //订单金额
+        body.put("subject", subject);                                             //订单标题
+        body.put("body", desc);                                                   //订单描述
+        body.put("txnTimeOut", getTimeout(timeout));                              //订单超时时间
+        body.put("clientIp", "192.168.22.55");                                    //客户端IP
+        body.put("limitPay", "");                                                 //限定支付方式	送1-限定不能使用贷记卡送	4-限定不能使用花呗	送5-限定不能使用贷记卡+花呗
+        body.put("notifyUrl", sandPayProperties.getNotifyUrl());                  //异步通知地址
+        body.put("frontUrl", frontUrl);                                           //前台通知地址
+        body.put("storeId", "");                                                  //商户门店编号
+        body.put("terminalId", "");                                               //商户终端编号
+        body.put("operatorId", "");                                               //操作员编号
+        body.put("clearCycle", "");                                               //清算模式
+        body.put("royaltyInfo", "");                                              //分账信息
+        body.put("riskRateInfo", "");                                             //风控信息域
+        body.put("bizExtendParams", "");                                          //业务扩展参数
+        body.put("merchExtendParams", "");                                        //商户扩展参数
+        body.put("extend", extend);                                               //扩展域
+        body.put("payMode", "sand_h5");                                           //支付模式
+
+        return requestServer(header, body, "https://cashier.sandpay.com.cn/gateway/api/order/pay");
     }
 
     public JSONObject query(String orderId) {