🎨 【微信支付】重构分账相关接口,重命名接口方法和请求实体,合并分账v2、v3实现类,方便同时使用

This commit is contained in:
四叶草
2023-08-23 06:11:17 +00:00
committed by Binary Wang
parent f5ac3b181e
commit bcc4839ff0
42 changed files with 904 additions and 897 deletions

View File

@@ -1,8 +1,10 @@
package com.github.binarywang.wxpay.bean.profitsharing;
import com.github.binarywang.wxpay.v3.SpecEncrypt;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
@@ -11,12 +13,90 @@ import java.io.Serializable;
* @version 1.0
*/
public class Receiver implements Serializable {
/**
* <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 Integer amount;
/**
* <pre>
* 字段名:分账描述
* 是否必填:是
* 描述: 分账的原因描述,分账账单中需要体现
* </pre>
*/
@SerializedName("description")
private String description;
/**
* <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;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.notify;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@@ -16,7 +16,7 @@ import java.io.Serializable;
*/
@Data
@NoArgsConstructor
public class ProfitSharingNotifyData implements Serializable{
public class ProfitSharingNotifyV3Response implements Serializable{
private static final long serialVersionUID = 4242383310854692441L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.notify;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@@ -8,17 +8,27 @@ import java.io.Serializable;
/**
*
* 微信V3接口-服务商
* 微信V3接口
* 分账动账通知解密后数据实体
*
* @author linyaqiang
* @since 2023-08-01
* @author yuanbo
* @since 2022-04-26-21:08 PM
*/
@Data
@NoArgsConstructor
public class ProfitSharingPartnerNotifyResult implements Serializable {
public class ProfitSharingNotifyV3Result implements Serializable {
private static final long serialVersionUID = -2875006651351414624L;
/**
* <pre>
* 字段名直连商户号
* 是否必填
* 描述直连模式分账发起和出资商户
* </pre>
*/
@SerializedName("mchid")
private String mchId;
/**
* <pre>
* 字段名服务商商户号

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import java.io.Serializable;
@@ -19,7 +19,7 @@ import lombok.NoArgsConstructor;
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingBillRequest implements Serializable {
public class ProfitSharingBillV3Request implements Serializable {
private static final long serialVersionUID = 5200819754873844593L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;

View File

@@ -1,16 +1,11 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.google.gson.annotations.SerializedName;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.*;
import lombok.experimental.Accessors;
import me.chanjar.weixin.common.annotation.Required;
import java.io.Serializable;
import java.util.Map;
/**
* @author lyt 2023/08/21 15:44
@@ -20,7 +15,7 @@ import java.util.Map;
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingQueryRequest implements Serializable {
public class ProfitSharingQueryV3Request implements Serializable {
private static final long serialVersionUID = 1L;
/**
* <pre>

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;

View File

@@ -1,29 +1,29 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
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 com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.*;
import me.chanjar.weixin.common.annotation.Required;
import java.io.Serializable;
import java.util.Map;
/**
* 添加/删除分账接受方请求对象
*
* 微信V3接口 分账接收方实体
* @author pg
* created on 2021-6-25
*
* @author lyt 2023-08-23 10:09:21
* @version 1.0
*/
@Data
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingReceiver implements Serializable {
private static final long serialVersionUID = -4391888575149767840L;
public class ProfitSharingReceiverV3Request implements Serializable {
private static final long serialVersionUID = 1L;
/**
* <pre>
* 字段名子商户号
@@ -125,41 +125,4 @@ public class ProfitSharingReceiver implements Serializable {
*/
@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;
}
}

View File

@@ -1,12 +1,16 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.v3.SpecEncrypt;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.*;
import me.chanjar.weixin.common.annotation.Required;
import java.io.Serializable;
import java.util.Map;
/**
@@ -21,7 +25,6 @@ import java.util.Map;
@XStreamAlias("xml")
public class ProfitSharingRequest extends BaseWxPayRequest {
private static final long serialVersionUID = 212049937430575842L;
/**
* <pre>
* 字段名微信订单号.
@@ -35,7 +38,6 @@ public class ProfitSharingRequest extends BaseWxPayRequest {
@XStreamAlias("transaction_id")
@Required
private String transactionId;
/**
* <pre>
* 字段名商户分账单号.
@@ -49,7 +51,6 @@ public class ProfitSharingRequest extends BaseWxPayRequest {
@XStreamAlias("out_order_no")
@Required
private String outOrderNo;
/**
* <pre>
* 字段名分账接收方列表.
@@ -77,7 +78,6 @@ public class ProfitSharingRequest extends BaseWxPayRequest {
@Required
private String receivers;
@Override
protected void checkConstraints() throws WxPayException {
// 目前仅支持HMAC-SHA256.

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
@@ -19,7 +19,7 @@ import java.io.Serializable;
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingReturnRequest implements Serializable {
public class ProfitSharingReturnV3Request implements Serializable {
private static final long serialVersionUID = -2175582517588397426L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.github.binarywang.wxpay.bean.request.BaseWxPayRequest;
import com.github.binarywang.wxpay.constant.WxPayConstants;
@@ -9,6 +9,7 @@ import me.chanjar.weixin.common.annotation.Required;
import java.util.Map;
/**
* 解冻剩余资金API请求实体
* @author Wang GuangXin 2019/10/23 14:02
* @version 1.0
*/
@@ -18,7 +19,7 @@ import java.util.Map;
@NoArgsConstructor
@AllArgsConstructor
@XStreamAlias("xml")
public class ProfitSharingFinishRequest extends BaseWxPayRequest {
public class ProfitSharingUnfreezeRequest extends BaseWxPayRequest {
private static final long serialVersionUID = -4265779954583596627L;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.request;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
@@ -19,7 +19,7 @@ import java.io.Serializable;
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingUnfreezeRequest implements Serializable {
public class ProfitSharingUnfreezeV3Request implements Serializable {
private static final long serialVersionUID = 6835471990040104843L;
/**

View File

@@ -0,0 +1,186 @@
package com.github.binarywang.wxpay.bean.profitsharing.request;
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;
import java.util.List;
/**
* 微信V3接口
* 请求分账API请求实体
*
* @author pg
* created on 2021-6-24
*/
@Data
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingV3Request implements Serializable {
private static final long serialVersionUID = 3644929701624280800L;
/**
* <pre>
* 字段名:子商户号
* 是否必填:是
* 描述:微信支付分配的子商户号,即分账的出资商户号。
* </pre>
*/
@SerializedName("sub_mchid")
private String subMchId;
/**
* <pre>
* 字段名应用ID
* 是否必填:是
* 描述微信分配的商户appid
* </pre>
*/
@SerializedName("appid")
private String appid;
/**
* <pre>
* 字段名子商户应用ID
* 是否必填:否
* 描述子商户的公众账号ID分账接收方类型包含PERSONAL_SUB_OPENID时必填
* </pre>
*/
@SerializedName("sub_appid")
private String subAppid;
/**
* <pre>
* 字段名:微信订单号
* 是否必填:是
* 描述:微信支付订单号
* </pre>
*/
@SerializedName("transaction_id")
private String transactionId;
/**
* <pre>
* 字段名:商户分账单号
* 是否必填:是
* 描述商户系统内部的分账单号在商户系统内部唯一同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@
* </pre>
*/
@SerializedName("out_order_no")
private String outOrderNo;
/**
* <pre>
* 字段名:分账接收方列表
* 是否必填:是
* 描述分账接收方列表可以设置出资商户作为分账接受方最多可有50个分账接收方
* </pre>
*/
@SpecEncrypt
@SerializedName("receivers")
private List<Receiver> receivers;
/**
* <pre>
* 字段名:是否解冻剩余未分资金
* 是否必填:是
* 描述:
* 1、如果为true该笔订单剩余未分账的金额会解冻回分账方商户
* 2、如果为false该笔订单剩余未分账的金额不会解冻回分账方商户可以对该笔订单再次进行分账。
* </pre>
*/
@SerializedName("unfreeze_unsplit")
private boolean unfreezeUnsplit;
/**
* 分账接收方实体
*/
@Data
@NoArgsConstructor
public static class Receiver implements Serializable {
private static final long serialVersionUID = 1L;
/**
* <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;
}
}

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import java.io.Serializable;
@@ -15,7 +15,7 @@ import lombok.NoArgsConstructor;
*/
@Data
@NoArgsConstructor
public class ProfitSharingBillResult implements Serializable {
public class ProfitSharingBillV3Result implements Serializable {
private static final long serialVersionUID = -704896948531566657L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.annotations.XStreamAlias;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import java.io.Serializable;
@@ -13,7 +13,7 @@ import lombok.Data;
* @date 2022-12-09
*/
@Data
public class ProfitSharingMerchantMaxRatioQueryResult implements Serializable {
public class ProfitSharingMerchantRatioQueryV3Result implements Serializable {
private static final long serialVersionUID = -6259241881199571683L;
/** 子商户号 */

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.annotations.XStreamAlias;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@@ -13,7 +13,7 @@ import java.io.Serializable;
* created on 2021-6-25
*/
@Data
public class ProfitSharingUnsplitResult implements Serializable {
public class ProfitSharingOrderAmountQueryV3Result implements Serializable {
private static final long serialVersionUID = -7025255772409082288L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.google.gson.FieldNamingPolicy;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.annotations.XStreamAlias;

View File

@@ -0,0 +1,102 @@
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.github.binarywang.wxpay.v3.SpecEncrypt;
import com.google.gson.annotations.SerializedName;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.w3c.dom.Document;
import java.io.Serializable;
/**
* @author 添加/删除分账接收方结果
* @version 1.0
*/
@Data
public class ProfitSharingReceiverV3Result implements Serializable {
private static final long serialVersionUID = 876204163877798066L;
/**
* <pre>
* 字段名:子商户号
* 是否必填:是
* 描述:微信支付分配的子商户号,即分账的出资商户号。
* </pre>
*/
@SerializedName("sub_mchid")
private String subMchId;
/**
* <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;
}

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.google.gson.Gson;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.thoughtworks.xstream.annotations.XStreamAlias;

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@@ -13,7 +13,7 @@ import java.io.Serializable;
* created on 2021-6-25
*/
@Data
public class ProfitSharingReturnResult implements Serializable {
public class ProfitSharingReturnV3Result implements Serializable {
private static final long serialVersionUID = -2175582517588397426L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@@ -14,7 +14,7 @@ import java.util.List;
* created on 2021-6-25
*/
@Data
public class ProfitSharingUnfreezeResult implements Serializable {
public class ProfitSharingUnfreezeV3Result implements Serializable {
private static final long serialVersionUID = 5053171678880645337L;
/**

View File

@@ -1,4 +1,4 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
package com.github.binarywang.wxpay.bean.profitsharing.result;
import com.google.gson.annotations.SerializedName;
@@ -15,7 +15,7 @@ import java.util.List;
* created on 2021-6-24
*/
@Data
public class ProfitSharingResult implements Serializable {
public class ProfitSharingV3Result implements Serializable {
private static final long serialVersionUID = -6201692412535987502L;
/**

View File

@@ -1,128 +0,0 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
*
* 微信V3接口
* 分账动账通知解密后数据实体
*
* @author yuanbo
* @since 2022-04-26-21:08 PM
*/
@Data
@NoArgsConstructor
public class ProfitSharingNotifyResult implements Serializable {
private static final long serialVersionUID = -2875006651351414624L;
/**
* <pre>
* 字段名:直连商户号
* 是否必填:是
* 描述:直连模式分账发起和出资商户
* </pre>
*/
@SerializedName("mchid")
private String mchId;
/**
* <pre>
* 字段名:微信订单号
* 是否必填:是
* 描述:微信支付订单号
* </pre>
*/
@SerializedName("transaction_id")
private String transactionId;
/**
* <pre>
* 字段名:微信分账/回退单号
* 是否必填:是
* 描述:微信分账/回退单号
* </pre>
*/
@SerializedName("order_id")
private String orderId;
/**
* <pre>
* 字段名:商户分账/回退单号
* 是否必填:是
* 描述:分账方系统内部的分账/回退单号
* </pre>
*/
@SerializedName("out_order_no")
private String outOrderNo;
/**
* <pre>
* 字段名:分账接收方
* 是否必填:是
* 描述:分账接收方对象
* </pre>
*/
@SerializedName("receiver")
private Receiver receiver;
/**
* <pre>
* 字段名:成功时间
* 是否必填:是
* 描述成功时间Rfc3339标准
* </pre>
*/
@SerializedName("success_time")
private String successTime;
@Data
@NoArgsConstructor
public static class Receiver implements Serializable {
private static final long serialVersionUID = -931070141604645363L;
/**
* <pre>
* 字段名:分账接收方类型
* 是否必填:是
* 描述MERCHANT_ID商户号mch_id或者sub_mch_id
* </pre>
*/
@SerializedName("type")
private String type;
/**
* <pre>
* 字段名:分账接收方账号
* 是否必填:是
* 描述:申请本功能商户号
* </pre>
*/
@SerializedName("account")
private String account;
/**
* <pre>
* 字段名:分账动账金额
* 是否必填:是
* 描述:分账动账金额,单位为分,只能为整数
* </pre>
*/
@SerializedName("amount")
private Integer amount;
/**
* <pre>
* 字段名:分账/回退描述
* 是否必填:是
* 描述:分账/回退描述
* </pre>
*/
@SerializedName("description")
private String description;
}
}

View File

@@ -1,99 +0,0 @@
package com.github.binarywang.wxpay.bean.profitsharing.v3;
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;
import java.util.List;
/**
* 微信V3接口
* 请求分账API请求实体
*
* @author pg
* created on 2021-6-24
*/
@Data
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class ProfitSharingRequest implements Serializable {
private static final long serialVersionUID = 3644929701624280800L;
/**
* <pre>
* 字段名:子商户号
* 是否必填:是
* 描述:微信支付分配的子商户号,即分账的出资商户号。
* </pre>
*/
@SerializedName("sub_mchid")
private String subMchId;
/**
* <pre>
* 字段名应用ID
* 是否必填:是
* 描述微信分配的商户appid
* </pre>
*/
@SerializedName("appid")
private String appid;
/**
* <pre>
* 字段名子商户应用ID
* 是否必填:否
* 描述子商户的公众账号ID分账接收方类型包含PERSONAL_SUB_OPENID时必填
* </pre>
*/
@SerializedName("sub_appid")
private String subAppid;
/**
* <pre>
* 字段名:微信订单号
* 是否必填:是
* 描述:微信支付订单号
* </pre>
*/
@SerializedName("transaction_id")
private String transactionId;
/**
* <pre>
* 字段名:商户分账单号
* 是否必填:是
* 描述商户系统内部的分账单号在商户系统内部唯一同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@
* </pre>
*/
@SerializedName("out_order_no")
private String outOrderNo;
/**
* <pre>
* 字段名:分账接收方列表
* 是否必填:是
* 描述分账接收方列表可以设置出资商户作为分账接受方最多可有50个分账接收方
* </pre>
*/
@SpecEncrypt
@SerializedName("receivers")
private List<ProfitSharingReceiver> receivers;
/**
* <pre>
* 字段名:是否解冻剩余未分资金
* 是否必填:是
* 描述:
* 1、如果为true该笔订单剩余未分账的金额会解冻回分账方商户
* 2、如果为false该笔订单剩余未分账的金额不会解冻回分账方商户可以对该笔订单再次进行分账。
* </pre>
*/
@SerializedName("unfreeze_unsplit")
private boolean unfreezeUnsplit;
}