Skip to content

Commit bac1b67

Browse files
thinsstar黄星
andauthored
🆕 #2018 【微信支付】增加营销代金券接口和营销专用图片上传接口
Co-authored-by: 黄星 <huang.xing@aquilaflycloud.com>
1 parent 52c33e2 commit bac1b67

29 files changed

+3079
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.github.binarywang.wxpay.bean.marketing;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.AllArgsConstructor;
5+
import lombok.Builder;
6+
import lombok.Data;
7+
import lombok.NoArgsConstructor;
8+
9+
import java.io.Serializable;
10+
11+
/**
12+
* 设置消息通知地址
13+
* <pre>
14+
* 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter3_12.shtml
15+
* </pre>
16+
*
17+
* @author thinsstar
18+
*/
19+
@Data
20+
@Builder
21+
@NoArgsConstructor
22+
@AllArgsConstructor
23+
public class FavorCallbacksSaveRequest implements Serializable {
24+
25+
private static final long serialVersionUID = 1L;
26+
27+
/**
28+
* <pre>
29+
* 字段名:商户号
30+
* 变量名:mchid
31+
* 是否必填:是
32+
* 类型:string[1,20]
33+
* 描述:
34+
* 微信支付商户号。
35+
* 示例值:9856888
36+
* </pre>
37+
*/
38+
@SerializedName(value = "mchid")
39+
private String mchid;
40+
41+
/**
42+
* <pre>
43+
* 字段名:通知url地址
44+
* 变量名:notify_url
45+
* 是否必填:是
46+
* 类型:string[1,256]
47+
* 描述:
48+
* 支付通知商户url地址。
49+
* 示例值:https://pay.weixin.qq.com
50+
* </pre>
51+
*/
52+
@SerializedName(value = "notify_url")
53+
private String notifyUrl;
54+
55+
/**
56+
* <pre>
57+
* 字段名:回调开关
58+
* 变量名:switch
59+
* 是否必填:否
60+
* 类型:bool
61+
* 描述:
62+
* 如果商户不需要再接收营销事件通知,可通过该开关关闭。枚举值:
63+
* true:开启推送
64+
* false:停止推送
65+
* 示例值:true
66+
* </pre>
67+
*/
68+
@SerializedName(value = "switch")
69+
private Boolean switchBool;
70+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.github.binarywang.wxpay.bean.marketing;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
7+
8+
/**
9+
* 设置消息通知地址返回结果对象
10+
*
11+
* @author thinsstar
12+
*/
13+
@NoArgsConstructor
14+
@Data
15+
public class FavorCallbacksSaveResult {
16+
17+
public static FavorCallbacksSaveResult fromJson(String json) {
18+
return WxGsonBuilder.create().fromJson(json, FavorCallbacksSaveResult.class);
19+
}
20+
21+
/**
22+
* 修改时间
23+
* <p>
24+
* 修改时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss.sss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss.sss表示时分秒毫秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35.120+08:00表示,北京时间2015年5月20日 13点29分35秒。
25+
* 示例值:2015-05-20T13:29:35.120+08:00
26+
*/
27+
@SerializedName("update_time")
28+
private String updateTime;
29+
30+
/**
31+
* 通知地址
32+
* <p>
33+
* 通知地址
34+
* 示例值:api.weixin.qq.com
35+
*/
36+
@SerializedName("notify_url")
37+
private String notifyUrl;
38+
}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
package com.github.binarywang.wxpay.bean.marketing;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.AllArgsConstructor;
5+
import lombok.Builder;
6+
import lombok.Data;
7+
import lombok.NoArgsConstructor;
8+
9+
import java.io.Serializable;
10+
11+
/**
12+
* 发放代金券
13+
* <pre>
14+
* 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/marketing/convention/chapter3_2.shtml
15+
* </pre>
16+
*
17+
* @author thinsstar
18+
*/
19+
@Data
20+
@Builder
21+
@NoArgsConstructor
22+
@AllArgsConstructor
23+
public class FavorCouponsCreateRequest implements Serializable {
24+
25+
private static final long serialVersionUID = 1L;
26+
27+
/**
28+
* <pre>
29+
* 字段名:批次号
30+
* 变量名:stock_id
31+
* 是否必填:是
32+
* 类型:string[1,20]
33+
* 描述:
34+
* 微信为每个批次分配的唯一id。
35+
* 校验规则:必须为代金券(全场券或单品券)批次号,不支持立减与折扣。
36+
* 示例值:9856000
37+
* </pre>
38+
*/
39+
@SerializedName(value = "stock_id")
40+
private String stockId;
41+
42+
/**
43+
* <pre>
44+
* 字段名:商户单据号
45+
* 变量名:out_request_no
46+
* 是否必填:是
47+
* 类型:string[1,128]
48+
* 描述:
49+
* 商户此次发放凭据号(格式:商户id+日期+流水号),可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号,商户侧需保持唯一性。
50+
* 示例值: 89560002019101000121
51+
* </pre>
52+
*/
53+
@SerializedName(value = "out_request_no")
54+
private String outRequestNo;
55+
56+
/**
57+
* <pre>
58+
* 字段名:公众账号ID
59+
* 变量名:appid
60+
* 是否必填:是
61+
* 类型:string[1,128]
62+
* 描述:
63+
* 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid或者小程序的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。。
64+
* 校验规则:
65+
* 1、该appid需要与接口传入中的openid有对应关系;
66+
* 2、该appid需要与调用接口的商户号(即请求头中的商户号)有绑定关系,若未绑定,可参考该指引完成绑定(商家商户号与AppID账号关联管理)
67+
* 示例值:wx233544546545989
68+
* </pre>
69+
*/
70+
@SerializedName(value = "appid")
71+
private String appid;
72+
73+
/**
74+
* <pre>
75+
* 字段名:创建批次的商户号
76+
* 变量名:stock_creator_mchid
77+
* 是否必填:是
78+
* 类型:string[1,20]
79+
* 描述:
80+
* 批次创建方商户号。
81+
* 示例值:8956000
82+
* </pre>
83+
*/
84+
@SerializedName(value = "stock_creator_mchid")
85+
private String stockCreatorMchid;
86+
87+
/**
88+
* <pre>
89+
* 字段名:指定面额发券,面额
90+
* 变量名:coupon_value
91+
* 是否必填:否
92+
* 类型:uint64
93+
* 描述:
94+
* 指定面额发券场景,券面额,其他场景不需要填,单位:分。
95+
* 校验规则:仅在发券时指定面额及门槛的场景才生效,常规发券场景请勿传入该信息。
96+
* 示例值:100
97+
* </pre>
98+
*/
99+
@SerializedName(value = "coupon_value")
100+
private Integer couponValue;
101+
102+
/**
103+
* <pre>
104+
* 字段名:指定面额发券,券门槛
105+
* 变量名:coupon_minimum
106+
* 是否必填:是
107+
* 类型:uint64
108+
* 描述:
109+
* 指定面额发券批次门槛,其他场景不需要,单位:分。
110+
* 校验规则:仅在发券时指定面额及门槛的场景才生效,常规发券场景请勿传入该信息。
111+
* 示例值:100
112+
* </pre>
113+
*/
114+
@SerializedName(value = "coupon_minimum")
115+
private Integer couponMinimum;
116+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.github.binarywang.wxpay.bean.marketing;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
7+
8+
/**
9+
* 发放代金券返回结果对象
10+
*
11+
* @author thinsstar
12+
*/
13+
@NoArgsConstructor
14+
@Data
15+
public class FavorCouponsCreateResult {
16+
17+
public static FavorCouponsCreateResult fromJson(String json) {
18+
return WxGsonBuilder.create().fromJson(json, FavorCouponsCreateResult.class);
19+
}
20+
21+
/**
22+
* 代金券id
23+
* <p>
24+
* 发放给用户的代金券id。
25+
* 示例值:9867041
26+
*/
27+
@SerializedName("coupon_id")
28+
private String couponId;
29+
}

0 commit comments

Comments
 (0)