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

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

24 May 2024 12:08PM UTC coverage: 12.05%. First build
#3286

push

web-flow
Merge 8e2ea04f7 into 67f331171

10 of 150 new or added lines in 13 files covered. (6.67%)

12475 of 103524 relevant lines covered (12.05%)

0.12 hits per line

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

9.68
/src/main/java/com/adyen/model/checkout/PaymentMethod.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 71
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.InputDetail;
20
import com.adyen.model.checkout.PaymentMethodGroup;
21
import com.adyen.model.checkout.PaymentMethodIssuer;
22
import com.adyen.model.checkout.PaymentMethodUPIApps;
23
import com.fasterxml.jackson.annotation.JsonInclude;
24
import com.fasterxml.jackson.annotation.JsonProperty;
25
import com.fasterxml.jackson.annotation.JsonCreator;
26
import com.fasterxml.jackson.annotation.JsonTypeName;
27
import com.fasterxml.jackson.annotation.JsonValue;
28
import io.swagger.annotations.ApiModel;
29
import io.swagger.annotations.ApiModelProperty;
30
import java.util.ArrayList;
31
import java.util.HashMap;
32
import java.util.List;
33
import java.util.Map;
34
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
35
import com.fasterxml.jackson.core.JsonProcessingException;
36

37

38
/**
39
 * PaymentMethod
40
 */
41
@JsonPropertyOrder({
42
  PaymentMethod.JSON_PROPERTY_APPS,
43
  PaymentMethod.JSON_PROPERTY_BRAND,
44
  PaymentMethod.JSON_PROPERTY_BRANDS,
45
  PaymentMethod.JSON_PROPERTY_CONFIGURATION,
46
  PaymentMethod.JSON_PROPERTY_FUNDING_SOURCE,
47
  PaymentMethod.JSON_PROPERTY_GROUP,
48
  PaymentMethod.JSON_PROPERTY_INPUT_DETAILS,
49
  PaymentMethod.JSON_PROPERTY_ISSUERS,
50
  PaymentMethod.JSON_PROPERTY_NAME,
51
  PaymentMethod.JSON_PROPERTY_TYPE
52
})
53

54
public class PaymentMethod {
55
  public static final String JSON_PROPERTY_APPS = "apps";
56
  private List<PaymentMethodUPIApps> apps = null;
1✔
57

58
  public static final String JSON_PROPERTY_BRAND = "brand";
59
  private String brand;
60

61
  public static final String JSON_PROPERTY_BRANDS = "brands";
62
  private List<String> brands = null;
1✔
63

64
  public static final String JSON_PROPERTY_CONFIGURATION = "configuration";
65
  private Map<String, String> configuration = null;
1✔
66

67
  /**
68
   * The funding source of the payment method.
69
   */
70
  public enum FundingSourceEnum {
×
71
    CREDIT("credit"),
×
72
    
73
    DEBIT("debit");
×
74

75
    private String value;
76

77
    FundingSourceEnum(String value) {
×
78
      this.value = value;
×
79
    }
×
80

81
    @JsonValue
82
    public String getValue() {
83
      return value;
×
84
    }
85

86
    @Override
87
    public String toString() {
88
      return String.valueOf(value);
×
89
    }
90

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

102
  public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource";
103
  private FundingSourceEnum fundingSource;
104

105
  public static final String JSON_PROPERTY_GROUP = "group";
106
  private PaymentMethodGroup group;
107

108
  public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails";
109
  @Deprecated
1✔
110
  private List<InputDetail> inputDetails = null;
111

112
  public static final String JSON_PROPERTY_ISSUERS = "issuers";
113
  private List<PaymentMethodIssuer> issuers = null;
1✔
114

115
  public static final String JSON_PROPERTY_NAME = "name";
116
  private String name;
117

118
  public static final String JSON_PROPERTY_TYPE = "type";
119
  private String type;
120

121
  public PaymentMethod() { 
1✔
122
  }
1✔
123

124
  public PaymentMethod apps(List<PaymentMethodUPIApps> apps) {
NEW
125
    this.apps = apps;
×
NEW
126
    return this;
×
127
  }
128

129
  public PaymentMethod addAppsItem(PaymentMethodUPIApps appsItem) {
NEW
130
    if (this.apps == null) {
×
NEW
131
      this.apps = new ArrayList<>();
×
132
    }
NEW
133
    this.apps.add(appsItem);
×
NEW
134
    return this;
×
135
  }
136

137
   /**
138
   * A list of apps for this payment method.
139
   * @return apps
140
  **/
141
  @ApiModelProperty(value = "A list of apps for this payment method.")
142
  @JsonProperty(JSON_PROPERTY_APPS)
143
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
144

145
  public List<PaymentMethodUPIApps> getApps() {
NEW
146
    return apps;
×
147
  }
148

149

150
 /**
151
  * A list of apps for this payment method.
152
  *
153
  * @param apps
154
  */ 
155
  @JsonProperty(JSON_PROPERTY_APPS)
156
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
157
  public void setApps(List<PaymentMethodUPIApps> apps) {
NEW
158
    this.apps = apps;
×
NEW
159
  }
×
160

161

162
  public PaymentMethod brand(String brand) {
163
    this.brand = brand;
×
164
    return this;
×
165
  }
166

167
   /**
168
   * Brand for the selected gift card. For example: plastix, hmclub.
169
   * @return brand
170
  **/
171
  @ApiModelProperty(value = "Brand for the selected gift card. For example: plastix, hmclub.")
172
  @JsonProperty(JSON_PROPERTY_BRAND)
173
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
174

175
  public String getBrand() {
176
    return brand;
×
177
  }
178

179

180
 /**
181
  * Brand for the selected gift card. For example: plastix, hmclub.
182
  *
183
  * @param brand
184
  */ 
185
  @JsonProperty(JSON_PROPERTY_BRAND)
186
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
187
  public void setBrand(String brand) {
188
    this.brand = brand;
×
189
  }
×
190

191

192
  public PaymentMethod brands(List<String> brands) {
193
    this.brands = brands;
×
194
    return this;
×
195
  }
196

197
  public PaymentMethod addBrandsItem(String brandsItem) {
198
    if (this.brands == null) {
×
199
      this.brands = new ArrayList<>();
×
200
    }
201
    this.brands.add(brandsItem);
×
202
    return this;
×
203
  }
204

205
   /**
206
   * List of possible brands. For example: visa, mc.
207
   * @return brands
208
  **/
209
  @ApiModelProperty(value = "List of possible brands. For example: visa, mc.")
210
  @JsonProperty(JSON_PROPERTY_BRANDS)
211
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
212

213
  public List<String> getBrands() {
214
    return brands;
×
215
  }
216

217

218
 /**
219
  * List of possible brands. For example: visa, mc.
220
  *
221
  * @param brands
222
  */ 
223
  @JsonProperty(JSON_PROPERTY_BRANDS)
224
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
225
  public void setBrands(List<String> brands) {
226
    this.brands = brands;
×
227
  }
×
228

229

230
  public PaymentMethod configuration(Map<String, String> configuration) {
231
    this.configuration = configuration;
×
232
    return this;
×
233
  }
234

235
  public PaymentMethod putConfigurationItem(String key, String configurationItem) {
236
    if (this.configuration == null) {
×
237
      this.configuration = new HashMap<>();
×
238
    }
239
    this.configuration.put(key, configurationItem);
×
240
    return this;
×
241
  }
242

243
   /**
244
   * The configuration of the payment method.
245
   * @return configuration
246
  **/
247
  @ApiModelProperty(value = "The configuration of the payment method.")
248
  @JsonProperty(JSON_PROPERTY_CONFIGURATION)
249
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
250

251
  public Map<String, String> getConfiguration() {
252
    return configuration;
×
253
  }
254

255

256
 /**
257
  * The configuration of the payment method.
258
  *
259
  * @param configuration
260
  */ 
261
  @JsonProperty(JSON_PROPERTY_CONFIGURATION)
262
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
263
  public void setConfiguration(Map<String, String> configuration) {
264
    this.configuration = configuration;
×
265
  }
×
266

267

268
  public PaymentMethod fundingSource(FundingSourceEnum fundingSource) {
269
    this.fundingSource = fundingSource;
×
270
    return this;
×
271
  }
272

273
   /**
274
   * The funding source of the payment method.
275
   * @return fundingSource
276
  **/
277
  @ApiModelProperty(value = "The funding source of the payment method.")
278
  @JsonProperty(JSON_PROPERTY_FUNDING_SOURCE)
279
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
280

281
  public FundingSourceEnum getFundingSource() {
282
    return fundingSource;
×
283
  }
284

285

286
 /**
287
  * The funding source of the payment method.
288
  *
289
  * @param fundingSource
290
  */ 
291
  @JsonProperty(JSON_PROPERTY_FUNDING_SOURCE)
292
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
293
  public void setFundingSource(FundingSourceEnum fundingSource) {
294
    this.fundingSource = fundingSource;
×
295
  }
×
296

297

298
  public PaymentMethod group(PaymentMethodGroup group) {
299
    this.group = group;
×
300
    return this;
×
301
  }
302

303
   /**
304
   * Get group
305
   * @return group
306
  **/
307
  @ApiModelProperty(value = "")
308
  @JsonProperty(JSON_PROPERTY_GROUP)
309
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
310

311
  public PaymentMethodGroup getGroup() {
312
    return group;
×
313
  }
314

315

316
 /**
317
  * group
318
  *
319
  * @param group
320
  */ 
321
  @JsonProperty(JSON_PROPERTY_GROUP)
322
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
323
  public void setGroup(PaymentMethodGroup group) {
324
    this.group = group;
×
325
  }
×
326

327

328
  @Deprecated
329
  public PaymentMethod inputDetails(List<InputDetail> inputDetails) {
330
    this.inputDetails = inputDetails;
×
331
    return this;
×
332
  }
333

334
  public PaymentMethod addInputDetailsItem(InputDetail inputDetailsItem) {
335
    if (this.inputDetails == null) {
×
336
      this.inputDetails = new ArrayList<>();
×
337
    }
338
    this.inputDetails.add(inputDetailsItem);
×
339
    return this;
×
340
  }
341

342
   /**
343
   * All input details to be provided to complete the payment with this payment method.
344
   * @return inputDetails
345
   * @deprecated
346
  **/
347
  @Deprecated
348
  @ApiModelProperty(value = "All input details to be provided to complete the payment with this payment method.")
349
  @JsonProperty(JSON_PROPERTY_INPUT_DETAILS)
350
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
351

352
  public List<InputDetail> getInputDetails() {
353
    return inputDetails;
×
354
  }
355

356

357
 /**
358
  * All input details to be provided to complete the payment with this payment method.
359
  *
360
  * @param inputDetails
361
  */ 
362
  @Deprecated
363
  @JsonProperty(JSON_PROPERTY_INPUT_DETAILS)
364
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
365
  public void setInputDetails(List<InputDetail> inputDetails) {
366
    this.inputDetails = inputDetails;
×
367
  }
×
368

369

370
  public PaymentMethod issuers(List<PaymentMethodIssuer> issuers) {
371
    this.issuers = issuers;
×
372
    return this;
×
373
  }
374

375
  public PaymentMethod addIssuersItem(PaymentMethodIssuer issuersItem) {
376
    if (this.issuers == null) {
×
377
      this.issuers = new ArrayList<>();
×
378
    }
379
    this.issuers.add(issuersItem);
×
380
    return this;
×
381
  }
382

383
   /**
384
   * A list of issuers for this payment method.
385
   * @return issuers
386
  **/
387
  @ApiModelProperty(value = "A list of issuers for this payment method.")
388
  @JsonProperty(JSON_PROPERTY_ISSUERS)
389
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
390

391
  public List<PaymentMethodIssuer> getIssuers() {
392
    return issuers;
×
393
  }
394

395

396
 /**
397
  * A list of issuers for this payment method.
398
  *
399
  * @param issuers
400
  */ 
401
  @JsonProperty(JSON_PROPERTY_ISSUERS)
402
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
403
  public void setIssuers(List<PaymentMethodIssuer> issuers) {
404
    this.issuers = issuers;
×
405
  }
×
406

407

408
  public PaymentMethod name(String name) {
409
    this.name = name;
×
410
    return this;
×
411
  }
412

413
   /**
414
   * The displayable name of this payment method.
415
   * @return name
416
  **/
417
  @ApiModelProperty(value = "The displayable name of this payment method.")
418
  @JsonProperty(JSON_PROPERTY_NAME)
419
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
420

421
  public String getName() {
422
    return name;
×
423
  }
424

425

426
 /**
427
  * The displayable name of this payment method.
428
  *
429
  * @param name
430
  */ 
431
  @JsonProperty(JSON_PROPERTY_NAME)
432
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
433
  public void setName(String name) {
434
    this.name = name;
1✔
435
  }
1✔
436

437

438
  public PaymentMethod type(String type) {
439
    this.type = type;
×
440
    return this;
×
441
  }
442

443
   /**
444
   * The unique payment method code.
445
   * @return type
446
  **/
447
  @ApiModelProperty(value = "The unique payment method code.")
448
  @JsonProperty(JSON_PROPERTY_TYPE)
449
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
450

451
  public String getType() {
452
    return type;
1✔
453
  }
454

455

456
 /**
457
  * The unique payment method code.
458
  *
459
  * @param type
460
  */ 
461
  @JsonProperty(JSON_PROPERTY_TYPE)
462
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
463
  public void setType(String type) {
464
    this.type = type;
1✔
465
  }
1✔
466

467

468
  /**
469
   * Return true if this PaymentMethod object is equal to o.
470
   */
471
  @Override
472
  public boolean equals(Object o) {
473
    if (this == o) {
×
474
      return true;
×
475
    }
476
    if (o == null || getClass() != o.getClass()) {
×
477
      return false;
×
478
    }
479
    PaymentMethod paymentMethod = (PaymentMethod) o;
×
NEW
480
    return Objects.equals(this.apps, paymentMethod.apps) &&
×
NEW
481
        Objects.equals(this.brand, paymentMethod.brand) &&
×
482
        Objects.equals(this.brands, paymentMethod.brands) &&
×
483
        Objects.equals(this.configuration, paymentMethod.configuration) &&
×
484
        Objects.equals(this.fundingSource, paymentMethod.fundingSource) &&
×
485
        Objects.equals(this.group, paymentMethod.group) &&
×
486
        Objects.equals(this.inputDetails, paymentMethod.inputDetails) &&
×
487
        Objects.equals(this.issuers, paymentMethod.issuers) &&
×
488
        Objects.equals(this.name, paymentMethod.name) &&
×
489
        Objects.equals(this.type, paymentMethod.type);
×
490
  }
491

492
  @Override
493
  public int hashCode() {
NEW
494
    return Objects.hash(apps, brand, brands, configuration, fundingSource, group, inputDetails, issuers, name, type);
×
495
  }
496

497
  @Override
498
  public String toString() {
499
    StringBuilder sb = new StringBuilder();
×
500
    sb.append("class PaymentMethod {\n");
×
NEW
501
    sb.append("    apps: ").append(toIndentedString(apps)).append("\n");
×
502
    sb.append("    brand: ").append(toIndentedString(brand)).append("\n");
×
503
    sb.append("    brands: ").append(toIndentedString(brands)).append("\n");
×
504
    sb.append("    configuration: ").append(toIndentedString(configuration)).append("\n");
×
505
    sb.append("    fundingSource: ").append(toIndentedString(fundingSource)).append("\n");
×
506
    sb.append("    group: ").append(toIndentedString(group)).append("\n");
×
507
    sb.append("    inputDetails: ").append(toIndentedString(inputDetails)).append("\n");
×
508
    sb.append("    issuers: ").append(toIndentedString(issuers)).append("\n");
×
509
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
×
510
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
×
511
    sb.append("}");
×
512
    return sb.toString();
×
513
  }
514

515
  /**
516
   * Convert the given object to string with each line indented by 4 spaces
517
   * (except the first line).
518
   */
519
  private String toIndentedString(Object o) {
520
    if (o == null) {
×
521
      return "null";
×
522
    }
523
    return o.toString().replace("\n", "\n    ");
×
524
  }
525

526
/**
527
   * Create an instance of PaymentMethod given an JSON string
528
   *
529
   * @param jsonString JSON string
530
   * @return An instance of PaymentMethod
531
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentMethod
532
   */
533
  public static PaymentMethod fromJson(String jsonString) throws JsonProcessingException {
534
    return JSON.getMapper().readValue(jsonString, PaymentMethod.class);
×
535
  }
536
/**
537
  * Convert an instance of PaymentMethod to an JSON string
538
  *
539
  * @return JSON string
540
  */
541
  public String toJson() throws JsonProcessingException {
542
    return JSON.getMapper().writeValueAsString(this);
×
543
  }
544
}
545

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

© 2026 Coveralls, Inc