新增同意或拒绝修改地址申请

This commit is contained in:
苍鹿 2023-11-14 14:36:47 +08:00
parent 9bc0343e84
commit 2988ac8311
4 changed files with 57 additions and 7 deletions

View File

@ -96,6 +96,26 @@ public interface WxChannelOrderService {
*/
WxChannelBaseResponse updateDelivery(DeliveryUpdateParam param) throws WxErrorException;
/**
* 同意用户修改收货地址请求
*
* @param orderId 订单id
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
WxChannelBaseResponse acceptAddressModify(String orderId) throws WxErrorException;
/**
* 拒接用户修改收货地址请求
*
* @param orderId 订单id
* @return BaseResponse
*
* @throws WxErrorException 异常
*/
WxChannelBaseResponse rejectAddressModify(String orderId) throws WxErrorException;
/**
* 关闭订单 需要订单状态为未付款状态
*

View File

@ -2,13 +2,7 @@ package me.chanjar.weixin.channel.api.impl;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.DELIVERY_SEND_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_LIST_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ORDER_SEARCH_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_ADDRESS_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_EXPRESS_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_PRICE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.UPDATE_REMARK_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.*;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
@ -95,6 +89,20 @@ public class WxChannelOrderServiceImpl implements WxChannelOrderService {
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse acceptAddressModify(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(ACCEPT_ADDRESS_MODIFY_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse rejectAddressModify(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(REJECT_ADDRESS_MODIFY_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse closeOrder(String orderId) {
// 暂不支持

View File

@ -144,6 +144,10 @@ public class WxChannelApiUrlConstants {
String UPDATE_ADDRESS_URL = "https://api.weixin.qq.com/channels/ec/order/address/update";
/** 修改物流信息 */
String UPDATE_EXPRESS_URL = "https://api.weixin.qq.com/channels/ec/order/deliveryinfo/update";
/** 同意用户修改收货地址申请 */
String ACCEPT_ADDRESS_MODIFY_URL = "https://api.weixin.qq.com/channels/ec/order/addressmodify/accept";
/** 拒绝用户修改收货地址申请 */
String REJECT_ADDRESS_MODIFY_URL = "https://api.weixin.qq.com/channels/ec/order/addressmodify/reject";
/** 订单搜索 */
String ORDER_SEARCH_URL = "https://api.weixin.qq.com/channels/ec/order/search";
}

View File

@ -102,6 +102,24 @@ public class WxChannelOrderServiceImplTest {
assertTrue(response.isSuccess());
}
@Test
public void testAcceptAddressModify() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
WxChannelBaseResponse response = orderService.acceptAddressModify(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testRejectAddressModify() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
WxChannelBaseResponse response = orderService.rejectAddressModify(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testCloseOrder() {
WxChannelOrderService orderService = channelService.getOrderService();