View Javadoc
1   package com.foxinmy.weixin4j.pay.profitsharing;
2   
3   import com.alibaba.fastjson.annotation.JSONField;
4   import com.foxinmy.weixin4j.pay.type.profitsharing.ReceiverType;
5   import com.foxinmy.weixin4j.pay.type.profitsharing.RelationType;
6   
7   /**
8    * 分账接收方基础信息
9    * 用于添加或删除分帐接收方时使用
10   *
11   * @author kit(kit_21cn@21cn.com)
12   * @date 2020年05月20日
13   * @since weixin4j-pay 1.1.0
14   */
15  public class Receiver {
16  
17      public Receiver(){}
18  
19      public Receiver(ReceiverType type, String account, RelationType relationType) {
20          this.type = type;
21          this.account = account;
22          this.relationType = relationType;
23      }
24  
25      public Receiver(ReceiverType type, String account, String name, RelationType relationType, String customRelation) {
26          this.type = type;
27          this.account = account;
28          this.name = name;
29          this.relationType = relationType;
30          this.customRelation = customRelation;
31      }
32  
33      /**
34       * 分账接收方类型
35       */
36      private ReceiverType type;
37      /**
38       * 分账接收方帐号
39       * 类型是MERCHANT_ID时,是商户ID
40       * 类型是PERSONAL_WECHATID时,是个人微信号
41       * 类型是PERSONAL_OPENID时,是个人openid
42       * 类型是PERSONAL_SUB_OPENID时,是个人sub_openid
43       */
44      private String account;
45      /**
46       * 分账接收方全称
47       * 分账接收方类型是MERCHANT_ID时,是商户全称(必传)
48       * 分账接收方类型是PERSONAL_WECHATID 时,是个人姓名(必传)
49       * 分账接收方类型是PERSONAL_OPENID时,是个人姓名(选传,传则校验)
50       * 分账接收方类型是PERSONAL_SUB_OPENID时,是个人姓名(选传,传则校验)
51       */
52      private String name;
53      /**
54       * 与分账方的关系类型
55       */
56      @JSONField(name = "relation_type")
57      private RelationType relationType;
58      /**
59       * 自定义的分账关系
60       * 子商户与接收方具体的关系,本字段最多10个字。
61       * 当字段relation_type的值为CUSTOM时,本字段必填
62       */
63      @JSONField(name = "custom_relation")
64      private String customRelation;
65  
66      public ReceiverType getType() {
67          return type;
68      }
69  
70      public void setType(ReceiverType type) {
71          this.type = type;
72      }
73  
74      public String getAccount() {
75          return account;
76      }
77  
78      public void setAccount(String account) {
79          this.account = account;
80      }
81  
82      public String getName() {
83          return name;
84      }
85  
86      public void setName(String name) {
87          this.name = name;
88      }
89  
90      public RelationType getRelationType() {
91          return relationType;
92      }
93  
94      public void setRelationType(RelationType relationType) {
95          this.relationType = relationType;
96      }
97  
98      public String getCustomRelation() {
99          return customRelation;
100     }
101 
102     public void setCustomRelation(String customRelation) {
103         this.customRelation = customRelation;
104     }
105 }