mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-02 20:02:37 +08:00
🎨 修复小程序支付管理获取订单详情接口请求参数格式错误
This commit is contained in:
parent
3918005b1f
commit
310e1d91be
@ -7,9 +7,11 @@ import cn.binarywang.wx.miniapp.bean.shop.request.WxMaShopPayOrderRefundRequest;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopBaseResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopPayCreateOrderResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaShopPayGetOrderResponse;
|
||||
import com.google.gson.JsonObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.Shop.Pay.*;
|
||||
@ -32,7 +34,8 @@ public class WxMaShopPayServiceImpl implements WxMaShopPayService {
|
||||
|
||||
@Override
|
||||
public WxMaShopPayGetOrderResponse getOrder(String tradeNo) throws WxErrorException {
|
||||
String response = this.wxMaService.post(GET_ORDER, tradeNo);
|
||||
JsonObject request = GsonHelper.buildJsonObject("trade_no", tradeNo);
|
||||
String response = this.wxMaService.post(GET_ORDER, request);
|
||||
return WxGsonBuilder.create().fromJson(response, WxMaShopPayGetOrderResponse.class);
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ 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.bean.shop.response.WxMaShopPayGetOrderResponse;
|
||||
import cn.binarywang.wx.miniapp.test.ApiTestModule;
|
||||
import com.google.inject.Inject;
|
||||
import org.testng.annotations.Guice;
|
||||
@ -37,4 +38,10 @@ public class WxMaShopPayServiceImplTest {
|
||||
WxMaShopPayCreateOrderResponse response = wxService.getWxMaShopPayService().createOrder(request);
|
||||
assertThat(response).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetOrder() throws Exception {
|
||||
WxMaShopPayGetOrderResponse response = wxService.getWxMaShopPayService().getOrder("457243057210572800");
|
||||
assertThat(response).isNotNull();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user