1
0
mirror of synced 2025-12-19 23:08:13 +08:00

🆕 #2772 【小程序】增加小程序支付管理之创建订单接口

This commit is contained in:
liming1019
2022-08-10 22:44:43 +08:00
committed by GitHub
parent ab26565377
commit cfa92390f2
8 changed files with 195 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package cn.binarywang.wx.miniapp.api.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopPayCreateOrderRequest;
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopPayCreateOrderResponse;
import cn.binarywang.wx.miniapp.test.ApiTestModule;
import com.google.inject.Inject;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import java.util.Arrays;
import static org.assertj.core.api.Assertions.assertThat;
@Test
@Guice(modules = ApiTestModule.class)
public class WxMaShopPayServiceImplTest {
@Inject
private WxMaService wxService;
@Test
public void testCreateOrder() throws Exception {
WxMaShopPayCreateOrderRequest request =
WxMaShopPayCreateOrderRequest.builder()
.openid("")
.combineTradeNo("")
.expireTime(1234L)
.subOrders(Arrays.asList(WxMaShopPayCreateOrderRequest.SubOrdersDTO.builder()
.mchid("")
.amount(0)
.tradeNo("")
.description("")
.build()
))
.build();
WxMaShopPayCreateOrderResponse response = wxService.getWxMaShopPayService().createOrder(request);
assertThat(response).isNotNull();
}
}