#752 修复微信支付拉取支付评价的接口(limit不参与签名)
This commit is contained in:
@@ -1,31 +1,53 @@
|
||||
package com.github.binarywang.wxpay.service.impl;
|
||||
|
||||
import com.github.binarywang.utils.qrcode.QrcodeUtils;
|
||||
import com.github.binarywang.wxpay.bean.coupon.*;
|
||||
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.request.*;
|
||||
import com.github.binarywang.wxpay.bean.result.*;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.AccountType;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||
import com.github.binarywang.wxpay.testbase.XmlWxPayConfig;
|
||||
import com.google.inject.Inject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testng.annotations.*;
|
||||
|
||||
import com.github.binarywang.utils.qrcode.QrcodeUtils;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponInfoQueryRequest;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponInfoQueryResult;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendRequest;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponSendResult;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponStockQueryRequest;
|
||||
import com.github.binarywang.wxpay.bean.coupon.WxPayCouponStockQueryResult;
|
||||
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
|
||||
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResultTest;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayAuthcode2OpenidRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayMicropayRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayOrderReverseRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayRefundRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayReportRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPaySendRedpackRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayShorturlRequest;
|
||||
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayBillResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayFundFlowResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayOrderReverseResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayRedpackQueryResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayRefundQueryResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayRefundResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPaySendRedpackResult;
|
||||
import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.AccountType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.github.binarywang.wxpay.testbase.ApiTestModule;
|
||||
import com.github.binarywang.wxpay.testbase.XmlWxPayConfig;
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.testng.Assert.*;
|
||||
@@ -407,13 +429,12 @@ public class BaseWxPayServiceImplTest {
|
||||
Date endDate = calendar.getTime();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -88);
|
||||
Date beginDate = calendar.getTime();
|
||||
String result = this.payService.queryComment(beginDate, endDate, 0, null);
|
||||
String result = this.payService.queryComment(beginDate, endDate, 0, 1);
|
||||
this.logger.info(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResultTest}
|
||||
* @throws Exception
|
||||
* @see WxPayOrderNotifyResultTest#testFromXML()
|
||||
*/
|
||||
@Test
|
||||
public void testParseOrderNotifyResult() throws Exception {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.github.binarywang.wxpay.util;
|
||||
|
||||
import org.testng.annotations.*;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static com.github.binarywang.wxpay.constant.WxPayConstants.SignType.HMAC_SHA256;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@@ -20,7 +21,7 @@ public class SignUtilsTest {
|
||||
public void testCreateSign() throws Exception {
|
||||
String signKey = "192006250b4c09247ec02edce69f6a2d";
|
||||
String message = "appid=wxd930ea5d5a258f4f&body=test&device_info=1000&mch_id=10000100&nonce_str=ibuaiVcKdpRxkhJA";
|
||||
assertEquals(SignUtils.createSign((Splitter.on("&").withKeyValueSeparator("=").split(message)), null, signKey, false),
|
||||
assertEquals(SignUtils.createSign((Splitter.on("&").withKeyValueSeparator("=").split(message)), null, signKey, null),
|
||||
"9A0A8659F005D6984697E2CA0A9CF3B7");
|
||||
}
|
||||
|
||||
@@ -29,7 +30,7 @@ public class SignUtilsTest {
|
||||
String signKey = "192006250b4c09247ec02edce69f6a2d";
|
||||
final String message = "appid=wxd930ea5d5a258f4f&body=test&device_info=1000&mch_id=10000100&nonce_str=ibuaiVcKdpRxkhJA";
|
||||
String sign = SignUtils.createSign(Splitter.on("&").withKeyValueSeparator("=").split(message),
|
||||
HMAC_SHA256, signKey, false);
|
||||
HMAC_SHA256, signKey, null);
|
||||
assertEquals(sign, "6A9AE1657590FD6257D693A078E1C3E4BB6BA4DC30B23E0EE2496E54170DACD6");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user