1
0
mirror of synced 2026-10-16 04:16:11 +08:00

🆕 #4038 【视频号】补充实现小店订单管理缺失的13个接口

This commit is contained in:
Copilot
2026-07-11 17:29:12 +08:00
committed by GitHub
parent 1fa901286c
commit b0b3211d9e
14 changed files with 682 additions and 0 deletions

View File

@@ -9,10 +9,15 @@ import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
import me.chanjar.weixin.channel.bean.order.OrderCompensationDeliveryParam;
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
import me.chanjar.weixin.channel.bean.order.OrderListParam;
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuResponse;
import me.chanjar.weixin.channel.bean.order.PresentSubOrderResponse;
import me.chanjar.weixin.channel.bean.order.PrivateNumberGetPhoneResponse;
import me.chanjar.weixin.channel.bean.order.RealNumberViewAuditResponse;
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -200,4 +205,122 @@ public interface WxChannelOrderService {
* @throws WxErrorException 异常
*/
DecodeSensitiveInfoResponse decodeSensitiveInfo(String orderId) throws WxErrorException;
/**
* 礼物订单新增备注信息
*
* @param orderId 礼物订单ID
* @param note 备注内容
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse addPresentNote(String orderId, String note) throws WxErrorException;
/**
* 获取礼物单的子单列表
*
* @param orderId 礼物订单ID
* @return 子单列表
* @throws WxErrorException 异常
*/
PresentSubOrderResponse getPresentSubOrders(String orderId) throws WxErrorException;
/**
* 获取待发货前更换SKU待处理请求
*
* @param orderId 订单ID
* @return 换SKU信息
* @throws WxErrorException 异常
*/
PreShipmentChangeSkuResponse getPreShipmentChangeSku(String orderId) throws WxErrorException;
/**
* 同意待发货前更换SKU请求
*
* @param orderId 订单ID
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException;
/**
* 拒绝待发货前更换SKU请求
*
* @param orderId 订单ID
* @param rejectReason 拒绝原因
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse rejectPreShipmentChangeSku(String orderId, String rejectReason) throws WxErrorException;
/**
* 申请查看订单真实号码
*
* @param orderId 订单ID
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException;
/**
* 查看订单真实号审核状态
*
* @param orderId 订单ID
* @return 审核状态
* @throws WxErrorException 异常
*/
RealNumberViewAuditResponse getRealNumberViewAudit(String orderId) throws WxErrorException;
/**
* 订单再次申请虚拟号
*
* @param orderId 订单ID
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse applyVirtualNumberAgain(String orderId) throws WxErrorException;
/**
* 订单虚拟号延期
*
* @param orderId 订单ID
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse delayVirtualNumber(String orderId) throws WxErrorException;
/**
* 添加待认证的手机号
*
* @param phone 手机号
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse addPrivatePhone(String phone) throws WxErrorException;
/**
* 获取短信验证码
*
* @param phone 手机号
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse sendPrivatePhoneVerifyCode(String phone) throws WxErrorException;
/**
* 获取小店手机号认证状态
*
* @return 手机号认证状态
* @throws WxErrorException 异常
*/
PrivateNumberGetPhoneResponse getPrivatePhone() throws WxErrorException;
/**
* 订单补发货
*
* @param param 补发货参数
* @return BaseResponse
* @throws WxErrorException 异常
*/
WxChannelBaseResponse compensationDelivery(OrderCompensationDeliveryParam param) throws WxErrorException;
}

View File

@@ -5,16 +5,29 @@ import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delive
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Delivery.GET_DELIVERY_COMPANY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.ACCEPT_ADDRESS_MODIFY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DECODE_SENSITIVE_INFO_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.DELIVERY_COMPENSATION_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.PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRE_SHIPMENT_CHANGE_SKU_REJECT_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRESENT_NOTE_ADD_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.PRESENT_SUB_ORDER_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REAL_NUMBER_APPLY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REAL_NUMBER_VIEW_AUDIT_GET_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.REJECT_ADDRESS_MODIFY_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.UPLOAD_FRESH_INSPECT_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_NUMBER_APPLY_AGAIN_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_NUMBER_DELAY_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.Order.VIRTUAL_TEL_NUMBER_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.ADD_PHONE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.GET_PHONE_URL;
import static me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.PrivateNumber.SEND_VERIFY_CODE_URL;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
@@ -30,6 +43,7 @@ import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
import me.chanjar.weixin.channel.bean.order.OrderAddressParam;
import me.chanjar.weixin.channel.bean.order.OrderCompensationDeliveryParam;
import me.chanjar.weixin.channel.bean.order.OrderIdParam;
import me.chanjar.weixin.channel.bean.order.OrderInfoParam;
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
@@ -38,6 +52,14 @@ import me.chanjar.weixin.channel.bean.order.OrderListResponse;
import me.chanjar.weixin.channel.bean.order.OrderPriceParam;
import me.chanjar.weixin.channel.bean.order.OrderRemarkParam;
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuRejectParam;
import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuResponse;
import me.chanjar.weixin.channel.bean.order.PresentNoteAddParam;
import me.chanjar.weixin.channel.bean.order.PresentSubOrderResponse;
import me.chanjar.weixin.channel.bean.order.PrivateNumberAddPhoneParam;
import me.chanjar.weixin.channel.bean.order.PrivateNumberGetPhoneResponse;
import me.chanjar.weixin.channel.bean.order.PrivateNumberSendVerifyCodeParam;
import me.chanjar.weixin.channel.bean.order.RealNumberViewAuditResponse;
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
import me.chanjar.weixin.channel.util.ResponseUtils;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -178,4 +200,95 @@ public class WxChannelOrderServiceImpl implements WxChannelOrderService {
String resJson = shopService.post(DECODE_SENSITIVE_INFO_URL, reqJson);
return ResponseUtils.decode(resJson, DecodeSensitiveInfoResponse.class);
}
@Override
public WxChannelBaseResponse addPresentNote(String orderId, String note) throws WxErrorException {
PresentNoteAddParam param = new PresentNoteAddParam(orderId, note);
String resJson = shopService.post(PRESENT_NOTE_ADD_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public PresentSubOrderResponse getPresentSubOrders(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(PRESENT_SUB_ORDER_GET_URL, param);
return ResponseUtils.decode(resJson, PresentSubOrderResponse.class);
}
@Override
public PreShipmentChangeSkuResponse getPreShipmentChangeSku(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_GET_URL, param);
return ResponseUtils.decode(resJson, PreShipmentChangeSkuResponse.class);
}
@Override
public WxChannelBaseResponse approvePreShipmentChangeSku(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse rejectPreShipmentChangeSku(String orderId, String rejectReason)
throws WxErrorException {
PreShipmentChangeSkuRejectParam param = new PreShipmentChangeSkuRejectParam(orderId, rejectReason);
String resJson = shopService.post(PRE_SHIPMENT_CHANGE_SKU_REJECT_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse applyRealNumber(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(REAL_NUMBER_APPLY_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public RealNumberViewAuditResponse getRealNumberViewAudit(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(REAL_NUMBER_VIEW_AUDIT_GET_URL, param);
return ResponseUtils.decode(resJson, RealNumberViewAuditResponse.class);
}
@Override
public WxChannelBaseResponse applyVirtualNumberAgain(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(VIRTUAL_NUMBER_APPLY_AGAIN_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse delayVirtualNumber(String orderId) throws WxErrorException {
OrderIdParam param = new OrderIdParam(orderId);
String resJson = shopService.post(VIRTUAL_NUMBER_DELAY_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse addPrivatePhone(String phone) throws WxErrorException {
PrivateNumberAddPhoneParam param = new PrivateNumberAddPhoneParam(phone);
String resJson = shopService.post(ADD_PHONE_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse sendPrivatePhoneVerifyCode(String phone) throws WxErrorException {
PrivateNumberSendVerifyCodeParam param = new PrivateNumberSendVerifyCodeParam(phone);
String resJson = shopService.post(SEND_VERIFY_CODE_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public PrivateNumberGetPhoneResponse getPrivatePhone() throws WxErrorException {
String resJson = shopService.post(GET_PHONE_URL, "{}");
return ResponseUtils.decode(resJson, PrivateNumberGetPhoneResponse.class);
}
@Override
public WxChannelBaseResponse compensationDelivery(OrderCompensationDeliveryParam param)
throws WxErrorException {
String resJson = shopService.post(DELIVERY_COMPENSATION_URL, param);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
}

View File

@@ -0,0 +1,34 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.delivery.DeliveryInfo;
/**
* 订单补发货 请求参数
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
public class OrderCompensationDeliveryParam implements Serializable {
private static final long serialVersionUID = 1L;
/** 订单ID */
@JsonProperty("order_id")
private String orderId;
/** 物流信息列表 */
@JsonProperty("delivery_list")
private List<DeliveryInfo> deliveryList;
}

View File

@@ -0,0 +1,32 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 拒绝待发货前更换SKU请求 请求参数
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
public class PreShipmentChangeSkuRejectParam implements Serializable {
private static final long serialVersionUID = 1L;
/** 订单ID */
@JsonProperty("order_id")
private String orderId;
/** 拒绝原因 */
@JsonProperty("reject_reason")
private String rejectReason;
}

View File

@@ -0,0 +1,25 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
/**
* 获取待发货前更换SKU待处理请求 响应
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class PreShipmentChangeSkuResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1L;
/** 更换SKU信息 */
@JsonProperty("change_sku_info")
private ChangeSkuInfo changeSkuInfo;
}

View File

@@ -0,0 +1,32 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 礼物订单新增备注信息 请求参数
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
public class PresentNoteAddParam implements Serializable {
private static final long serialVersionUID = 1L;
/** 礼物订单ID */
@JsonProperty("order_id")
private String orderId;
/** 备注内容 */
@JsonProperty("note")
private String note;
}

View File

@@ -0,0 +1,26 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
/**
* 获取礼物单的子单列表 响应
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class PresentSubOrderResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1L;
/** 子单列表 */
@JsonProperty("sub_order_ids")
private List<String> subOrderIds;
}

View File

@@ -0,0 +1,28 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 添加待认证手机号 请求参数
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
public class PrivateNumberAddPhoneParam implements Serializable {
private static final long serialVersionUID = 1L;
/** 手机号 */
@JsonProperty("phone")
private String phone;
}

View File

@@ -0,0 +1,26 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
/**
* 获取小店手机号认证状态 响应
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class PrivateNumberGetPhoneResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1L;
/** 手机号认证信息列表 */
@JsonProperty("phone_list")
private List<PrivateNumberPhoneInfo> phoneList;
}

View File

@@ -0,0 +1,29 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 手机号认证信息
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
public class PrivateNumberPhoneInfo implements Serializable {
private static final long serialVersionUID = 1L;
/** 手机号 */
@JsonProperty("phone")
private String phone;
/**
* 认证状态:1-待认证,2-认证成功,3-认证失败
*/
@JsonProperty("auth_status")
private Integer authStatus;
}

View File

@@ -0,0 +1,28 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 获取短信验证码 请求参数
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(Include.NON_NULL)
public class PrivateNumberSendVerifyCodeParam implements Serializable {
private static final long serialVersionUID = 1L;
/** 手机号 */
@JsonProperty("phone")
private String phone;
}

View File

@@ -0,0 +1,31 @@
package me.chanjar.weixin.channel.bean.order;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
/**
* 查看订单真实号审核状态 响应
*
* @author GitHub Copilot
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class RealNumberViewAuditResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1L;
/**
* 审核状态:1-审核中,2-审核通过,3-审核拒绝
*/
@JsonProperty("audit_status")
private Integer auditStatus;
/** 真实号码(审核通过后返回)*/
@JsonProperty("real_number")
private String realNumber;
}

View File

@@ -215,6 +215,37 @@ public class WxChannelApiUrlConstants {
String VIRTUAL_TEL_NUMBER_URL = "https://api.weixin.qq.com/channels/ec/order/virtualtelnumber/get";
/** 解码订单包含的敏感数据 */
String DECODE_SENSITIVE_INFO_URL = "https://api.weixin.qq.com/channels/ec/order/sensitiveinfo/decode";
/** 礼物订单新增备注信息 */
String PRESENT_NOTE_ADD_URL = "https://api.weixin.qq.com/channels/ec/order/presentnote/add";
/** 获取礼物单的子单列表 */
String PRESENT_SUB_ORDER_GET_URL = "https://api.weixin.qq.com/channels/ec/order/presentsuborder/get";
/** 获取待发货前更换sku待处理请求 */
String PRE_SHIPMENT_CHANGE_SKU_GET_URL = "https://api.weixin.qq.com/channels/ec/order/preshipmentchangesku/get";
/** 同意待发货前更换sku请求 */
String PRE_SHIPMENT_CHANGE_SKU_APPROVE_URL = "https://api.weixin.qq.com/channels/ec/order/preshipmentchangesku/approve";
/** 拒绝待发货前更换sku请求 */
String PRE_SHIPMENT_CHANGE_SKU_REJECT_URL = "https://api.weixin.qq.com/channels/ec/order/preshipmentchangesku/reject";
/** 申请查看订单真实号码 */
String REAL_NUMBER_APPLY_URL = "https://api.weixin.qq.com/channels/ec/order/realnumber/apply";
/** 查看订单真实号审核状态 */
String REAL_NUMBER_VIEW_AUDIT_GET_URL = "https://api.weixin.qq.com/channels/ec/order/realnumberviewaudit/get";
/** 订单再次申请虚拟号 */
String VIRTUAL_NUMBER_APPLY_AGAIN_URL = "https://api.weixin.qq.com/channels/ec/order/virtualnumber/applyagain";
/** 订单虚拟号延期 */
String VIRTUAL_NUMBER_DELAY_URL = "https://api.weixin.qq.com/channels/ec/order/virtualnumber/delay";
/** 订单补发货 */
String DELIVERY_COMPENSATION_URL = "https://api.weixin.qq.com/channels/ec/order/delivery/compensation";
}
/** 虚拟号管理相关接口 */
public interface PrivateNumber {
/** 添加待认证的手机号 */
String ADD_PHONE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/addphone";
/** 获取短信验证码 */
String SEND_VERIFY_CODE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/sendverifycode";
/** 获取小店手机号认证状态 */
String GET_PHONE_URL = "https://api.weixin.qq.com/channels/ec/merchant/privatenumber/getphone";
}
/** 售后相关接口 */

View File

@@ -17,11 +17,16 @@ import me.chanjar.weixin.channel.bean.order.ChangeOrderInfo;
import me.chanjar.weixin.channel.bean.order.DecodeSensitiveInfoResponse;
import me.chanjar.weixin.channel.bean.order.DeliveryUpdateParam;
import me.chanjar.weixin.channel.bean.order.OrderAddressInfo;
import me.chanjar.weixin.channel.bean.order.OrderCompensationDeliveryParam;
import me.chanjar.weixin.channel.bean.order.OrderInfoResponse;
import me.chanjar.weixin.channel.bean.order.OrderListParam;
import me.chanjar.weixin.channel.bean.order.OrderListResponse;
import me.chanjar.weixin.channel.bean.order.OrderSearchCondition;
import me.chanjar.weixin.channel.bean.order.OrderSearchParam;
import me.chanjar.weixin.channel.bean.order.PreShipmentChangeSkuResponse;
import me.chanjar.weixin.channel.bean.order.PresentSubOrderResponse;
import me.chanjar.weixin.channel.bean.order.PrivateNumberGetPhoneResponse;
import me.chanjar.weixin.channel.bean.order.RealNumberViewAuditResponse;
import me.chanjar.weixin.channel.bean.order.VirtualTelNumberResponse;
import me.chanjar.weixin.channel.test.ApiTestModule;
import me.chanjar.weixin.common.error.WxErrorException;
@@ -198,4 +203,123 @@ public class WxChannelOrderServiceImplTest {
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testAddPresentNote() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
String note = "测试备注";
WxChannelBaseResponse response = orderService.addPresentNote(orderId, note);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testGetPresentSubOrders() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
PresentSubOrderResponse response = orderService.getPresentSubOrders(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testGetPreShipmentChangeSku() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
PreShipmentChangeSkuResponse response = orderService.getPreShipmentChangeSku(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testApprovePreShipmentChangeSku() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
WxChannelBaseResponse response = orderService.approvePreShipmentChangeSku(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testRejectPreShipmentChangeSku() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
String rejectReason = "库存不足";
WxChannelBaseResponse response = orderService.rejectPreShipmentChangeSku(orderId, rejectReason);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testApplyRealNumber() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
WxChannelBaseResponse response = orderService.applyRealNumber(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testGetRealNumberViewAudit() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
RealNumberViewAuditResponse response = orderService.getRealNumberViewAudit(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testApplyVirtualNumberAgain() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
WxChannelBaseResponse response = orderService.applyVirtualNumberAgain(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testDelayVirtualNumber() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String orderId = "";
WxChannelBaseResponse response = orderService.delayVirtualNumber(orderId);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testAddPrivatePhone() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String phone = "13800138000";
WxChannelBaseResponse response = orderService.addPrivatePhone(phone);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testSendPrivatePhoneVerifyCode() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
String phone = "13800138000";
WxChannelBaseResponse response = orderService.sendPrivatePhoneVerifyCode(phone);
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testGetPrivatePhone() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
PrivateNumberGetPhoneResponse response = orderService.getPrivatePhone();
assertNotNull(response);
assertTrue(response.isSuccess());
}
@Test
public void testCompensationDelivery() throws WxErrorException {
WxChannelOrderService orderService = channelService.getOrderService();
OrderCompensationDeliveryParam param = new OrderCompensationDeliveryParam();
param.setOrderId("");
WxChannelBaseResponse response = orderService.compensationDelivery(param);
assertNotNull(response);
assertTrue(response.isSuccess());
}
}