|
@@ -1,43 +1,14 @@ |
|
|
package com.github.binarywang.wxpay.service.impl; |
|
|
package com.github.binarywang.wxpay.service.impl; |
|
|
|
|
|
|
|
|
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.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.coupon.*; |
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; |
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; |
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResultTest; |
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResultTest; |
|
|
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult; |
|
|
import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult; |
|
|
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; |
|
|
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult; |
|
|
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; |
|
|
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.bean.request.*; |
|
|
|
|
|
import com.github.binarywang.wxpay.bean.result.*; |
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants.AccountType; |
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants.AccountType; |
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType; |
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType; |
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType; |
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType; |
|
@@ -47,6 +18,16 @@ import com.github.binarywang.wxpay.service.WxPayService; |
|
|
import com.github.binarywang.wxpay.testbase.ApiTestModule; |
|
|
import com.github.binarywang.wxpay.testbase.ApiTestModule; |
|
|
import com.github.binarywang.wxpay.testbase.XmlWxPayConfig; |
|
|
import com.github.binarywang.wxpay.testbase.XmlWxPayConfig; |
|
|
import com.google.inject.Inject; |
|
|
import com.google.inject.Inject; |
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
import org.testng.annotations.DataProvider; |
|
|
|
|
|
import org.testng.annotations.Guice; |
|
|
|
|
|
import org.testng.annotations.Test; |
|
|
|
|
|
|
|
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
|
import java.nio.file.Path; |
|
|
|
|
|
import java.util.Calendar; |
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType; |
|
|
import static com.github.binarywang.wxpay.constant.WxPayConstants.TarType; |
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
@@ -461,8 +442,7 @@ public class BaseWxPayServiceImplTest { |
|
|
@Test |
|
|
@Test |
|
|
public void testReverseOrder() throws Exception { |
|
|
public void testReverseOrder() throws Exception { |
|
|
WxPayOrderReverseResult result = this.payService.reverseOrder( |
|
|
WxPayOrderReverseResult result = this.payService.reverseOrder( |
|
|
WxPayOrderReverseRequest |
|
|
|
|
|
.newBuilder() |
|
|
|
|
|
|
|
|
WxPayOrderReverseRequest.newBuilder() |
|
|
.outTradeNo("1111") |
|
|
.outTradeNo("1111") |
|
|
.build()); |
|
|
.build()); |
|
|
assertNotNull(result); |
|
|
assertNotNull(result); |
|
@@ -541,8 +521,7 @@ public class BaseWxPayServiceImplTest { |
|
|
@Test |
|
|
@Test |
|
|
public void testQueryCouponStock() throws Exception { |
|
|
public void testQueryCouponStock() throws Exception { |
|
|
WxPayCouponStockQueryResult result = this.payService.queryCouponStock( |
|
|
WxPayCouponStockQueryResult result = this.payService.queryCouponStock( |
|
|
WxPayCouponStockQueryRequest |
|
|
|
|
|
.newBuilder() |
|
|
|
|
|
|
|
|
WxPayCouponStockQueryRequest.newBuilder() |
|
|
.couponStockId("123") |
|
|
.couponStockId("123") |
|
|
.build()); |
|
|
.build()); |
|
|
this.logger.info(result.toString()); |
|
|
this.logger.info(result.toString()); |
|
@@ -556,8 +535,7 @@ public class BaseWxPayServiceImplTest { |
|
|
@Test |
|
|
@Test |
|
|
public void testQueryCouponInfo() throws Exception { |
|
|
public void testQueryCouponInfo() throws Exception { |
|
|
WxPayCouponInfoQueryResult result = this.payService.queryCouponInfo( |
|
|
WxPayCouponInfoQueryResult result = this.payService.queryCouponInfo( |
|
|
WxPayCouponInfoQueryRequest |
|
|
|
|
|
.newBuilder() |
|
|
|
|
|
|
|
|
WxPayCouponInfoQueryRequest.newBuilder() |
|
|
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4") |
|
|
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4") |
|
|
.couponId("11") |
|
|
.couponId("11") |
|
|
.stockId("1121") |
|
|
.stockId("1121") |
|
@@ -632,4 +610,28 @@ public class BaseWxPayServiceImplTest { |
|
|
//see test in testUnifiedOrder() |
|
|
//see test in testUnifiedOrder() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testSendMiniProgramRedpack() throws WxPayException { |
|
|
|
|
|
final WxPaySendMiniProgramRedpackResult result = this.payService |
|
|
|
|
|
.sendMiniProgramRedpack(new WxPaySendMiniProgramRedpackRequest() |
|
|
|
|
|
.setReOpenid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4") |
|
|
|
|
|
.setTotalAmount(1)); |
|
|
|
|
|
System.out.println(result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testDownloadRawBill() { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testTestDownloadRawBill() { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testGetWxPayFaceAuthInfo() { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
public void testFacepay() { |
|
|
|
|
|
} |
|
|
} |
|
|
} |