Browse Source

支付代码优化

ZhangWenQiang 6 years ago
parent
commit
5a0ea6a476

+ 0 - 1
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatminapay/utils/WeChatMinaPay.java

@@ -23,7 +23,6 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
 
 import javax.net.ssl.SSLContext;
 import javax.servlet.http.HttpServletRequest;

+ 0 - 1
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatpay/utils/WeChatPay.java

@@ -20,7 +20,6 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
 
 import javax.net.ssl.SSLContext;
 import javax.servlet.http.HttpServletRequest;

+ 2 - 3
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/api/ordermanager/OrderAliPayAPI.java

@@ -101,6 +101,7 @@ public class OrderAliPayAPI extends BaseAppController {
      * 程序执行完后必须打印输出“success”(不包含引号)。
      * 如果商户反馈给支付宝的字符不是success这7个字符,支付宝服务器会不断重发通知,直到超过24小时22分钟。
      * 一般情况下,25小时以内完成8次通知(通知的间隔频率一般是:4m,10m,10m,1h,2h,6h,15h);
+     * 这里可以处理数据库中的订单状态。
      *
      * @param request
      * @param response
@@ -132,12 +133,10 @@ public class OrderAliPayAPI extends BaseAppController {
         /**
          * 验签
          */
-        //切记alipayPublicCertPath是支付宝的公钥证书路径,请去open.alipay.com对应应用下查看。
+        //切记alipayPublicCertPath是支付宝的公钥证书路径
         boolean flag = AlipaySignature.rsaCertCheckV1(params, alipayPublicCertPath, charset, "RSA2");
         System.out.println("aliflag======" + flag);
         if (flag) {
-            //实付金额:
-            String total_fee = params.get("total_amount");
             //订单号
             String out_trade_no = params.get("out_trade_no");
             /**

+ 1 - 1
happy-job-module-hpvip/src/main/java/com/jeeplus/modules/api/ordermanager/OrderMinaPayAPI.java

@@ -84,7 +84,7 @@ public class OrderMinaPayAPI extends BaseAppController {
             parameters.put("notify_url", notifyUrl);
 
             //用户支付给商家
-            String resultStr = weChatMinaPay.customerToMerchant(parameters,request);
+            String resultStr = weChatMinaPay.customerToMerchant(parameters, request);
             System.out.println("========================处理支付返回值=============" + resultStr);
             if (StringUtils.isNotBlank(resultStr)) {
                 String resultStrNew = resultStr.substring(1, resultStr.length() - 1);