Skip to content

Commit 2c00e23

Browse files
committed
升级sdk版本为2.9.6.BETA
1 parent 26e00d0 commit 2c00e23

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
<!-- base setting -->
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<project.build.locales>zh_CN</project.build.locales>
15-
<project.build.jdk>1.7</project.build.jdk>
15+
<project.build.jdk>1.8</project.build.jdk>
1616

1717
<!-- plugin versions -->
1818
<plugin.maven-compiler>3.1</plugin.maven-compiler>
1919

2020
<!-- lib versions -->
21-
<weixin-java-tools.version>2.9.0</weixin-java-tools.version>
21+
<weixin-java-tools.version>2.9.6.BETA</weixin-java-tools.version>
2222
<junit.version>4.12</junit.version>
2323
<slf4j.version>1.7.21</slf4j.version>
2424
<spring.version>4.2.6.RELEASE</spring.version>

src/main/java/com/github/weixin/demo/controller/PaymentController.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
package com.github.weixin.demo.controller;
22

3-
import com.github.binarywang.wxpay.bean.request.WxEntPayRequest;
3+
import java.util.Map;
4+
import javax.servlet.http.HttpServletRequest;
5+
import javax.servlet.http.HttpServletResponse;
6+
7+
import org.springframework.beans.factory.annotation.Autowired;
8+
import org.springframework.stereotype.Controller;
9+
import org.springframework.web.bind.annotation.RequestMapping;
10+
11+
import com.github.binarywang.wxpay.bean.entpay.EntPayRequest;
12+
import com.github.binarywang.wxpay.bean.entpay.EntPayResult;
413
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
5-
import com.github.binarywang.wxpay.bean.result.WxEntPayResult;
614
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
715
import com.github.binarywang.wxpay.config.WxPayConfig;
816
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -13,13 +21,6 @@
1321
import com.github.weixin.demo.util.XMLUtil;
1422
import com.google.gson.Gson;
1523
import me.chanjar.weixin.common.exception.WxErrorException;
16-
import org.springframework.beans.factory.annotation.Autowired;
17-
import org.springframework.stereotype.Controller;
18-
import org.springframework.web.bind.annotation.RequestMapping;
19-
20-
import javax.servlet.http.HttpServletRequest;
21-
import javax.servlet.http.HttpServletResponse;
22-
import java.util.Map;
2324

2425
/**
2526
* 微信支付Controller
@@ -53,7 +54,7 @@ public void getPrepayId(HttpServletResponse response,
5354
.body(request.getParameter("body"))
5455
.tradeType(request.getParameter("trade_type"))
5556
.spbillCreateIp(request.getParameter("spbill_create_ip"))
56-
.notifyURL("")
57+
.notifyUrl("")
5758
.build();
5859
this.logger
5960
.info("PartnerKey is :" + this.payConfig.getMchKey());
@@ -79,7 +80,7 @@ public void getJSSDKPayInfo(HttpServletResponse response,
7980
.body(request.getParameter("body"))
8081
.tradeType(request.getParameter("trade_type"))
8182
.spbillCreateIp(request.getParameter("spbill_create_ip"))
82-
.notifyURL("")//TODO(user) 填写通知回调地址
83+
.notifyUrl("// TODO 填写通知回调地址")
8384
.build();
8485

8586
try {
@@ -133,7 +134,7 @@ public void getJSSDKCallbackData(HttpServletRequest request,
133134
@RequestMapping(value = "entPay")
134135
public void payToIndividual(HttpServletResponse response,
135136
HttpServletRequest request) {
136-
WxEntPayRequest wxEntPayRequest = new WxEntPayRequest();
137+
EntPayRequest wxEntPayRequest = new EntPayRequest();
137138
wxEntPayRequest.setAppid(payConfig.getAppId());
138139
wxEntPayRequest.setMchId(payConfig.getMchId());
139140
wxEntPayRequest.setNonceStr(Sha1Util.getNonceStr());
@@ -145,7 +146,7 @@ public void payToIndividual(HttpServletResponse response,
145146
wxEntPayRequest.setSpbillCreateIp(request.getParameter("spbill_create_ip"));
146147

147148
try {
148-
WxEntPayResult wxEntPayResult = payService.entPay(wxEntPayRequest);
149+
EntPayResult wxEntPayResult = payService.getEntPayService().entPay(wxEntPayRequest);
149150
if ("SUCCESS".equals(wxEntPayResult.getResultCode().toUpperCase())
150151
&& "SUCCESS".equals(wxEntPayResult.getReturnCode().toUpperCase())) {
151152
this.logger.info("企业对个人付款成功!\n付款信息:\n" + wxEntPayResult.toString());

0 commit comments

Comments
 (0)