Skip to content

Commit efb2c52

Browse files
authored
🆕 #2130 【微信支付】增加微信支付部分v3接口
1 parent fa5d892 commit efb2c52

18 files changed

+3959
-6
lines changed
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
package com.github.binarywang.wxpay.bean.notify;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
import java.io.Serializable;
8+
9+
@Data
10+
@NoArgsConstructor
11+
public class OriginNotifyResponse implements Serializable {
12+
private static final long serialVersionUID = 1L;
13+
/**
14+
* <pre>
15+
* 字段名:通知ID
16+
* 变量名:id
17+
* 是否必填:是
18+
* 类型:string[1,36]
19+
* 描述:
20+
* 通知的唯一ID
21+
* 示例值:EV-2018022511223320873
22+
* </pre>
23+
*/
24+
@SerializedName(value = "id")
25+
private String id;
26+
/**
27+
* <pre>
28+
* 字段名:通知创建时间
29+
* 变量名:create_time
30+
* 是否必填:是
31+
* 类型:string[1,32]
32+
* 描述:
33+
* 通知创建的时间,遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒。
34+
* 示例值:2018-06-08T10:34:56+08:00
35+
* </pre>
36+
*/
37+
@SerializedName(value = "create_time")
38+
private String createTime;
39+
/**
40+
* <pre>
41+
* 字段名:通知类型
42+
* 变量名:event_type
43+
* 是否必填:是
44+
* 类型:string[1,32]
45+
* 描述:
46+
* 通知的类型:
47+
* REFUND.SUCCESS:退款成功通知
48+
* REFUND.ABNORMAL:退款异常通知
49+
* REFUND.CLOSED:退款关闭通知
50+
* 示例值:REFUND.SUCCESS
51+
* </pre>
52+
*/
53+
@SerializedName(value = "event_type")
54+
private String eventType;
55+
/**
56+
* <pre>
57+
* 字段名:通知简要说明
58+
* 变量名:summary
59+
* 是否必填:是
60+
* 类型:string[1,16]
61+
* 描述:
62+
* 通知简要说明
63+
* 示例值:退款成功
64+
* </pre>
65+
*/
66+
@SerializedName(value = "summary")
67+
private String summary;
68+
/**
69+
* <pre>
70+
* 字段名:通知数据类型
71+
* 变量名:resource_type
72+
* 是否必填:是
73+
* 类型:string[1,32]
74+
* 描述:
75+
* 通知的资源数据类型,支付成功通知为encrypt-resource
76+
* 示例值:encrypt-resource
77+
* </pre>
78+
*/
79+
@SerializedName(value = "resource_type")
80+
private String resourceType;
81+
/**
82+
* <pre>
83+
* 字段名:通知数据
84+
* 变量名:resource
85+
* 是否必填:是
86+
* 类型:object
87+
* 描述:
88+
* 通知资源数据
89+
* json格式,见示例
90+
* </pre>
91+
*/
92+
@SerializedName(value = "resource")
93+
private Resource resource;
94+
95+
@Data
96+
@NoArgsConstructor
97+
public static class Resource implements Serializable {
98+
private static final long serialVersionUID = 1L;
99+
/**
100+
* <pre>
101+
* 字段名:加密算法类型
102+
* 变量名:algorithm
103+
* 是否必填:是
104+
* 类型:string[1,32]
105+
* 描述:
106+
* 对开启结果数据进行加密的加密算法,目前只支持AEAD_AES_256_GCM
107+
* 示例值:AEAD_AES_256_GCM
108+
* </pre>
109+
*/
110+
@SerializedName(value = "algorithm")
111+
private String algorithm;
112+
/**
113+
* <pre>
114+
* 字段名:原始类型
115+
* 变量名:original_type
116+
* 是否必填:是
117+
* 类型:string[1,16]
118+
* 描述:
119+
* 原始回调类型,为transaction
120+
* 示例值:transaction
121+
* </pre>
122+
*/
123+
@SerializedName(value = "original_type")
124+
private String originalType;
125+
/**
126+
* <pre>
127+
* 字段名:数据密文
128+
* 变量名:ciphertext
129+
* 是否必填:是
130+
* 类型:string[1,1048576]
131+
* 描述:
132+
* Base64编码后的开启/停用结果数据密文
133+
* 示例值:sadsadsadsad
134+
* </pre>
135+
*/
136+
@SerializedName(value = "ciphertext")
137+
private String ciphertext;
138+
/**
139+
* <pre>
140+
* 字段名:附加数据
141+
* 变量名:associated_data
142+
* 是否必填:否
143+
* 类型:string[1,16]
144+
* 描述:
145+
* 附加数据
146+
* 示例值:fdasfwqewlkja484w
147+
* </pre>
148+
*/
149+
@SerializedName(value = "associated_data")
150+
private String associatedData;
151+
/**
152+
* <pre>
153+
* 字段名:随机串
154+
* 变量名:nonce
155+
* 是否必填:是
156+
* 类型:string[1,16]
157+
* 描述:
158+
* 加密使用的随机串
159+
* 示例值:fdasflkja484w
160+
* </pre>
161+
*/
162+
@SerializedName(value = "nonce")
163+
private String nonce;
164+
}
165+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.github.binarywang.wxpay.bean.notify;
2+
3+
import lombok.Data;
4+
import lombok.NoArgsConstructor;
5+
6+
import java.io.Serializable;
7+
8+
/**
9+
* 微信通知接口头部信息,需要做签名验证
10+
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_1.shtml
11+
*/
12+
@Data
13+
@NoArgsConstructor
14+
public class SignatureHeader implements Serializable {
15+
private static final long serialVersionUID = -1L;
16+
/**
17+
* 时间戳
18+
*/
19+
private String timeStamp;
20+
/**
21+
* 随机串
22+
*/
23+
private String nonce;
24+
/**
25+
* 已签名字符串
26+
*/
27+
private String signature;
28+
/**
29+
* 证书序列号
30+
*/
31+
private String serial;
32+
}

0 commit comments

Comments
 (0)