forked from binarywang/WxJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pengg
committed
Jun 25, 2021
1 parent
bf266b8
commit 37959e0
Showing
12 changed files
with
1,135 additions
and
0 deletions.
There are no files selected for viewing
144 changes: 144 additions & 0 deletions
144
...src/main/java/com/github/binarywang/wxpay/bean/profitsharingV3/ProfitSharingReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
package com.github.binarywang.wxpay.bean.profitsharingV3; | ||
|
||
import com.github.binarywang.wxpay.v3.SpecEncrypt; | ||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* | ||
* 微信V3接口 分账接收方实体 | ||
* @author pg | ||
* @date 2021-6-25 | ||
* | ||
*/ | ||
@Data | ||
@Builder(builderMethodName = "newBuilder") | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ProfitSharingReceiver implements Serializable { | ||
private static final long serialVersionUID = -4391888575149767840L; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:应用ID | ||
* 是否必填:是 | ||
* 描述:微信分配的商户appid | ||
* </pre> | ||
*/ | ||
@SerializedName("appid") | ||
private String appid; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账接收方类型 | ||
* 是否必填:是 | ||
* 描述: | ||
* 1、MERCHANT_ID:商户号 | ||
* 2、PERSONAL_OPENID:个人openid(由父商户APPID转换得到) | ||
* </pre> | ||
*/ | ||
@SerializedName("type") | ||
private String type; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账接收方帐号 | ||
* 是否必填:是 | ||
* 描述: | ||
* 1、分账接收方类型为MERCHANT_ID时,分账接收方账号为商户号 | ||
* 2、分账接收方类型为PERSONAL_OPENID时,分账接收方账号为个人openid | ||
* </pre> | ||
*/ | ||
@SerializedName("account") | ||
private String account; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账个人接收方姓名 | ||
* 是否必填:否 | ||
* 描述: | ||
* 可选项,在接收方类型为个人的时可选填,若有值,会检查与 name 是否实名匹配,不匹配会拒绝分账请求 | ||
* 1、分账接收方类型是PERSONAL_OPENID,是个人姓名的密文(选传,传则校验) 此字段的加密方法详见:敏感信息加密说明 | ||
* 2、使用微信支付平台证书中的公钥 | ||
* 3、使用RSAES-OAEP算法进行加密 | ||
* 4、将请求中HTTP头部的Wechatpay-Serial设置为证书序列号 | ||
* </pre> | ||
*/ | ||
@SerializedName("name") | ||
@SpecEncrypt | ||
private String name; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:与分账方的关系类型 | ||
* 是否必填:是 | ||
* 描述:子商户与接收方的关系。 本字段值为枚举: | ||
* STORE:门店 | ||
* STAFF:员工 | ||
* STORE_OWNER:店主 | ||
* PARTNER:合作伙伴 | ||
* HEADQUARTER:总部 | ||
* BRAND:品牌方 | ||
* DISTRIBUTOR:分销商 | ||
* USER:用户 | ||
* SUPPLIER: 供应商 | ||
* CUSTOM:自定义 | ||
* </pre> | ||
*/ | ||
@SerializedName("relation_type") | ||
private String relationType; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:自定义的分账关系 | ||
* 是否必填:是 | ||
* 描述:子商户与接收方具体的关系,本字段最多10个字。 | ||
* 当字段relationType的值为CUSTOM时,本字段必填; | ||
* 当字段relationType的值不为CUSTOM时,本字段无需填写。 | ||
* </pre> | ||
*/ | ||
@SerializedName("custom_relation") | ||
private String customRelation; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账描述 | ||
* 是否必填:是 | ||
* 描述: 分账的原因描述,分账账单中需要体现 | ||
* </pre> | ||
*/ | ||
private String description; | ||
/** | ||
* <pre> | ||
* 字段名:分账金额 | ||
* 是否必填:是 | ||
* 描述: 分账金额,单位为分,只能为整数,不能超过原订单支付金额及最大分账比例金额 | ||
* </pre> | ||
*/ | ||
private Long amount; | ||
|
||
/** | ||
* 此构造函数用于分账接口 | ||
* | ||
* @param type MERCHANT_ID:商户ID | ||
* PERSONAL_WECHATID:个人微信号PERSONAL_OPENID:个人openid(由父商户APPID转换得到)PERSONAL_SUB_OPENID: 个人sub_openid(由子商户APPID转换得到) | ||
* @param account 类型是MERCHANT_ID时,是商户ID | ||
* 类型是PERSONAL_WECHATID时,是个人微信号 | ||
* 类型是PERSONAL_OPENID时,是个人openid | ||
* 类型是PERSONAL_SUB_OPENID时,是个人sub_openid | ||
* @param amount 分账金额,单位为分,只能为整数,不能超过原订单支付金额及最大分账比例金额 | ||
* @param description 分账的原因描述,分账账单中需要体现 | ||
*/ | ||
public ProfitSharingReceiver(String type, String account, Long amount, String description) { | ||
this.type = type; | ||
this.account = account; | ||
this.amount = amount; | ||
this.description = description; | ||
} | ||
|
||
} |
77 changes: 77 additions & 0 deletions
77
.../src/main/java/com/github/binarywang/wxpay/bean/profitsharingV3/ProfitSharingRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.github.binarywang.wxpay.bean.profitsharingV3; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* 微信V3接口 | ||
* 请求分账API请求实体 | ||
* | ||
* @author pg | ||
* @date 2021-6-24 | ||
*/ | ||
@Data | ||
@Builder(builderMethodName = "newBuilder") | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ProfitSharingRequest implements Serializable { | ||
private static final long serialVersionUID = 3644929701624280800L; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:应用ID | ||
* 是否必填:是 | ||
* 描述:微信分配的商户appid | ||
* </pre> | ||
*/ | ||
@SerializedName("appid") | ||
private String appid; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:微信订单号 | ||
* 是否必填:是 | ||
* 描述:微信支付订单号 | ||
* </pre> | ||
*/ | ||
@SerializedName("transaction_id") | ||
private String transactionId; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:商户分账单号 | ||
* 是否必填:是 | ||
* 描述:商户系统内部的分账单号,在商户系统内部唯一,同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@ | ||
* </pre> | ||
*/ | ||
@SerializedName("out_order_no") | ||
private String outOrderNo; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账接收方列表 | ||
* 是否必填:是 | ||
* 描述:分账接收方列表,可以设置出资商户作为分账接受方,最多可有50个分账接收方 | ||
* </pre> | ||
*/ | ||
@SerializedName("receivers") | ||
private List<ProfitSharingReceiver> receivers; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:是否解冻剩余未分资金 | ||
* 是否必填:是 | ||
* 描述: | ||
* 1、如果为true,该笔订单剩余未分账的金额会解冻回分账方商户; | ||
* 2、如果为false,该笔订单剩余未分账的金额不会解冻回分账方商户,可以对该笔订单再次进行分账。 | ||
* </pre> | ||
*/ | ||
@SerializedName("unfreeze_unsplit") | ||
private boolean unfreezeUnsplit; | ||
} |
172 changes: 172 additions & 0 deletions
172
...y/src/main/java/com/github/binarywang/wxpay/bean/profitsharingV3/ProfitSharingResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
package com.github.binarywang.wxpay.bean.profitsharingV3; | ||
|
||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* 微信V3接口 | ||
* 请求分账API返回的分账结果实体 | ||
* | ||
* @author pg | ||
* @date 2021-6-24 | ||
*/ | ||
@Data | ||
public class ProfitSharingResult implements Serializable { | ||
private static final long serialVersionUID = -6201692412535987502L; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:微信订单号 | ||
* 是否必填:是 | ||
* 描述:微信支付订单号 | ||
* </pre> | ||
*/ | ||
@SerializedName("transaction_id") | ||
private String transactionId; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:商户分账单号 | ||
* 是否必填:是 | ||
* 描述:商户系统内部的分账单号,在商户系统内部唯一,同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@ | ||
* </pre> | ||
*/ | ||
@SerializedName("out_order_no") | ||
private String outOrderNo; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:微信分账单号, | ||
* 是否必填:是 | ||
* 描述:微信系统返回的唯一标识. | ||
* </pre> | ||
*/ | ||
@SerializedName("order_id") | ||
private String orderId; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账单状态 | ||
* 是否必填:是 | ||
* 描述:分账单状态(每个接收方的分账结果请查看receivers中的result字段): | ||
* 1、PROCESSING:处理中 | ||
* 2、FINISHED:分账完成. | ||
* </pre> | ||
*/ | ||
@SerializedName("state") | ||
private String state; | ||
|
||
/** | ||
* 分账接收方列表 | ||
*/ | ||
@SerializedName("receivers") | ||
private List<Receiver> receivers; | ||
|
||
@Data | ||
public static class Receiver implements Serializable { | ||
private static final long serialVersionUID = 4240983048700956806L; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账接收方类型 | ||
* 是否必填:是 | ||
* 描述: | ||
* 1、MERCHANT_ID:商户号 | ||
* 2、PERSONAL_OPENID:个人openid(由父商户APPID转换得到) | ||
* </pre> | ||
*/ | ||
@SerializedName("type") | ||
private String type; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账接收方帐号 | ||
* 是否必填:是 | ||
* 描述: | ||
* 1、分账接收方类型为MERCHANT_ID时,分账接收方账号为商户号 | ||
* 2、分账接收方类型为PERSONAL_OPENID时,分账接收方账号为个人openid | ||
* </pre> | ||
*/ | ||
@SerializedName("account") | ||
private String account; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账金额 | ||
* 是否必填:是 | ||
* 描述: 分账金额,单位为分,只能为整数,不能超过原订单支付金额及最大分账比例金额 | ||
* </pre> | ||
*/ | ||
@SerializedName("amount") | ||
private Long amount; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账描述 | ||
* 是否必填:是 | ||
* 描述: 分账的原因描述,分账账单中需要体现 | ||
* </pre> | ||
*/ | ||
@SerializedName("description") | ||
private String description; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账结果 | ||
* 是否必填:是 | ||
* 描述: | ||
* 1、PENDING:待分账 | ||
* 2、SUCCESS:分账成功 | ||
* 3、CLOSED:已关闭 | ||
* </pre> | ||
*/ | ||
@SerializedName("result") | ||
private String result; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账失败原因 | ||
* 是否必填:是 | ||
* 描述:包含以下枚举值: | ||
* 1、ACCOUNT_ABNORMAL : 分账接收账户异常 | ||
* 2、NO_RELATION : 分账关系已解除 | ||
* 3、RECEIVER_HIGH_RISK : 高风险接收方 | ||
* 4、RECEIVER_REAL_NAME_NOT_VERIFIED : 接收方未实名 | ||
* 5、NO_AUTH : 分账权限已解除 | ||
* </pre> | ||
*/ | ||
@SerializedName("fail_reason") | ||
private String failReason; | ||
|
||
/** | ||
* <pre> | ||
* 字段名:分账创建时间 | ||
* 是否必填:是 | ||
* 描述:遵循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秒。 | ||
* </pre> | ||
*/ | ||
@SerializedName("create_time") | ||
private String createTime; | ||
/** | ||
* <pre> | ||
* 字段名:分账完成时间 | ||
* 是否必填:是 | ||
* 描述:遵循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秒。 | ||
* </pre> | ||
*/ | ||
@SerializedName("finish_time") | ||
private String finishTime; | ||
} | ||
} |
Oops, something went wrong.