Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信支付v3接口(不包括合单支付) #2130

Merged
merged 1 commit into from
May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
package com.github.binarywang.wxpay.bean.notify;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
public class OriginNotifyResponse implements Serializable {
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名:通知ID
* 变量名:id
* 是否必填:是
* 类型:string[1,36]
* 描述:
* 通知的唯一ID
* 示例值:EV-2018022511223320873
* </pre>
*/
@SerializedName(value = "id")
private String id;
/**
* <pre>
* 字段名:通知创建时间
* 变量名:create_time
* 是否必填:是
* 类型:string[1,32]
* 描述:
* 通知创建的时间,遵循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秒。
* 示例值:2018-06-08T10:34:56+08:00
* </pre>
*/
@SerializedName(value = "create_time")
private String createTime;
/**
* <pre>
* 字段名:通知类型
* 变量名:event_type
* 是否必填:是
* 类型:string[1,32]
* 描述:
* 通知的类型:
* REFUND.SUCCESS:退款成功通知
* REFUND.ABNORMAL:退款异常通知
* REFUND.CLOSED:退款关闭通知
* 示例值:REFUND.SUCCESS
* </pre>
*/
@SerializedName(value = "event_type")
private String eventType;
/**
* <pre>
* 字段名:通知简要说明
* 变量名:summary
* 是否必填:是
* 类型:string[1,16]
* 描述:
* 通知简要说明
* 示例值:退款成功
* </pre>
*/
@SerializedName(value = "summary")
private String summary;
/**
* <pre>
* 字段名:通知数据类型
* 变量名:resource_type
* 是否必填:是
* 类型:string[1,32]
* 描述:
* 通知的资源数据类型,支付成功通知为encrypt-resource
* 示例值:encrypt-resource
* </pre>
*/
@SerializedName(value = "resource_type")
private String resourceType;
/**
* <pre>
* 字段名:通知数据
* 变量名:resource
* 是否必填:是
* 类型:object
* 描述:
* 通知资源数据
* json格式,见示例
* </pre>
*/
@SerializedName(value = "resource")
private Resource resource;

@Data
@NoArgsConstructor
public static class Resource implements Serializable {
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名:加密算法类型
* 变量名:algorithm
* 是否必填:是
* 类型:string[1,32]
* 描述:
* 对开启结果数据进行加密的加密算法,目前只支持AEAD_AES_256_GCM
* 示例值:AEAD_AES_256_GCM
* </pre>
*/
@SerializedName(value = "algorithm")
private String algorithm;
/**
* <pre>
* 字段名:原始类型
* 变量名:original_type
* 是否必填:是
* 类型:string[1,16]
* 描述:
* 原始回调类型,为transaction
* 示例值:transaction
* </pre>
*/
@SerializedName(value = "original_type")
private String originalType;
/**
* <pre>
* 字段名:数据密文
* 变量名:ciphertext
* 是否必填:是
* 类型:string[1,1048576]
* 描述:
* Base64编码后的开启/停用结果数据密文
* 示例值:sadsadsadsad
* </pre>
*/
@SerializedName(value = "ciphertext")
private String ciphertext;
/**
* <pre>
* 字段名:附加数据
* 变量名:associated_data
* 是否必填:否
* 类型:string[1,16]
* 描述:
* 附加数据
* 示例值:fdasfwqewlkja484w
* </pre>
*/
@SerializedName(value = "associated_data")
private String associatedData;
/**
* <pre>
* 字段名:随机串
* 变量名:nonce
* 是否必填:是
* 类型:string[1,16]
* 描述:
* 加密使用的随机串
* 示例值:fdasflkja484w
* </pre>
*/
@SerializedName(value = "nonce")
private String nonce;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.github.binarywang.wxpay.bean.notify;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
* 微信通知接口头部信息,需要做签名验证
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_1.shtml
*/
@Data
@NoArgsConstructor
public class SignatureHeader implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 时间戳
*/
private String timeStamp;
/**
* 随机串
*/
private String nonce;
/**
* 已签名字符串
*/
private String signature;
/**
* 证书序列号
*/
private String serial;
}
Loading