mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🆕 #3457【小程序】增加发货信息管理里的特殊发货报备接口和查询小程序是否已完成交易结算管理确认的接口
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
package cn.binarywang.wx.miniapp.api;
|
||||
|
||||
import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingIsTradeManagedResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.*;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
@@ -86,4 +83,25 @@ public interface WxMaOrderShippingService {
|
||||
*/
|
||||
WxMaOrderShippingInfoBaseResponse setMsgJumpPath(String path)
|
||||
throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 查询小程序是否已完成交易结算管理确认
|
||||
*
|
||||
* @param appId 待查询小程序的 appid,非服务商调用时仅能查询本账号
|
||||
* @return WxMaOrderShippingITMCCompletedResult
|
||||
* @throws WxErrorException e
|
||||
*/
|
||||
WxMaOrderShippingITMCCompletedResult isTradeManagementConfirmationCompleted(String appId)
|
||||
throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 特殊发货报备
|
||||
* @param orderId 需要特殊发货报备的订单号,可传入微信支付单号或商户单号
|
||||
* @param type 特殊发货报备类型,1为预售商品订单,2为测试订单
|
||||
* @param delayTo 预计发货时间的unix时间戳,type为1时必填,type为2可省略
|
||||
* @return WxMaOrderShippingInfoBaseResponse
|
||||
* @throws WxErrorException e
|
||||
*/
|
||||
WxMaOrderShippingInfoBaseResponse opSpecialOrder(String orderId, Integer type, Long delayTo)
|
||||
throws WxErrorException;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaOrderShippingService;
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaOrderShippingIsTradeManagedRequest;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingIsTradeManagedResponse;
|
||||
import cn.binarywang.wx.miniapp.bean.shop.response.*;
|
||||
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -123,6 +120,34 @@ public class WxMaOrderShippingServiceImpl implements WxMaOrderShippingService {
|
||||
return request(SET_MSG_JUMP_PATH, jsonObject, WxMaOrderShippingInfoBaseResponse.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小程序是否已完成交易结算管理确认
|
||||
*
|
||||
* @param appId 待查询小程序的 appid,非服务商调用时仅能查询本账号
|
||||
* @return WxMaOrderShippingITMCCompletedResult
|
||||
* @throws WxErrorException e
|
||||
*/
|
||||
@Override
|
||||
public WxMaOrderShippingITMCCompletedResult isTradeManagementConfirmationCompleted(String appId) throws WxErrorException {
|
||||
JsonObject jsonObject = GsonHelper.buildJsonObject("appid", appId);
|
||||
return request(IS_TRADE_MANAGEMENT_CONFIRMATION_COMPLETED, jsonObject, WxMaOrderShippingITMCCompletedResult.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特殊发货报备
|
||||
*
|
||||
* @param orderId 需要特殊发货报备的订单号,可传入微信支付单号或商户单号
|
||||
* @param type 特殊发货报备类型,1为预售商品订单,2为测试订单
|
||||
* @param delayTo 预计发货时间的unix时间戳,type为1时必填,type为2可省略
|
||||
* @return WxMaOrderShippingInfoBaseResponse
|
||||
* @throws WxErrorException e
|
||||
*/
|
||||
@Override
|
||||
public WxMaOrderShippingInfoBaseResponse opSpecialOrder(String orderId, Integer type, Long delayTo) throws WxErrorException {
|
||||
JsonObject jsonObject = GsonHelper.buildJsonObject("order_id", orderId, "type", type, "delay_to", delayTo);
|
||||
return request(OP_SPECIAL_ORDER, jsonObject, WxMaOrderShippingInfoBaseResponse.class);
|
||||
}
|
||||
|
||||
private <T> T request(String url, Object request, Class<T> resultT) throws WxErrorException {
|
||||
String responseContent = this.wxMaService.post(url, request);
|
||||
JsonObject jsonObject = GsonParser.parse(responseContent);
|
||||
|
||||
Reference in New Issue
Block a user