• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Adyen / adyen-java-api-library / #2657

18 Sep 2023 12:01PM UTC coverage: 13.219%. First build
#2657

push

web-flow
Merge 17bcee1e5 into ace7d0cdd

1759 of 1759 new or added lines in 33 files covered. (100.0%)

10287 of 77817 relevant lines covered (13.22%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/adyen/model/payment/Split.java
1
/*
2
 * Adyen Payment API
3
 * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods.  To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration).  ## Authentication You need an [API credential](https://docs.adyen.com/development-resources/api-credentials) to authenticate to the API.  If using an API key, add an `X-API-Key` header with the API key as the value, for example:   ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ```  Alternatively, you can use the username and password to connect to the API using basic authentication, for example:  ``` curl -U \"ws@Company.YOUR_COMPANY_ACCOUNT\":\"YOUR_BASIC_AUTHENTICATION_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ```  ## Versioning Payments API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number.  For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v68/authorise ```  ## Going live  To authenticate to the live endpoints, you need an [API credential](https://docs.adyen.com/development-resources/api-credentials) from your live Customer Area.  The live endpoint URLs contain a prefix which is unique to your company account: ```  https://{PREFIX}-pal-live.adyenpayments.com/pal/servlet/Payment/v68/authorise ```  Get your `{PREFIX}` from your live Customer Area under **Developers** > **API URLs** > **Prefix**.
4
 *
5
 * The version of the OpenAPI document: 68
6
 * 
7
 *
8
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
 * https://openapi-generator.tech
10
 * Do not edit the class manually.
11
 */
12

13

14
package com.adyen.model.payment;
15

16
import java.util.Objects;
17
import java.util.Arrays;
18
import java.util.Map;
19
import java.util.HashMap;
20
import com.adyen.model.payment.SplitAmount;
21
import com.fasterxml.jackson.annotation.JsonInclude;
22
import com.fasterxml.jackson.annotation.JsonProperty;
23
import com.fasterxml.jackson.annotation.JsonCreator;
24
import com.fasterxml.jackson.annotation.JsonTypeName;
25
import com.fasterxml.jackson.annotation.JsonValue;
26
import io.swagger.annotations.ApiModel;
27
import io.swagger.annotations.ApiModelProperty;
28
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29
import com.fasterxml.jackson.core.JsonProcessingException;
30

31

32
/**
33
 * Split
34
 */
35
@JsonPropertyOrder({
36
  Split.JSON_PROPERTY_ACCOUNT,
37
  Split.JSON_PROPERTY_AMOUNT,
38
  Split.JSON_PROPERTY_DESCRIPTION,
39
  Split.JSON_PROPERTY_REFERENCE,
40
  Split.JSON_PROPERTY_TYPE
41
})
42

43
public class Split {
44
  public static final String JSON_PROPERTY_ACCOUNT = "account";
45
  private String account;
46

47
  public static final String JSON_PROPERTY_AMOUNT = "amount";
48
  private SplitAmount amount;
49

50
  public static final String JSON_PROPERTY_DESCRIPTION = "description";
51
  private String description;
52

53
  public static final String JSON_PROPERTY_REFERENCE = "reference";
54
  private String reference;
55

56
  /**
57
   * The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.
58
   */
59
  public enum TypeEnum {
×
60
    BALANCEACCOUNT("BalanceAccount"),
×
61
    
62
    COMMISSION("Commission"),
×
63
    
64
    DEFAULT("Default"),
×
65
    
66
    MARKETPLACE("MarketPlace"),
×
67
    
68
    PAYMENTFEE("PaymentFee"),
×
69
    
70
    REMAINDER("Remainder"),
×
71
    
72
    SURCHARGE("Surcharge"),
×
73
    
74
    TIP("Tip"),
×
75
    
76
    VAT("VAT");
×
77

78
    private String value;
79

80
    TypeEnum(String value) {
×
81
      this.value = value;
×
82
    }
×
83

84
    @JsonValue
85
    public String getValue() {
86
      return value;
×
87
    }
88

89
    @Override
90
    public String toString() {
91
      return String.valueOf(value);
×
92
    }
93

94
    @JsonCreator
95
    public static TypeEnum fromValue(String value) {
96
      for (TypeEnum b : TypeEnum.values()) {
×
97
        if (b.value.equals(value)) {
×
98
          return b;
×
99
        }
100
      }
101
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
102
    }
103
  }
104

105
  public static final String JSON_PROPERTY_TYPE = "type";
106
  private TypeEnum type;
107

108
  public Split() { 
×
109
  }
×
110

111
  public Split account(String account) {
112
    this.account = account;
×
113
    return this;
×
114
  }
115

116
   /**
117
   * Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**.  
118
   * @return account
119
  **/
120
  @ApiModelProperty(value = "Unique identifier of the account where the split amount should be sent. This is required if `type` is **MarketPlace** or **BalanceAccount**.  ")
121
  @JsonProperty(JSON_PROPERTY_ACCOUNT)
122
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
123

124
  public String getAccount() {
125
    return account;
×
126
  }
127

128

129
  @JsonProperty(JSON_PROPERTY_ACCOUNT)
130
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
131
  public void setAccount(String account) {
132
    this.account = account;
×
133
  }
×
134

135

136
  public Split amount(SplitAmount amount) {
137
    this.amount = amount;
×
138
    return this;
×
139
  }
140

141
   /**
142
   * Get amount
143
   * @return amount
144
  **/
145
  @ApiModelProperty(required = true, value = "")
146
  @JsonProperty(JSON_PROPERTY_AMOUNT)
147
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
148

149
  public SplitAmount getAmount() {
150
    return amount;
×
151
  }
152

153

154
  @JsonProperty(JSON_PROPERTY_AMOUNT)
155
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
156
  public void setAmount(SplitAmount amount) {
157
    this.amount = amount;
×
158
  }
×
159

160

161
  public Split description(String description) {
162
    this.description = description;
×
163
    return this;
×
164
  }
165

166
   /**
167
   * A description of this split.
168
   * @return description
169
  **/
170
  @ApiModelProperty(value = "A description of this split.")
171
  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
172
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
173

174
  public String getDescription() {
175
    return description;
×
176
  }
177

178

179
  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
180
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
181
  public void setDescription(String description) {
182
    this.description = description;
×
183
  }
×
184

185

186
  public Split reference(String reference) {
187
    this.reference = reference;
×
188
    return this;
×
189
  }
190

191
   /**
192
   * Your reference for the split, which you can use to link the split to other operations such as captures and refunds.  This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms.
193
   * @return reference
194
  **/
195
  @ApiModelProperty(value = "Your reference for the split, which you can use to link the split to other operations such as captures and refunds.  This is required if `type` is **MarketPlace** or **BalanceAccount**. For the other types, we also recommend sending a reference so you can reconcile the split and the associated payment in the transaction overview and in the reports. If the reference is not provided, the split is reported as part of the aggregated [TransferBalance record type](https://docs.adyen.com/reporting/marketpay-payments-accounting-report) in Adyen for Platforms.")
196
  @JsonProperty(JSON_PROPERTY_REFERENCE)
197
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
198

199
  public String getReference() {
200
    return reference;
×
201
  }
202

203

204
  @JsonProperty(JSON_PROPERTY_REFERENCE)
205
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
206
  public void setReference(String reference) {
207
    this.reference = reference;
×
208
  }
×
209

210

211
  public Split type(TypeEnum type) {
212
    this.type = type;
×
213
    return this;
×
214
  }
215

216
   /**
217
   * The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.
218
   * @return type
219
  **/
220
  @ApiModelProperty(required = true, value = "The type of split. Possible values: **Default**, **PaymentFee**, **VAT**, **Commission**, **MarketPlace**, **BalanceAccount**, **Remainder**, **Surcharge**, **Tip**.")
221
  @JsonProperty(JSON_PROPERTY_TYPE)
222
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
223

224
  public TypeEnum getType() {
225
    return type;
×
226
  }
227

228

229
  @JsonProperty(JSON_PROPERTY_TYPE)
230
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
231
  public void setType(TypeEnum type) {
232
    this.type = type;
×
233
  }
×
234

235

236
  /**
237
   * Return true if this Split object is equal to o.
238
   */
239
  @Override
240
  public boolean equals(Object o) {
241
    if (this == o) {
×
242
      return true;
×
243
    }
244
    if (o == null || getClass() != o.getClass()) {
×
245
      return false;
×
246
    }
247
    Split split = (Split) o;
×
248
    return Objects.equals(this.account, split.account) &&
×
249
        Objects.equals(this.amount, split.amount) &&
×
250
        Objects.equals(this.description, split.description) &&
×
251
        Objects.equals(this.reference, split.reference) &&
×
252
        Objects.equals(this.type, split.type);
×
253
  }
254

255
  @Override
256
  public int hashCode() {
257
    return Objects.hash(account, amount, description, reference, type);
×
258
  }
259

260
  @Override
261
  public String toString() {
262
    StringBuilder sb = new StringBuilder();
×
263
    sb.append("class Split {\n");
×
264
    sb.append("    account: ").append(toIndentedString(account)).append("\n");
×
265
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
266
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
×
267
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
×
268
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
×
269
    sb.append("}");
×
270
    return sb.toString();
×
271
  }
272

273
  /**
274
   * Convert the given object to string with each line indented by 4 spaces
275
   * (except the first line).
276
   */
277
  private String toIndentedString(Object o) {
278
    if (o == null) {
×
279
      return "null";
×
280
    }
281
    return o.toString().replace("\n", "\n    ");
×
282
  }
283

284
/**
285
   * Create an instance of Split given an JSON string
286
   *
287
   * @param jsonString JSON string
288
   * @return An instance of Split
289
   * @throws JsonProcessingException if the JSON string is invalid with respect to Split
290
   */
291
  public static Split fromJson(String jsonString) throws JsonProcessingException {
292
    return JSON.getMapper().readValue(jsonString, Split.class);
×
293
  }
294
/**
295
  * Convert an instance of Split to an JSON string
296
  *
297
  * @return JSON string
298
  */
299
  public String toJson() throws JsonProcessingException {
300
    return JSON.getMapper().writeValueAsString(this);
×
301
  }
302
}
303

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc