diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java index 85c945d428..9dcd5ffb89 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/WxChannelAfterSaleService.java @@ -183,4 +183,94 @@ WxChannelBaseResponse addComplaintEvidence(String complaintId, String content, L * @throws WxErrorException 异常 */ WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdateParam param) throws WxErrorException; + + /** + * 代用户发起售后 + * + * @param param 参数 + * @return 发起结果 + * + * @throws WxErrorException 异常 + */ + AfterSaleCreateResponse genAfterSaleOrder(AfterSaleGenAfterSaleOrderParam param) throws WxErrorException; + + /** + * 代用户发起退差价 + * + * @param param 参数 + * @return 发起结果 + * + * @throws WxErrorException 异常 + */ + AfterSaleCreateResponse refundPriceDiff(AfterSaleRefundPriceDiffParam param) throws WxErrorException; + + /** + * 售后单兑换虚拟号 + * + * @param afterSaleOrderId 售后单号 + * @return 虚拟号信息 + * + * @throws WxErrorException 异常 + */ + AfterSaleVirtualTelNumResponse applyVirtualTelNum(String afterSaleOrderId) throws WxErrorException; + + /** + * 商家处理极速换货用户退货(同意/拒绝) + * + * @param param 参数 + * @return BaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse handleFastExchangeReceipt(AfterSaleHandleFastExchangeReceiptParam param) throws WxErrorException; + + /** + * 获取保障单详情 + * + * @param guaranteeOrderId 保障单号 + * @return 保障单详情 + * + * @throws WxErrorException 异常 + */ + GuaranteeOrderResponse getGuaranteeOrder(String guaranteeOrderId) throws WxErrorException; + + /** + * 商家同意保障单申请 + * + * @param guaranteeOrderId 保障单号 + * @return BaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse merchantAcceptGuarantee(String guaranteeOrderId) throws WxErrorException; + + /** + * 商家协商保障单 + * + * @param param 参数 + * @return BaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse merchantModifyGuarantee(GuaranteeMerchantModifyParam param) throws WxErrorException; + + /** + * 商家举证保障单 + * + * @param param 参数 + * @return BaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse merchantProofGuarantee(GuaranteeMerchantProofParam param) throws WxErrorException; + + /** + * 同步工单 + * + * @param param 参数 + * @return BaseResponse + * + * @throws WxErrorException 异常 + */ + WxChannelBaseResponse syncWorkOrder(SyncWorkOrderParam param) throws WxErrorException; } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java index 92f865444b..af8716e970 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImpl.java @@ -130,4 +130,61 @@ public WxChannelBaseResponse merchantUpdateAfterSale(AfterSaleMerchantUpdatePara return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); } + @Override + public AfterSaleCreateResponse genAfterSaleOrder(AfterSaleGenAfterSaleOrderParam param) throws WxErrorException { + String resJson = shopService.post(AFTER_SALE_GEN_AFTER_SALE_ORDER_URL, param); + return ResponseUtils.decode(resJson, AfterSaleCreateResponse.class); + } + + @Override + public AfterSaleCreateResponse refundPriceDiff(AfterSaleRefundPriceDiffParam param) throws WxErrorException { + String resJson = shopService.post(AFTER_SALE_REFUND_PRICE_DIFF_URL, param); + return ResponseUtils.decode(resJson, AfterSaleCreateResponse.class); + } + + @Override + public AfterSaleVirtualTelNumResponse applyVirtualTelNum(String afterSaleOrderId) throws WxErrorException { + AfterSaleIdParam param = new AfterSaleIdParam(afterSaleOrderId); + String resJson = shopService.post(AFTER_SALE_APPLY_VIRTUAL_TEL_NUM_URL, param); + return ResponseUtils.decode(resJson, AfterSaleVirtualTelNumResponse.class); + } + + @Override + public WxChannelBaseResponse handleFastExchangeReceipt(AfterSaleHandleFastExchangeReceiptParam param) throws WxErrorException { + String resJson = shopService.post(AFTER_SALE_HANDLE_FAST_EXCHANGE_RECEIPT_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } + + @Override + public GuaranteeOrderResponse getGuaranteeOrder(String guaranteeOrderId) throws WxErrorException { + GuaranteeOrderIdParam param = new GuaranteeOrderIdParam(guaranteeOrderId); + String resJson = shopService.post(AFTER_SALE_GET_GUARANTEE_ORDER_URL, param); + return ResponseUtils.decode(resJson, GuaranteeOrderResponse.class); + } + + @Override + public WxChannelBaseResponse merchantAcceptGuarantee(String guaranteeOrderId) throws WxErrorException { + GuaranteeOrderIdParam param = new GuaranteeOrderIdParam(guaranteeOrderId); + String resJson = shopService.post(AFTER_SALE_MERCHANT_ACCEPT_GUARANTEE_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } + + @Override + public WxChannelBaseResponse merchantModifyGuarantee(GuaranteeMerchantModifyParam param) throws WxErrorException { + String resJson = shopService.post(AFTER_SALE_MERCHANT_MODIFY_GUARANTEE_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } + + @Override + public WxChannelBaseResponse merchantProofGuarantee(GuaranteeMerchantProofParam param) throws WxErrorException { + String resJson = shopService.post(AFTER_SALE_MERCHANT_PROOF_GUARANTEE_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } + + @Override + public WxChannelBaseResponse syncWorkOrder(SyncWorkOrderParam param) throws WxErrorException { + String resJson = shopService.post(AFTER_SALE_SYNC_WORK_ORDER_URL, param); + return ResponseUtils.decode(resJson, WxChannelBaseResponse.class); + } + } diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java new file mode 100644 index 0000000000..a8a67febcf --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleCreateResponse.java @@ -0,0 +1,15 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +@Data +@EqualsAndHashCode(callSuper = true) +public class AfterSaleCreateResponse extends WxChannelBaseResponse { + private static final long serialVersionUID = 2680676438284658410L; + + @JsonProperty("aftersale_id") + private String afterSaleId; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java new file mode 100644 index 0000000000..d1081907f5 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleGenAfterSaleOrderParam.java @@ -0,0 +1,22 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AfterSaleGenAfterSaleOrderParam extends AfterSaleRefundPriceDiffParam { + private static final long serialVersionUID = -6873909673739068936L; + + @JsonProperty("count") + private Integer count; + + @JsonProperty("type") + private String type; + + @JsonProperty("address_id") + private String addressId; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java new file mode 100644 index 0000000000..f45aa5cfff --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleHandleFastExchangeReceiptParam.java @@ -0,0 +1,29 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AfterSaleHandleFastExchangeReceiptParam extends AfterSaleIdParam { + private static final long serialVersionUID = 5430106715116197677L; + + @JsonProperty("act") + private Integer act; + + @JsonProperty("reject_reason") + private String rejectReason; + + @JsonProperty("reject_reason_type") + private Integer rejectReasonType; + + @JsonProperty("merchant_text") + private String merchantText; + + @JsonProperty("reject_confirm_exchange") + private List rejectConfirmExchange; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java new file mode 100644 index 0000000000..e6dfd08449 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleRefundPriceDiffParam.java @@ -0,0 +1,33 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.Data; + +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AfterSaleRefundPriceDiffParam implements Serializable { + private static final long serialVersionUID = 3875058376021518123L; + + @JsonProperty("request_id") + private String requestId; + + @JsonProperty("order_id") + private String orderId; + + @JsonProperty("product_id") + private String productId; + + @JsonProperty("sku_id") + private String skuId; + + @JsonProperty("amount") + private Integer amount; + + @JsonProperty("reason") + private String reason; + + @JsonProperty("desc") + private String desc; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java new file mode 100644 index 0000000000..c78d72e7cb --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/AfterSaleVirtualTelNumResponse.java @@ -0,0 +1,18 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +@Data +@EqualsAndHashCode(callSuper = true) +public class AfterSaleVirtualTelNumResponse extends WxChannelBaseResponse { + private static final long serialVersionUID = -2715343569103426942L; + + @JsonProperty("virtual_tel_number") + private String virtualTelNumber; + + @JsonProperty("virtual_tel_expire_time") + private Long virtualTelExpireTime; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java new file mode 100644 index 0000000000..914cd908e9 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantModifyParam.java @@ -0,0 +1,19 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class GuaranteeMerchantModifyParam extends GuaranteeOrderIdParam { + private static final long serialVersionUID = 9193536167701367687L; + + @JsonProperty("bad_level") + private Integer badLevel; + + @JsonProperty("merchant_remark") + private String merchantRemark; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java new file mode 100644 index 0000000000..6a5647e9f0 --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeMerchantProofParam.java @@ -0,0 +1,20 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +@JsonInclude(JsonInclude.Include.NON_NULL) +public class GuaranteeMerchantProofParam extends GuaranteeOrderIdParam { + private static final long serialVersionUID = -2365495841866160967L; + + @JsonProperty("content") + private String content; + + @JsonProperty("pic_list") + private List picList; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderIdParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderIdParam.java new file mode 100644 index 0000000000..7beb0cab7e --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderIdParam.java @@ -0,0 +1,19 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class GuaranteeOrderIdParam implements Serializable { + private static final long serialVersionUID = 4325797703077757139L; + + @JsonProperty("guarantee_order_id") + private String guaranteeOrderId; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java new file mode 100644 index 0000000000..6f6256a9db --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/GuaranteeOrderResponse.java @@ -0,0 +1,16 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Data; +import lombok.EqualsAndHashCode; +import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; + +@Data +@EqualsAndHashCode(callSuper = true) +public class GuaranteeOrderResponse extends WxChannelBaseResponse { + private static final long serialVersionUID = 3977781489692530604L; + + @JsonProperty("guarantee_order") + private JsonNode guaranteeOrder; +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java new file mode 100644 index 0000000000..9416bf021e --- /dev/null +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/after/SyncWorkOrderParam.java @@ -0,0 +1,79 @@ +package me.chanjar.weixin.channel.bean.after; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.Serializable; +import java.util.List; +import lombok.Data; + +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SyncWorkOrderParam implements Serializable { + private static final long serialVersionUID = -7336088606071452113L; + + @JsonProperty("complaint_id") + private String complaintId; + + @JsonProperty("work_order_info") + private WorkOrderInfo workOrderInfo; + + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class WorkOrderInfo implements Serializable { + private static final long serialVersionUID = 8573016851280130766L; + + @JsonProperty("version") + private Integer version; + + @JsonProperty("items") + private List items; + + @JsonProperty("work_order_id") + private String workOrderId; + } + + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class WorkOrderItem implements Serializable { + private static final long serialVersionUID = 6925580701152256736L; + + @JsonProperty("status") + private Integer status; + + @JsonProperty("desc") + private String desc; + + @JsonProperty("update_time") + private Long updateTime; + + @JsonProperty("result_type") + private Integer resultType; + + @JsonProperty("refund_amount") + private Integer refundAmount; + + @JsonProperty("media_list") + private List mediaList; + } + + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class WorkOrderMedia implements Serializable { + private static final long serialVersionUID = 2258990333977395631L; + + @JsonProperty("type") + private Integer type; + + @JsonProperty("picture") + private WorkOrderPicture picture; + } + + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class WorkOrderPicture implements Serializable { + private static final long serialVersionUID = -3339842364541603289L; + + @JsonProperty("tmp_media_id") + private String tmpMediaId; + } +} diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java index 6c2076d85b..7ca1122791 100644 --- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java +++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java @@ -240,6 +240,24 @@ public interface AfterSale { String AFTER_SALE_REJECT_EXCHANGE_RESHIP_URL = "https://api.weixin.qq.com/channels/ec/aftersale/rejectexchangereship"; /** 商家协商*/ String AFTER_SALE_MERCHANT_UPDATE_URL = "https://api.weixin.qq.com/channels/ec/aftersale/merchantupdateaftersale"; + /** 代用户发起售后 */ + String AFTER_SALE_GEN_AFTER_SALE_ORDER_URL = "https://api.weixin.qq.com/channels/ec/aftersale/genaftersaleorder"; + /** 代用户发起退差价 */ + String AFTER_SALE_REFUND_PRICE_DIFF_URL = "https://api.weixin.qq.com/channels/ec/aftersale/refundpricediff"; + /** 售后单兑换虚拟号 */ + String AFTER_SALE_APPLY_VIRTUAL_TEL_NUM_URL = "https://api.weixin.qq.com/channels/ec/aftersale/applyvirtualtelnum"; + /** 商家处理极速换货用户退货 */ + String AFTER_SALE_HANDLE_FAST_EXCHANGE_RECEIPT_URL = "https://api.weixin.qq.com/channels/ec/aftersale/handlefastexchangereceipt"; + /** 获取保障单详情 */ + String AFTER_SALE_GET_GUARANTEE_ORDER_URL = "https://api.weixin.qq.com/channels/ec/aftersale/getguaranteeorder"; + /** 商家同意保障单申请 */ + String AFTER_SALE_MERCHANT_ACCEPT_GUARANTEE_URL = "https://api.weixin.qq.com/channels/ec/aftersale/merchantacceptguarantee"; + /** 商家协商保障单 */ + String AFTER_SALE_MERCHANT_MODIFY_GUARANTEE_URL = "https://api.weixin.qq.com/channels/ec/aftersale/merchantmodifyguarantee"; + /** 商家举证保障单 */ + String AFTER_SALE_MERCHANT_PROOF_GUARANTEE_URL = "https://api.weixin.qq.com/channels/ec/aftersale/merchantproofguarantee"; + /** 同步工单 */ + String AFTER_SALE_SYNC_WORK_ORDER_URL = "https://api.weixin.qq.com/channels/ec/aftersale/syncworkorder"; } /** 纠纷相关接口 */ diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImplTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImplTest.java index 81122f7a03..64eb6fbe7f 100644 --- a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImplTest.java +++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/api/impl/WxChannelAfterSaleServiceImplTest.java @@ -11,9 +11,18 @@ import me.chanjar.weixin.channel.api.WxChannelAfterSaleService; import me.chanjar.weixin.channel.api.WxChannelService; import me.chanjar.weixin.channel.bean.after.AfterSaleInfoResponse; +import me.chanjar.weixin.channel.bean.after.AfterSaleCreateResponse; +import me.chanjar.weixin.channel.bean.after.AfterSaleGenAfterSaleOrderParam; +import me.chanjar.weixin.channel.bean.after.AfterSaleHandleFastExchangeReceiptParam; import me.chanjar.weixin.channel.bean.after.AfterSaleListResponse; +import me.chanjar.weixin.channel.bean.after.AfterSaleRefundPriceDiffParam; import me.chanjar.weixin.channel.bean.after.AfterSaleReasonResponse; import me.chanjar.weixin.channel.bean.after.AfterSaleRejectReasonResponse; +import me.chanjar.weixin.channel.bean.after.AfterSaleVirtualTelNumResponse; +import me.chanjar.weixin.channel.bean.after.GuaranteeMerchantModifyParam; +import me.chanjar.weixin.channel.bean.after.GuaranteeMerchantProofParam; +import me.chanjar.weixin.channel.bean.after.GuaranteeOrderResponse; +import me.chanjar.weixin.channel.bean.after.SyncWorkOrderParam; import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse; import me.chanjar.weixin.channel.bean.complaint.ComplaintOrderResponse; import me.chanjar.weixin.channel.test.ApiTestModule; @@ -128,4 +137,110 @@ public void testGetRejectReason() throws WxErrorException { assertNotNull(rejectReason); assertTrue(rejectReason.isSuccess()); } + + @Test + public void testGenAfterSaleOrder() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + AfterSaleGenAfterSaleOrderParam param = new AfterSaleGenAfterSaleOrderParam(); + param.setRequestId("request-id"); + param.setOrderId(""); + param.setProductId(""); + param.setSkuId(""); + param.setCount(1); + param.setAmount(1); + param.setReason("10000014"); + param.setType("REFUND"); + AfterSaleCreateResponse response = afterSaleService.genAfterSaleOrder(param); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testRefundPriceDiff() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + AfterSaleRefundPriceDiffParam param = new AfterSaleRefundPriceDiffParam(); + param.setRequestId("request-id"); + param.setOrderId(""); + param.setProductId(""); + param.setSkuId(""); + param.setAmount(1); + param.setReason("10001336"); + AfterSaleCreateResponse response = afterSaleService.refundPriceDiff(param); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testApplyVirtualTelNum() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + AfterSaleVirtualTelNumResponse response = afterSaleService.applyVirtualTelNum(""); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testHandleFastExchangeReceipt() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + AfterSaleHandleFastExchangeReceiptParam param = new AfterSaleHandleFastExchangeReceiptParam(); + param.setAfterSaleOrderId(""); + param.setAct(1); + WxChannelBaseResponse response = afterSaleService.handleFastExchangeReceipt(param); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testGetGuaranteeOrder() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + GuaranteeOrderResponse response = afterSaleService.getGuaranteeOrder(""); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testMerchantAcceptGuarantee() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + WxChannelBaseResponse response = afterSaleService.merchantAcceptGuarantee(""); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testMerchantModifyGuarantee() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + GuaranteeMerchantModifyParam param = new GuaranteeMerchantModifyParam(); + param.setGuaranteeOrderId(""); + param.setBadLevel(10); + param.setMerchantRemark("remark"); + WxChannelBaseResponse response = afterSaleService.merchantModifyGuarantee(param); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testMerchantProofGuarantee() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + GuaranteeMerchantProofParam param = new GuaranteeMerchantProofParam(); + param.setGuaranteeOrderId(""); + param.setContent("proof"); + param.setPicList(new ArrayList<>(4)); + WxChannelBaseResponse response = afterSaleService.merchantProofGuarantee(param); + assertNotNull(response); + assertTrue(response.isSuccess()); + } + + @Test + public void testSyncWorkOrder() throws WxErrorException { + WxChannelAfterSaleService afterSaleService = channelService.getAfterSaleService(); + SyncWorkOrderParam param = new SyncWorkOrderParam(); + param.setComplaintId(""); + SyncWorkOrderParam.WorkOrderInfo workOrderInfo = new SyncWorkOrderParam.WorkOrderInfo(); + workOrderInfo.setVersion(1); + workOrderInfo.setWorkOrderId(""); + workOrderInfo.setItems(new ArrayList<>(0)); + param.setWorkOrderInfo(workOrderInfo); + WxChannelBaseResponse response = afterSaleService.syncWorkOrder(param); + assertNotNull(response); + assertTrue(response.isSuccess()); + } }