certificates = new ArrayList<>();
+ certificates.add(x509Certificate);
+ builder.withMerchant(mchId, certSerialNo, merchantPrivateKey);
+ builder.withWechatpay(certificates);
+ AutoUpdateCertificatesVerifier verifier = new AutoUpdateCertificatesVerifier(
+ new WechatPay2Credentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+ apiV3Key.getBytes(StandardCharsets.UTF_8));
+ builder.withValidator(new WechatPay2Validator(verifier));
+ httpClient = builder.build();
+ this.apiV3HttpClient = httpClient;
+ } catch (Exception e) {
+ throw new WxPayException("v3请求构造异常!", e);
+ }
+
+ return httpClient;
+
}
+}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java
index e85df7f88..dafa474be 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayScoreService.java
@@ -1,6 +1,6 @@
package com.github.binarywang.wxpay.service;
-import com.github.binarywang.wxpay.bean.payscore.NotifyData;
+import com.github.binarywang.wxpay.bean.payscore.PayScoreNotifyData;
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreRequest;
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult;
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -11,154 +11,120 @@ import java.net.URISyntaxException;
*
* 支付分相关服务类.
* 微信支付分是对个人的身份特质、支付行为、使用历史等情况的综合计算分值,旨在为用户提供更简单便捷的生活方式。
- * 微信用户可以在具体应用场景中,开通微信支付分。开通后,用户可以在【微信—>钱包—>支付分】中查看分数和使用记录。(即需在应用场景中使用过一次,钱包才会出现支付分入口)
+ * 微信用户可以在具体应用场景中,开通微信支付分。开通后,用户可以在【微信—>钱包—>支付分】中查看分数和使用记录。
+ * (即需在应用场景中使用过一次,钱包才会出现支付分入口)
*
* Created by doger.wang on 2020/05/12.
*
*
- *
+ * @author doger.wang
*/
public interface PayScoreService {
-
-
-
/**
*
* 支付分创建订单API.
- * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter1_1.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_1.shtml
+ * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_1.shtml
+ * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/serviceorder
*
*
* @param request 请求对象
- * @return WxPayScoreResult
+ * @return WxPayScoreResult wx pay score result
* @throws WxPayException the wx pay exception
*/
WxPayScoreResult createServiceOrder(WxPayScoreRequest request) throws WxPayException;
-
-
/**
*
* 支付分查询订单API.
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_2.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_2.shtml
+ * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/serviceorder
*
*
- * @Author doger.wang
- * @Description
- * @Date 2020/5/14 15:40
- * @Param out_order_no, query_id选填一个
- * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult
- **/
- WxPayScoreResult queryServiceOrder( String out_order_no,String query_id ) throws WxPayException, URISyntaxException;
-
+ * @param outOrderNo the out order no
+ * @param queryId the query id
+ * @return the wx pay score result
+ * @throws WxPayException the wx pay exception
+ * @throws URISyntaxException the uri syntax exception
+ */
+ WxPayScoreResult queryServiceOrder(String outOrderNo, String queryId) throws WxPayException, URISyntaxException;
/**
*
* 支付分取消订单API.
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_3.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_3.shtml
+ * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/serviceorder/{out_order_no}/cancel
*
*
- * @Author doger.wang
- * @Description
- * @Date 2020/5/14 15:40
- * @Param out_order_no reason
- * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult
- **/
- WxPayScoreResult cancelServiceOrder(String out_order_no, String reason) throws WxPayException;
+ * @param outOrderNo the out order no
+ * @param reason the reason
+ * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult wx pay score result
+ * @throws WxPayException the wx pay exception
+ */
+ WxPayScoreResult cancelServiceOrder(String outOrderNo, String reason) throws WxPayException;
/**
*
* 支付分修改订单金额API.
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_4.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_4.shtml
+ * 接口链接:https://api.mch.weixin.qq.com/v3/payscore/serviceorder/{out_order_no}/modify
*
*
- * @Author doger.wang
- * @Description
- * @Date 2020/5/14 15:40
- * @Param WxPayScoreRequest
- * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult
- **/
+ * @param request the request
+ * @return the wx pay score result
+ * @throws WxPayException the wx pay exception
+ */
WxPayScoreResult modifyServiceOrder(WxPayScoreRequest request) throws WxPayException;
-
/**
*
* 支付分完结订单API.
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_5.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_5.shtml
+ * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/serviceorder/{out_order_no}/complete
*
*
- * @Author doger.wang
- * @Description
- * @Date 2020/5/14 15:40
- * @Param WxPayScoreRequest
- * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult
- **/
+ * @param request the request
+ * @return the wx pay score result
+ * @throws WxPayException the wx pay exception
+ */
WxPayScoreResult completeServiceOrder(WxPayScoreRequest request) throws WxPayException;
-
/**
*
* 支付分订单收款API.
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_6.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_6.shtml
+ * 请求URL:https://api.mch.weixin.qq.com/v3/payscore/serviceorder/{out_order_no}/pay
+ *
*
*
- * @Author doger.wang
- * @Description
- * @Date 2020/5/14 15:40
- * @Param out_order_no
- * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult
- **/
- WxPayScoreResult payServiceOrder(String out_order_no) throws WxPayException;
-
+ * @param outOrderNo the out order no
+ * @return the wx pay score result
+ * @throws WxPayException the wx pay exception
+ */
+ WxPayScoreResult payServiceOrder(String outOrderNo) throws WxPayException;
/**
*
* 支付分订单收款API.
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_7.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter3_7.shtml
+ * 请求URL: https://api.mch.weixin.qq.com/v3/payscore/serviceorder/{out_order_no}/sync
*
*
- * @Author doger.wang
- * @Description
- * @Date 2020/5/14 15:40
- * @Param WxPayScoreRequest
- * @return com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult
- **/
+ * @param request the request
+ * @return the wx pay score result
+ * @throws WxPayException the wx pay exception
+ */
WxPayScoreResult syncServiceOrder(WxPayScoreRequest request) throws WxPayException;
-
/**
*
- * 支付分回调内容解密方法
+ * 支付分回调内容解析方法
* 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter5_2.shtml
- * 接口链接:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/payscore/chapter5_2.shtml
*
*
- * @param NotifyData 请求对象
- * @return WxPayScoreResult
+ * @param data the data
+ * @return the wx pay score result
+ * @throws WxPayException the wx pay exception
*/
- WxPayScoreResult decryptNotifyData(NotifyData data) throws WxPayException;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ WxPayScoreResult parseNotifyData(PayScoreNotifyData data) throws WxPayException;
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
index 2756a712c..79b64fb3f 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImpl.java
@@ -1,7 +1,6 @@
package com.github.binarywang.wxpay.service.impl;
-import com.alibaba.fastjson.JSONObject;
-import com.github.binarywang.wxpay.bean.payscore.NotifyData;
+import com.github.binarywang.wxpay.bean.payscore.PayScoreNotifyData;
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreRequest;
import com.github.binarywang.wxpay.bean.payscore.WxPayScoreResult;
import com.github.binarywang.wxpay.config.WxPayConfig;
@@ -9,11 +8,13 @@ import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.PayScoreService;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.v3.util.AesUtils;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.URIBuilder;
import java.io.IOException;
-import java.net.URI;
import java.net.URISyntaxException;
import java.security.GeneralSecurityException;
import java.util.HashMap;
@@ -23,35 +24,31 @@ import java.util.Map;
* @author doger.wang
* @date 2020/5/14 9:43
*/
-
+@RequiredArgsConstructor
public class PayScoreServiceImpl implements PayScoreService {
- private WxPayService payService;
-
- public PayScoreServiceImpl(WxPayService payService) {
- this.payService = payService;
- }
-
+ private static final Gson GSON = new GsonBuilder().create();
+ private final WxPayService payService;
@Override
public WxPayScoreResult createServiceOrder(WxPayScoreRequest request) throws WxPayException {
- boolean need_user_confirm = request.isNeed_user_confirm();
+ boolean needUserConfirm = request.isNeedUserConfirm();
WxPayConfig config = this.payService.getConfig();
String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder";
request.setAppid(config.getAppId());
- request.setService_id(config.getServiceId());
- request.setNotify_url(config.getPayScoreNotifyUrl());
- String result = payService.postV3(url, JSONObject.toJSONString(request));
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
+ request.setServiceId(config.getServiceId());
+ request.setNotifyUrl(config.getPayScoreNotifyUrl());
+ String result = payService.postV3(url, GSON.toJson(request));
+ WxPayScoreResult wxPayScoreCreateResult = GSON.fromJson(result, WxPayScoreResult.class);
//补充算一下签名给小程序跳转用
String currentTimeMillis = System.currentTimeMillis() + "";
- Map signMap = new HashMap<>();
+ Map signMap = new HashMap<>(8);
signMap.put("mch_id", config.getMchId());
- if (need_user_confirm){
+ if (needUserConfirm) {
signMap.put("package", wxPayScoreCreateResult.getPackageX());
- }else {
+ } else {
signMap.put("service_id", config.getServiceId());
- signMap.put("out_order_no", request.getOut_order_no());
+ signMap.put("out_order_no", request.getOutOrderNo());
}
signMap.put("timestamp", currentTimeMillis);
signMap.put("nonce_str", currentTimeMillis);
@@ -63,131 +60,96 @@ public class PayScoreServiceImpl implements PayScoreService {
}
@Override
- public WxPayScoreResult queryServiceOrder(String out_order_no, String query_id) throws WxPayException, URISyntaxException {
+ public WxPayScoreResult queryServiceOrder(String outOrderNo, String queryId) throws WxPayException, URISyntaxException {
WxPayConfig config = this.payService.getConfig();
String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder";
- URIBuilder uriBuilder = new URIBuilder(url);
- if (StringUtils.isAllEmpty(out_order_no,query_id) || !StringUtils.isAnyEmpty(out_order_no,query_id)){
+ URIBuilder uriBuilder = new URIBuilder(url);
+ if (StringUtils.isAllEmpty(outOrderNo, queryId) || !StringUtils.isAnyEmpty(outOrderNo, queryId)) {
throw new WxPayException("out_order_no,query_id不允许都填写或都不填写");
}
- if (StringUtils.isNotEmpty(out_order_no)){
- uriBuilder.setParameter("out_order_no", out_order_no);
+ if (StringUtils.isNotEmpty(outOrderNo)) {
+ uriBuilder.setParameter("out_order_no", outOrderNo);
}
- if (StringUtils.isNotEmpty(query_id)){
- uriBuilder.setParameter("query_id", query_id);
+ if (StringUtils.isNotEmpty(queryId)) {
+ uriBuilder.setParameter("query_id", queryId);
}
uriBuilder.setParameter("service_id", config.getServiceId());
uriBuilder.setParameter("appid", config.getAppId());
- URI build = uriBuilder.build();
- String result = payService.getV3(build);
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
- //补充一下加密跳转信息
-/* String currentTimeMillis = System.currentTimeMillis() + "";
- Map signMap = new HashMap();
- signMap.put("mch_id", config.getMchId());
- signMap.put("service_id", config.getServiceId());
- signMap.put("out_order_no", out_order_no);
- signMap.put("timestamp", currentTimeMillis);
- signMap.put("nonce_str", currentTimeMillis);
- signMap.put("sign_type", "HMAC-SHA256");
- String sign = AesUtil.createSign(signMap, config.getMchKey());
- signMap.put("sign", sign);
- wxPayScoreCreateResult.setPayScoreSignInfo(signMap);*/
- return wxPayScoreCreateResult;
-
+ String result = payService.getV3(uriBuilder.build());
+ return GSON.fromJson(result, WxPayScoreResult.class);
}
-
-
@Override
- public WxPayScoreResult cancelServiceOrder(String out_order_no, String reason) throws WxPayException {
+ public WxPayScoreResult cancelServiceOrder(String outOrderNo, String reason) throws WxPayException {
WxPayConfig config = this.payService.getConfig();
- String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder/"+out_order_no+"/cancel";
- HashMap map = new HashMap<>();
- map.put("appid",config.getAppId());
- map.put("service_id",config.getServiceId());
- map.put("reason",reason);
- String result = payService.postV3(url, JSONObject.toJSONString(map));
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
- return wxPayScoreCreateResult;
-
+ String url = String.format("%s/v3/payscore/serviceorder/%s/cancel", this.payService.getPayBaseUrl(), outOrderNo);
+ HashMap map = new HashMap<>(4);
+ map.put("appid", config.getAppId());
+ map.put("service_id", config.getServiceId());
+ map.put("reason", reason);
+ String result = payService.postV3(url, GSON.toJson(map));
+ return GSON.fromJson(result, WxPayScoreResult.class);
}
@Override
public WxPayScoreResult modifyServiceOrder(WxPayScoreRequest request) throws WxPayException {
WxPayConfig config = this.payService.getConfig();
- String out_order_no = request.getOut_order_no();
- String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder/"+out_order_no+"/modify";
+ String outOrderNo = request.getOutOrderNo();
+ String url = String.format("%s/v3/payscore/serviceorder/%s/modify", this.payService.getPayBaseUrl(), outOrderNo);
request.setAppid(config.getAppId());
- request.setService_id(config.getServiceId());
- request.setOut_order_no(null);
- //request.setNotify_url(config.getPayScoreNotifyUrl());
- String result = payService.postV3(url, JSONObject.toJSONString(request));
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
- return wxPayScoreCreateResult;
-
-
+ request.setServiceId(config.getServiceId());
+ request.setOutOrderNo(null);
+ String result = payService.postV3(url, GSON.toJson(request));
+ return GSON.fromJson(result, WxPayScoreResult.class);
}
@Override
public WxPayScoreResult completeServiceOrder(WxPayScoreRequest request) throws WxPayException {
WxPayConfig config = this.payService.getConfig();
- String out_order_no = request.getOut_order_no();
- String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder/"+out_order_no+"/complete";
+ String outOrderNo = request.getOutOrderNo();
+ String url = String.format("%s/v3/payscore/serviceorder/%s/complete", this.payService.getPayBaseUrl(), outOrderNo);
request.setAppid(config.getAppId());
- request.setService_id(config.getServiceId());
- //request.setNotify_url(config.getPayScoreNotifyUrl());
- request.setOut_order_no(null);
- String result = payService.postV3(url, JSONObject.toJSONString(request));
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
- return wxPayScoreCreateResult;
-
+ request.setServiceId(config.getServiceId());
+ request.setOutOrderNo(null);
+ String result = payService.postV3(url, GSON.toJson(request));
+ return GSON.fromJson(result, WxPayScoreResult.class);
}
@Override
- public WxPayScoreResult payServiceOrder(String out_order_no) throws WxPayException {
+ public WxPayScoreResult payServiceOrder(String outOrderNo) throws WxPayException {
WxPayConfig config = this.payService.getConfig();
- String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder/"+out_order_no+"/pay";
- HashMap map = new HashMap<>();
- map.put("appid",config.getAppId());
- map.put("service_id",config.getServiceId());
- String result = payService.postV3(url, JSONObject.toJSONString(map));
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
- return wxPayScoreCreateResult;
-
+ String url = String.format("%s/v3/payscore/serviceorder/%s/pay", this.payService.getPayBaseUrl(), outOrderNo);
+ HashMap map = new HashMap<>(2);
+ map.put("appid", config.getAppId());
+ map.put("service_id", config.getServiceId());
+ String result = payService.postV3(url, GSON.toJson(map));
+ return GSON.fromJson(result, WxPayScoreResult.class);
}
@Override
public WxPayScoreResult syncServiceOrder(WxPayScoreRequest request) throws WxPayException {
WxPayConfig config = this.payService.getConfig();
- String out_order_no = request.getOut_order_no();
- String url = this.payService.getPayBaseUrl() + "/v3/payscore/serviceorder/"+out_order_no+"/sync";
+ String outOrderNo = request.getOutOrderNo();
+ String url = String.format("%s/v3/payscore/serviceorder/%s/sync", this.payService.getPayBaseUrl(), outOrderNo);
request.setAppid(config.getAppId());
- request.setService_id(config.getServiceId());
- request.setOut_order_no(null);
- //request.setNotify_url(config.getPayScoreNotifyUrl());
- String result = payService.postV3(url, JSONObject.toJSONString(request));
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(result, WxPayScoreResult.class);
- return wxPayScoreCreateResult;
-
+ request.setServiceId(config.getServiceId());
+ request.setOutOrderNo(null);
+ String result = payService.postV3(url, GSON.toJson(request));
+ return GSON.fromJson(result, WxPayScoreResult.class);
}
@Override
- public WxPayScoreResult decryptNotifyData(NotifyData data) throws WxPayException{
- NotifyData.Resource resource = data.getResource();
- String ciphertext = resource.getCiphertext();
- String associated_data = resource.getAssociated_data();
+ public WxPayScoreResult parseNotifyData(PayScoreNotifyData data) throws WxPayException {
+ PayScoreNotifyData.Resource resource = data.getResource();
+ String cipherText = resource.getCipherText();
+ String associatedData = resource.getAssociatedData();
String nonce = resource.getNonce();
- String apiv3Key = this.payService.getConfig().getApiv3Key();
+ String apiV3Key = this.payService.getConfig().getApiV3Key();
try {
- String s = AesUtils.decryptToString(associated_data, nonce, ciphertext, apiv3Key);
- WxPayScoreResult wxPayScoreCreateResult = JSONObject.parseObject(s, WxPayScoreResult.class);
- return wxPayScoreCreateResult;
- } catch (GeneralSecurityException e) {
- throw new WxPayException("解析报文异常",e);
- } catch (IOException e) {
- throw new WxPayException("解析报文异常",e);
+ String s = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key);
+ return GSON.fromJson(s, WxPayScoreResult.class);
+ } catch (GeneralSecurityException | IOException e) {
+ throw new WxPayException("解析报文异常!", e);
}
-
}
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index 065a3fc08..af74f06e3 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -1,18 +1,11 @@
package com.github.binarywang.wxpay.service.impl;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import javax.net.ssl.SSLContext;
import com.alibaba.fastjson.JSONObject;
import com.github.binarywang.wxpay.bean.WxPayApiData;
-import com.github.binarywang.wxpay.bean.request.WxPayQueryCommentRequest;
-import com.github.binarywang.wxpay.bean.request.WxPayRedpackQueryRequest;
-import com.github.binarywang.wxpay.bean.result.WxPayCommonResult;
-import com.github.binarywang.wxpay.bean.result.WxPayRedpackQueryResult;
-import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.exception.WxPayException;
import jodd.util.Base64;
import org.apache.commons.lang3.StringUtils;
@@ -35,10 +28,6 @@ import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
-import com.github.binarywang.wxpay.bean.WxPayApiData;
-import com.github.binarywang.wxpay.exception.WxPayException;
-import jodd.util.Base64;
-
/**
*
* 微信支付请求实现类,apache httpclient实现.
@@ -158,7 +147,7 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl {
}
private CloseableHttpClient createApiV3HttpClient() throws WxPayException {
- CloseableHttpClient apiv3HttpClient = this.getConfig().getApiv3HttpClient();
+ CloseableHttpClient apiv3HttpClient = this.getConfig().getApiV3HttpClient();
if (null==apiv3HttpClient){
return this.getConfig().initApiV3HttpClient();
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImplTest.java
new file mode 100644
index 000000000..fa0c7b944
--- /dev/null
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImplTest.java
@@ -0,0 +1,46 @@
+package com.github.binarywang.wxpay.service.impl;
+
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+/**
+ * 测试代码,待补充完善.
+ *
+ * @author Binary Wang
+ * @date 2020-05-19
+ */
+public class PayScoreServiceImplTest {
+
+ @Test
+ public void testCreateServiceOrder() {
+ }
+
+ @Test
+ public void testQueryServiceOrder() {
+ }
+
+ @Test
+ public void testCancelServiceOrder() {
+ }
+
+ @Test
+ public void testModifyServiceOrder() {
+ }
+
+ @Test
+ public void testCompleteServiceOrder() {
+ }
+
+ @Test
+ public void testPayServiceOrder() {
+ }
+
+ @Test
+ public void testSyncServiceOrder() {
+ }
+
+ @Test
+ public void testDecryptNotifyData() {
+ }
+}