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

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

30 Oct 2023 03:06PM CUT coverage: 12.824%. First build
#2775

push

web-flow
Merge 9921af673 into 891748f22

112 of 112 new or added lines in 12 files covered. (100.0%)

12346 of 96273 relevant lines covered (12.82%)

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/checkout/PaymentCaptureRequest.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 70
5
 * 
6
 *
7
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
 * https://openapi-generator.tech
9
 * Do not edit the class manually.
10
 */
11

12

13
package com.adyen.model.checkout;
14

15
import java.util.Objects;
16
import java.util.Arrays;
17
import java.util.Map;
18
import java.util.HashMap;
19
import com.adyen.model.checkout.Amount;
20
import com.adyen.model.checkout.ApplicationInfo;
21
import com.adyen.model.checkout.LineItem;
22
import com.adyen.model.checkout.PlatformChargebackLogic;
23
import com.adyen.model.checkout.Split;
24
import com.adyen.model.checkout.SubMerchantInfo;
25
import com.fasterxml.jackson.annotation.JsonInclude;
26
import com.fasterxml.jackson.annotation.JsonProperty;
27
import com.fasterxml.jackson.annotation.JsonCreator;
28
import com.fasterxml.jackson.annotation.JsonTypeName;
29
import com.fasterxml.jackson.annotation.JsonValue;
30
import io.swagger.annotations.ApiModel;
31
import io.swagger.annotations.ApiModelProperty;
32
import java.util.ArrayList;
33
import java.util.List;
34
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
35
import com.fasterxml.jackson.core.JsonProcessingException;
36

37

38
/**
39
 * PaymentCaptureRequest
40
 */
41
@JsonPropertyOrder({
42
  PaymentCaptureRequest.JSON_PROPERTY_AMOUNT,
43
  PaymentCaptureRequest.JSON_PROPERTY_APPLICATION_INFO,
44
  PaymentCaptureRequest.JSON_PROPERTY_LINE_ITEMS,
45
  PaymentCaptureRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
46
  PaymentCaptureRequest.JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC,
47
  PaymentCaptureRequest.JSON_PROPERTY_REFERENCE,
48
  PaymentCaptureRequest.JSON_PROPERTY_SPLITS,
49
  PaymentCaptureRequest.JSON_PROPERTY_SUB_MERCHANTS
50
})
51

52
public class PaymentCaptureRequest {
53
  public static final String JSON_PROPERTY_AMOUNT = "amount";
54
  private Amount amount;
55

56
  public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo";
57
  private ApplicationInfo applicationInfo;
58

59
  public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems";
60
  private List<LineItem> lineItems = null;
×
61

62
  public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
63
  private String merchantAccount;
64

65
  public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic";
66
  private PlatformChargebackLogic platformChargebackLogic;
67

68
  public static final String JSON_PROPERTY_REFERENCE = "reference";
69
  private String reference;
70

71
  public static final String JSON_PROPERTY_SPLITS = "splits";
72
  private List<Split> splits = null;
×
73

74
  public static final String JSON_PROPERTY_SUB_MERCHANTS = "subMerchants";
75
  private List<SubMerchantInfo> subMerchants = null;
×
76

77
  public PaymentCaptureRequest() { 
×
78
  }
×
79

80
  public PaymentCaptureRequest amount(Amount amount) {
81
    this.amount = amount;
×
82
    return this;
×
83
  }
84

85
   /**
86
   * Get amount
87
   * @return amount
88
  **/
89
  @ApiModelProperty(required = true, value = "")
90
  @JsonProperty(JSON_PROPERTY_AMOUNT)
91
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
92

93
  public Amount getAmount() {
94
    return amount;
×
95
  }
96

97

98
  @JsonProperty(JSON_PROPERTY_AMOUNT)
99
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
100
  public void setAmount(Amount amount) {
101
    this.amount = amount;
×
102
  }
×
103

104

105
  public PaymentCaptureRequest applicationInfo(ApplicationInfo applicationInfo) {
106
    this.applicationInfo = applicationInfo;
×
107
    return this;
×
108
  }
109

110
   /**
111
   * Get applicationInfo
112
   * @return applicationInfo
113
  **/
114
  @ApiModelProperty(value = "")
115
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
116
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
117

118
  public ApplicationInfo getApplicationInfo() {
119
    return applicationInfo;
×
120
  }
121

122

123
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
124
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
125
  public void setApplicationInfo(ApplicationInfo applicationInfo) {
126
    this.applicationInfo = applicationInfo;
×
127
  }
×
128

129

130
  public PaymentCaptureRequest lineItems(List<LineItem> lineItems) {
131
    this.lineItems = lineItems;
×
132
    return this;
×
133
  }
134

135
  public PaymentCaptureRequest addLineItemsItem(LineItem lineItemsItem) {
136
    if (this.lineItems == null) {
×
137
      this.lineItems = new ArrayList<>();
×
138
    }
139
    this.lineItems.add(lineItemsItem);
×
140
    return this;
×
141
  }
142

143
   /**
144
   * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). &gt; This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.
145
   * @return lineItems
146
  **/
147
  @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.")
148
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
149
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
150

151
  public List<LineItem> getLineItems() {
152
    return lineItems;
×
153
  }
154

155

156
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
157
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
158
  public void setLineItems(List<LineItem> lineItems) {
159
    this.lineItems = lineItems;
×
160
  }
×
161

162

163
  public PaymentCaptureRequest merchantAccount(String merchantAccount) {
164
    this.merchantAccount = merchantAccount;
×
165
    return this;
×
166
  }
167

168
   /**
169
   * The merchant account that is used to process the payment.
170
   * @return merchantAccount
171
  **/
172
  @ApiModelProperty(required = true, value = "The merchant account that is used to process the payment.")
173
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
174
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
175

176
  public String getMerchantAccount() {
177
    return merchantAccount;
×
178
  }
179

180

181
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
182
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
183
  public void setMerchantAccount(String merchantAccount) {
184
    this.merchantAccount = merchantAccount;
×
185
  }
×
186

187

188
  public PaymentCaptureRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) {
189
    this.platformChargebackLogic = platformChargebackLogic;
×
190
    return this;
×
191
  }
192

193
   /**
194
   * Get platformChargebackLogic
195
   * @return platformChargebackLogic
196
  **/
197
  @ApiModelProperty(value = "")
198
  @JsonProperty(JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC)
199
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
200

201
  public PlatformChargebackLogic getPlatformChargebackLogic() {
202
    return platformChargebackLogic;
×
203
  }
204

205

206
  @JsonProperty(JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC)
207
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
208
  public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) {
209
    this.platformChargebackLogic = platformChargebackLogic;
×
210
  }
×
211

212

213
  public PaymentCaptureRequest reference(String reference) {
214
    this.reference = reference;
×
215
    return this;
×
216
  }
217

218
   /**
219
   * Your reference for the capture request. Maximum length: 80 characters.
220
   * @return reference
221
  **/
222
  @ApiModelProperty(value = "Your reference for the capture request. Maximum length: 80 characters.")
223
  @JsonProperty(JSON_PROPERTY_REFERENCE)
224
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
225

226
  public String getReference() {
227
    return reference;
×
228
  }
229

230

231
  @JsonProperty(JSON_PROPERTY_REFERENCE)
232
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
233
  public void setReference(String reference) {
234
    this.reference = reference;
×
235
  }
×
236

237

238
  public PaymentCaptureRequest splits(List<Split> splits) {
239
    this.splits = splits;
×
240
    return this;
×
241
  }
242

243
  public PaymentCaptureRequest addSplitsItem(Split splitsItem) {
244
    if (this.splits == null) {
×
245
      this.splits = new ArrayList<>();
×
246
    }
247
    this.splits.add(splitsItem);
×
248
    return this;
×
249
  }
250

251
   /**
252
   * An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information).
253
   * @return splits
254
  **/
255
  @ApiModelProperty(value = "An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information).")
256
  @JsonProperty(JSON_PROPERTY_SPLITS)
257
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
258

259
  public List<Split> getSplits() {
260
    return splits;
×
261
  }
262

263

264
  @JsonProperty(JSON_PROPERTY_SPLITS)
265
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
266
  public void setSplits(List<Split> splits) {
267
    this.splits = splits;
×
268
  }
×
269

270

271
  public PaymentCaptureRequest subMerchants(List<SubMerchantInfo> subMerchants) {
272
    this.subMerchants = subMerchants;
×
273
    return this;
×
274
  }
275

276
  public PaymentCaptureRequest addSubMerchantsItem(SubMerchantInfo subMerchantsItem) {
277
    if (this.subMerchants == null) {
×
278
      this.subMerchants = new ArrayList<>();
×
279
    }
280
    this.subMerchants.add(subMerchantsItem);
×
281
    return this;
×
282
  }
283

284
   /**
285
   * A List of sub-merchants.
286
   * @return subMerchants
287
  **/
288
  @ApiModelProperty(value = "A List of sub-merchants.")
289
  @JsonProperty(JSON_PROPERTY_SUB_MERCHANTS)
290
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
291

292
  public List<SubMerchantInfo> getSubMerchants() {
293
    return subMerchants;
×
294
  }
295

296

297
  @JsonProperty(JSON_PROPERTY_SUB_MERCHANTS)
298
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
299
  public void setSubMerchants(List<SubMerchantInfo> subMerchants) {
300
    this.subMerchants = subMerchants;
×
301
  }
×
302

303

304
  /**
305
   * Return true if this PaymentCaptureRequest object is equal to o.
306
   */
307
  @Override
308
  public boolean equals(Object o) {
309
    if (this == o) {
×
310
      return true;
×
311
    }
312
    if (o == null || getClass() != o.getClass()) {
×
313
      return false;
×
314
    }
315
    PaymentCaptureRequest paymentCaptureRequest = (PaymentCaptureRequest) o;
×
316
    return Objects.equals(this.amount, paymentCaptureRequest.amount) &&
×
317
        Objects.equals(this.applicationInfo, paymentCaptureRequest.applicationInfo) &&
×
318
        Objects.equals(this.lineItems, paymentCaptureRequest.lineItems) &&
×
319
        Objects.equals(this.merchantAccount, paymentCaptureRequest.merchantAccount) &&
×
320
        Objects.equals(this.platformChargebackLogic, paymentCaptureRequest.platformChargebackLogic) &&
×
321
        Objects.equals(this.reference, paymentCaptureRequest.reference) &&
×
322
        Objects.equals(this.splits, paymentCaptureRequest.splits) &&
×
323
        Objects.equals(this.subMerchants, paymentCaptureRequest.subMerchants);
×
324
  }
325

326
  @Override
327
  public int hashCode() {
328
    return Objects.hash(amount, applicationInfo, lineItems, merchantAccount, platformChargebackLogic, reference, splits, subMerchants);
×
329
  }
330

331
  @Override
332
  public String toString() {
333
    StringBuilder sb = new StringBuilder();
×
334
    sb.append("class PaymentCaptureRequest {\n");
×
335
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
336
    sb.append("    applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n");
×
337
    sb.append("    lineItems: ").append(toIndentedString(lineItems)).append("\n");
×
338
    sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
×
339
    sb.append("    platformChargebackLogic: ").append(toIndentedString(platformChargebackLogic)).append("\n");
×
340
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
×
341
    sb.append("    splits: ").append(toIndentedString(splits)).append("\n");
×
342
    sb.append("    subMerchants: ").append(toIndentedString(subMerchants)).append("\n");
×
343
    sb.append("}");
×
344
    return sb.toString();
×
345
  }
346

347
  /**
348
   * Convert the given object to string with each line indented by 4 spaces
349
   * (except the first line).
350
   */
351
  private String toIndentedString(Object o) {
352
    if (o == null) {
×
353
      return "null";
×
354
    }
355
    return o.toString().replace("\n", "\n    ");
×
356
  }
357

358
/**
359
   * Create an instance of PaymentCaptureRequest given an JSON string
360
   *
361
   * @param jsonString JSON string
362
   * @return An instance of PaymentCaptureRequest
363
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentCaptureRequest
364
   */
365
  public static PaymentCaptureRequest fromJson(String jsonString) throws JsonProcessingException {
366
    return JSON.getMapper().readValue(jsonString, PaymentCaptureRequest.class);
×
367
  }
368
/**
369
  * Convert an instance of PaymentCaptureRequest to an JSON string
370
  *
371
  * @return JSON string
372
  */
373
  public String toJson() throws JsonProcessingException {
374
    return JSON.getMapper().writeValueAsString(this);
×
375
  }
376
}
377

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