Skip to content

Commit

Permalink
🆕 Wechat-Group#2615 【企业微信】增加企业微信应用市场付费订单、版本相关接口支持
Browse files Browse the repository at this point in the history
- 获取订单详情
- 获取订单列表
- 延长试用期
  • Loading branch information
MRLEILOVE committed Apr 24, 2022
1 parent 9e0a5bc commit f62ad6c
Show file tree
Hide file tree
Showing 12 changed files with 796 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package me.chanjar.weixin.cp.bean;

import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.Setter;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

/**
* 应用市场延长试用期结果
* @author leiguoqing
* @date 2022年4月24日
*/
@Getter
@Setter
public class WxCpTpProlongTryResult extends WxCpBaseResp {

/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = -5028321625140879571L;

/**
* 延长后的试用到期时间(秒级时间戳)
*/
@SerializedName("try_end_time")
private Long tryEndTime;


/**
* From json wx cp tp order list get result.
*
* @param json the json
* @return the wx cp tp order list get result
*/
public static WxCpTpProlongTryResult fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpProlongTryResult.class);
}

/**
* To json string.
*
* @return the string
*/
@Override
public String toJson() {
return WxCpGsonBuilder.create().toJson(this);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
package me.chanjar.weixin.cp.bean.order;

import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.Setter;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

/**
* 应用版本付费订单详情
*
* @author leiguoqing
* @date 2022年4月24日
*/
@Getter
@Setter
public class WxCpTpOrderDetails extends WxCpBaseResp {

/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = -5028321625140879571L;

/**
* 订单号
*/
@SerializedName("orderid")
private String orderId;

/**
* 订单状态。0-未支付,1-已支付,2-已关闭, 3-未支付且已过期, 4-申请退款中, 5-申请退款成功, 6-退款被拒绝
*/
@SerializedName("order_status")
private Integer orderStatus;

/**
* 订单类型。0-普通订单,1-扩容订单,2-续期,3-版本变更
*/
@SerializedName("order_type")
private Integer orderType;

/**
* 客户企业的corpid
*/
@SerializedName("paid_corpid")
private String paidCorpId;

/**
* 下单操作人员userid。如果是服务商代下单,没有该字段。
*/
@SerializedName("operator_id")
private String operatorId;


/**
* 应用id
*/
@SerializedName("suiteid")
private String suiteId;


/**
* 应用id。(仅旧套件有该字段)
*/
@SerializedName("appid")
private String appId;


/**
* 购买版本ID
*/
@SerializedName("edition_id")
private String editionId;


/**
* 购买版本名字
*/
@SerializedName("edition_name")
private String editionName;


/**
* 实付款金额,单位分
*/
@SerializedName("price")
private Long price;


/**
* 购买的人数
*/
@SerializedName("user_count")
private Integer userCount;


/**
* 购买的时间,单位天
*/
@SerializedName("order_period")
private Integer orderPeriod;

/**
* 下单时间,秒级时间戳
*/
@SerializedName("order_time")
private Long orderTime;

/**
* 付款时间,秒级时间戳
*/
@SerializedName("paid_time")
private Long paidTime;


/**
* 购买生效期的开始时间,秒级时间戳
*/
@SerializedName("begin_time")
private Long beginTime;


/**
* 购买生效期的结束时间,秒级时间戳
*/
@SerializedName("end_time")
private Long endTime;

/**
* 下单来源。0-客户下单;1-服务商代下单;2-代理商代下单
*/
@SerializedName("order_from")
private Integer orderFrom;


/**
* 下单方corpid
*/
@SerializedName("operator_corpid")
private String operatorCorpId;

/**
* 服务商分成金额,单位分
*/
@SerializedName("service_share_amount")
private Long serviceShareAmount;


/**
* 平台分成金额,单位分
*/
@SerializedName("platform_share_amount")
private Long platformShareAmount;


/**
* 代理商分成金额,单位分
*/
@SerializedName("dealer_share_amount")
private Long dealerShareAmount;


/**
* 渠道商信息(仅当有渠道商报备后才会有此字段)
*/
@SerializedName("dealer_corp_info")
private DealerCorpInfo dealerCorpInfo;


/**
* 渠道商信息(仅当有渠道商报备后才会有此字段)
*/
@Getter
@Setter
public static class DealerCorpInfo {
/**
* 代理商corpid
*/
@SerializedName("corpid")
private String corpId;


/**
* 代理商名
*/
@SerializedName("corp_name")
private String corpName;
}

/**
* From json wx cp tp order details.
*
* @param json the json
* @return the wx cp tp order details
*/
public static WxCpTpOrderDetails fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpOrderDetails.class);
}

/**
* To json string.
*
* @return the string
*/
@Override
public String toJson() {
return WxCpGsonBuilder.create().toJson(this);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package me.chanjar.weixin.cp.bean.order;

import com.google.gson.annotations.SerializedName;
import lombok.Getter;
import lombok.Setter;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;

import java.util.List;

/**
* 应用版本付费订单列表
*
* @author leiguoqing
* @date 2022年4月24日
*/
@Getter
@Setter
public class WxCpTpOrderListGetResult extends WxCpBaseResp {

/**
* The constant serialVersionUID.
*/
private static final long serialVersionUID = -5028321625140879571L;

/**
* 订单列表
*/
@SerializedName("order_list")
private List<WxCpTpOrderDetails> orderList;


/**
* From json wx cp tp order list get result.
*
* @param json the json
* @return the wx cp tp order list get result
*/
public static WxCpTpOrderListGetResult fromJson(String json) {
return WxCpGsonBuilder.create().fromJson(json, WxCpTpOrderListGetResult.class);
}

/**
* To json string.
*
* @return the string
*/
@Override
public String toJson() {
return WxCpGsonBuilder.create().toJson(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,15 @@ interface Tp {
String CONTACT_SEARCH = "/cgi-bin/service/contact/search";
String GET_ADMIN_LIST = "/cgi-bin/service/get_admin_list";

// 获取订单详情
String GET_ORDER = "/cgi-bin/service/get_order";

// 获取订单列表
String GET_ORDER_LIST = "/cgi-bin/service/get_order_list";

// 延长试用期
String PROLONG_TRY = "/cgi-bin/service/prolong_try";

}

interface User {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package me.chanjar.weixin.cp.tp.service;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpTpProlongTryResult;


/**
* 应用版本付费版本相关接口
*
* @author leiguoqing
* @date 2022年4月24日
*/
public interface WxCpTpEditionService {

/**
* 延长试用期
* <p>
* <a href='https://developer.work.weixin.qq.com/document/path/91913'>文档地址</a>
* <p/>
* 注意:
* <ul>
* <li>一个应用可以多次延长试用,但是试用总天数不能超过60天</li>
* <li>仅限时试用或试用过期状态下的应用可以延长试用期</li>
* </ul>
*
* @param buyerCorpId 购买方corpId
* @param prolongDays 延长天数
* @param appId 仅旧套件需要填此参数
* @return the order
* @throws WxErrorException the wx error exception
*/
WxCpTpProlongTryResult prolongTry(String buyerCorpId, Integer prolongDays, String appId) throws WxErrorException;
}

0 comments on commit f62ad6c

Please sign in to comment.