1
0
mirror of synced 2025-12-23 18:48:00 +08:00

#1033 微信支付增加发送小程序红包的接口

This commit is contained in:
Binary Wang
2019-12-01 16:55:55 +08:00
parent e8a9d00a36
commit 9317366def
5 changed files with 239 additions and 49 deletions

View File

@@ -1,43 +1,14 @@
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.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.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.bean.request.*;
import com.github.binarywang.wxpay.bean.result.*;
import com.github.binarywang.wxpay.constant.WxPayConstants.AccountType;
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType;
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.XmlWxPayConfig;
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 org.assertj.core.api.Assertions.assertThat;
@@ -461,8 +442,7 @@ public class BaseWxPayServiceImplTest {
@Test
public void testReverseOrder() throws Exception {
WxPayOrderReverseResult result = this.payService.reverseOrder(
WxPayOrderReverseRequest
.newBuilder()
WxPayOrderReverseRequest.newBuilder()
.outTradeNo("1111")
.build());
assertNotNull(result);
@@ -541,8 +521,7 @@ public class BaseWxPayServiceImplTest {
@Test
public void testQueryCouponStock() throws Exception {
WxPayCouponStockQueryResult result = this.payService.queryCouponStock(
WxPayCouponStockQueryRequest
.newBuilder()
WxPayCouponStockQueryRequest.newBuilder()
.couponStockId("123")
.build());
this.logger.info(result.toString());
@@ -556,8 +535,7 @@ public class BaseWxPayServiceImplTest {
@Test
public void testQueryCouponInfo() throws Exception {
WxPayCouponInfoQueryResult result = this.payService.queryCouponInfo(
WxPayCouponInfoQueryRequest
.newBuilder()
WxPayCouponInfoQueryRequest.newBuilder()
.openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP4")
.couponId("11")
.stockId("1121")
@@ -632,4 +610,28 @@ public class BaseWxPayServiceImplTest {
//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() {
}
}