🆕 【视频号】增加视频号小店的同意和拒绝修改地址的接口 !114

This commit is contained in:
北鹤 2023-11-15 10:24:31 +00:00 committed by Binary Wang
parent b9bd619e6f
commit 9f21f59d75
5 changed files with 69 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

@ -32,4 +32,16 @@ public class OrderDeliveryInfo implements Serializable {
@JsonProperty("deliver_method")
private Integer deliverMethod;
/** 用户下单后申请修改收货地址,商家同意后该字段会覆盖订单地址信息 */
@JsonProperty("address_under_review")
private OrderAddressInfo addressUnderReview;
/** 修改地址申请时间,秒级时间戳 */
@JsonProperty("address_apply_time")
private Long addressApplyTime;
/** 电子面单代发时的订单密文 */
@JsonProperty("ewaybill_order_code")
private String ewaybillOrderCode;
}

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();