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

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

27 Nov 2023 10:42AM UTC coverage: 12.874%. First build
#2876

push

web-flow
Merge 842734962 into e27e7377f

5 of 335 new or added lines in 22 files covered. (1.49%)

12464 of 96819 relevant lines covered (12.87%)

0.13 hits per line

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

9.82
/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.fasterxml.jackson.annotation.JsonInclude;
23
import com.fasterxml.jackson.annotation.JsonProperty;
24
import com.fasterxml.jackson.annotation.JsonCreator;
25
import com.fasterxml.jackson.annotation.JsonTypeName;
26
import com.fasterxml.jackson.annotation.JsonValue;
27
import io.swagger.annotations.ApiModel;
28
import io.swagger.annotations.ApiModelProperty;
29
import java.util.ArrayList;
30
import java.util.HashMap;
31
import java.util.List;
32
import java.util.Map;
33
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
34
import com.fasterxml.jackson.core.JsonProcessingException;
35

36

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

52
public class PaymentMethod {
53
  public static final String JSON_PROPERTY_BRAND = "brand";
54
  private String brand;
55

56
  public static final String JSON_PROPERTY_BRANDS = "brands";
57
  private List<String> brands = null;
1✔
58

59
  public static final String JSON_PROPERTY_CONFIGURATION = "configuration";
60
  private Map<String, String> configuration = null;
1✔
61

62
  /**
63
   * The funding source of the payment method.
64
   */
65
  public enum FundingSourceEnum {
×
NEW
66
    CREDIT("credit"),
×
67
    
68
    DEBIT("debit");
×
69

70
    private String value;
71

72
    FundingSourceEnum(String value) {
×
73
      this.value = value;
×
74
    }
×
75

76
    @JsonValue
77
    public String getValue() {
78
      return value;
×
79
    }
80

81
    @Override
82
    public String toString() {
83
      return String.valueOf(value);
×
84
    }
85

86
    @JsonCreator
87
    public static FundingSourceEnum fromValue(String value) {
88
      for (FundingSourceEnum b : FundingSourceEnum.values()) {
×
89
        if (b.value.equals(value)) {
×
90
          return b;
×
91
        }
92
      }
93
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
94
    }
95
  }
96

97
  public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource";
98
  private FundingSourceEnum fundingSource;
99

100
  public static final String JSON_PROPERTY_GROUP = "group";
101
  private PaymentMethodGroup group;
102

103
  public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails";
104
  private List<InputDetail> inputDetails = null;
1✔
105

106
  public static final String JSON_PROPERTY_ISSUERS = "issuers";
107
  private List<PaymentMethodIssuer> issuers = null;
1✔
108

109
  public static final String JSON_PROPERTY_NAME = "name";
110
  private String name;
111

112
  public static final String JSON_PROPERTY_TYPE = "type";
113
  private String type;
114

115
  public PaymentMethod() { 
1✔
116
  }
1✔
117

118
  public PaymentMethod brand(String brand) {
119
    this.brand = brand;
×
120
    return this;
×
121
  }
122

123
   /**
124
   * Brand for the selected gift card. For example: plastix, hmclub.
125
   * @return brand
126
  **/
127
  @ApiModelProperty(value = "Brand for the selected gift card. For example: plastix, hmclub.")
128
  @JsonProperty(JSON_PROPERTY_BRAND)
129
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
130

131
  public String getBrand() {
132
    return brand;
×
133
  }
134

135

136
  @JsonProperty(JSON_PROPERTY_BRAND)
137
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
138
  public void setBrand(String brand) {
139
    this.brand = brand;
×
140
  }
×
141

142

143
  public PaymentMethod brands(List<String> brands) {
144
    this.brands = brands;
×
145
    return this;
×
146
  }
147

148
  public PaymentMethod addBrandsItem(String brandsItem) {
149
    if (this.brands == null) {
×
150
      this.brands = new ArrayList<>();
×
151
    }
152
    this.brands.add(brandsItem);
×
153
    return this;
×
154
  }
155

156
   /**
157
   * List of possible brands. For example: visa, mc.
158
   * @return brands
159
  **/
160
  @ApiModelProperty(value = "List of possible brands. For example: visa, mc.")
161
  @JsonProperty(JSON_PROPERTY_BRANDS)
162
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
163

164
  public List<String> getBrands() {
165
    return brands;
×
166
  }
167

168

169
  @JsonProperty(JSON_PROPERTY_BRANDS)
170
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
171
  public void setBrands(List<String> brands) {
172
    this.brands = brands;
×
173
  }
×
174

175

176
  public PaymentMethod configuration(Map<String, String> configuration) {
177
    this.configuration = configuration;
×
178
    return this;
×
179
  }
180

181
  public PaymentMethod putConfigurationItem(String key, String configurationItem) {
182
    if (this.configuration == null) {
×
183
      this.configuration = new HashMap<>();
×
184
    }
185
    this.configuration.put(key, configurationItem);
×
186
    return this;
×
187
  }
188

189
   /**
190
   * The configuration of the payment method.
191
   * @return configuration
192
  **/
193
  @ApiModelProperty(value = "The configuration of the payment method.")
194
  @JsonProperty(JSON_PROPERTY_CONFIGURATION)
195
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
196

197
  public Map<String, String> getConfiguration() {
198
    return configuration;
×
199
  }
200

201

202
  @JsonProperty(JSON_PROPERTY_CONFIGURATION)
203
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
204
  public void setConfiguration(Map<String, String> configuration) {
205
    this.configuration = configuration;
×
206
  }
×
207

208

209
  public PaymentMethod fundingSource(FundingSourceEnum fundingSource) {
210
    this.fundingSource = fundingSource;
×
211
    return this;
×
212
  }
213

214
   /**
215
   * The funding source of the payment method.
216
   * @return fundingSource
217
  **/
218
  @ApiModelProperty(value = "The funding source of the payment method.")
219
  @JsonProperty(JSON_PROPERTY_FUNDING_SOURCE)
220
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
221

222
  public FundingSourceEnum getFundingSource() {
223
    return fundingSource;
×
224
  }
225

226

227
  @JsonProperty(JSON_PROPERTY_FUNDING_SOURCE)
228
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
229
  public void setFundingSource(FundingSourceEnum fundingSource) {
230
    this.fundingSource = fundingSource;
×
231
  }
×
232

233

234
  public PaymentMethod group(PaymentMethodGroup group) {
235
    this.group = group;
×
236
    return this;
×
237
  }
238

239
   /**
240
   * Get group
241
   * @return group
242
  **/
243
  @ApiModelProperty(value = "")
244
  @JsonProperty(JSON_PROPERTY_GROUP)
245
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
246

247
  public PaymentMethodGroup getGroup() {
248
    return group;
×
249
  }
250

251

252
  @JsonProperty(JSON_PROPERTY_GROUP)
253
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
254
  public void setGroup(PaymentMethodGroup group) {
255
    this.group = group;
×
256
  }
×
257

258

259
  public PaymentMethod inputDetails(List<InputDetail> inputDetails) {
260
    this.inputDetails = inputDetails;
×
261
    return this;
×
262
  }
263

264
  public PaymentMethod addInputDetailsItem(InputDetail inputDetailsItem) {
265
    if (this.inputDetails == null) {
×
266
      this.inputDetails = new ArrayList<>();
×
267
    }
268
    this.inputDetails.add(inputDetailsItem);
×
269
    return this;
×
270
  }
271

272
   /**
273
   * All input details to be provided to complete the payment with this payment method.
274
   * @return inputDetails
275
   * @deprecated
276
  **/
277
  @Deprecated
278
  @ApiModelProperty(value = "All input details to be provided to complete the payment with this payment method.")
279
  @JsonProperty(JSON_PROPERTY_INPUT_DETAILS)
280
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
281

282
  public List<InputDetail> getInputDetails() {
283
    return inputDetails;
×
284
  }
285

286

287
  @Deprecated
288
  @JsonProperty(JSON_PROPERTY_INPUT_DETAILS)
289
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
290
  public void setInputDetails(List<InputDetail> inputDetails) {
291
    this.inputDetails = inputDetails;
×
292
  }
×
293

294

295
  public PaymentMethod issuers(List<PaymentMethodIssuer> issuers) {
296
    this.issuers = issuers;
×
297
    return this;
×
298
  }
299

300
  public PaymentMethod addIssuersItem(PaymentMethodIssuer issuersItem) {
301
    if (this.issuers == null) {
×
302
      this.issuers = new ArrayList<>();
×
303
    }
304
    this.issuers.add(issuersItem);
×
305
    return this;
×
306
  }
307

308
   /**
309
   * A list of issuers for this payment method.
310
   * @return issuers
311
  **/
312
  @ApiModelProperty(value = "A list of issuers for this payment method.")
313
  @JsonProperty(JSON_PROPERTY_ISSUERS)
314
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
315

316
  public List<PaymentMethodIssuer> getIssuers() {
317
    return issuers;
×
318
  }
319

320

321
  @JsonProperty(JSON_PROPERTY_ISSUERS)
322
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
323
  public void setIssuers(List<PaymentMethodIssuer> issuers) {
324
    this.issuers = issuers;
×
325
  }
×
326

327

328
  public PaymentMethod name(String name) {
329
    this.name = name;
×
330
    return this;
×
331
  }
332

333
   /**
334
   * The displayable name of this payment method.
335
   * @return name
336
  **/
337
  @ApiModelProperty(value = "The displayable name of this payment method.")
338
  @JsonProperty(JSON_PROPERTY_NAME)
339
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
340

341
  public String getName() {
342
    return name;
×
343
  }
344

345

346
  @JsonProperty(JSON_PROPERTY_NAME)
347
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
348
  public void setName(String name) {
349
    this.name = name;
1✔
350
  }
1✔
351

352

353
  public PaymentMethod type(String type) {
354
    this.type = type;
×
355
    return this;
×
356
  }
357

358
   /**
359
   * The unique payment method code.
360
   * @return type
361
  **/
362
  @ApiModelProperty(value = "The unique payment method code.")
363
  @JsonProperty(JSON_PROPERTY_TYPE)
364
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
365

366
  public String getType() {
367
    return type;
1✔
368
  }
369

370

371
  @JsonProperty(JSON_PROPERTY_TYPE)
372
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
373
  public void setType(String type) {
374
    this.type = type;
1✔
375
  }
1✔
376

377

378
  /**
379
   * Return true if this PaymentMethod object is equal to o.
380
   */
381
  @Override
382
  public boolean equals(Object o) {
383
    if (this == o) {
×
384
      return true;
×
385
    }
386
    if (o == null || getClass() != o.getClass()) {
×
387
      return false;
×
388
    }
389
    PaymentMethod paymentMethod = (PaymentMethod) o;
×
390
    return Objects.equals(this.brand, paymentMethod.brand) &&
×
391
        Objects.equals(this.brands, paymentMethod.brands) &&
×
392
        Objects.equals(this.configuration, paymentMethod.configuration) &&
×
393
        Objects.equals(this.fundingSource, paymentMethod.fundingSource) &&
×
394
        Objects.equals(this.group, paymentMethod.group) &&
×
395
        Objects.equals(this.inputDetails, paymentMethod.inputDetails) &&
×
396
        Objects.equals(this.issuers, paymentMethod.issuers) &&
×
397
        Objects.equals(this.name, paymentMethod.name) &&
×
398
        Objects.equals(this.type, paymentMethod.type);
×
399
  }
400

401
  @Override
402
  public int hashCode() {
403
    return Objects.hash(brand, brands, configuration, fundingSource, group, inputDetails, issuers, name, type);
×
404
  }
405

406
  @Override
407
  public String toString() {
408
    StringBuilder sb = new StringBuilder();
×
409
    sb.append("class PaymentMethod {\n");
×
410
    sb.append("    brand: ").append(toIndentedString(brand)).append("\n");
×
411
    sb.append("    brands: ").append(toIndentedString(brands)).append("\n");
×
412
    sb.append("    configuration: ").append(toIndentedString(configuration)).append("\n");
×
413
    sb.append("    fundingSource: ").append(toIndentedString(fundingSource)).append("\n");
×
414
    sb.append("    group: ").append(toIndentedString(group)).append("\n");
×
415
    sb.append("    inputDetails: ").append(toIndentedString(inputDetails)).append("\n");
×
416
    sb.append("    issuers: ").append(toIndentedString(issuers)).append("\n");
×
417
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
×
418
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
×
419
    sb.append("}");
×
420
    return sb.toString();
×
421
  }
422

423
  /**
424
   * Convert the given object to string with each line indented by 4 spaces
425
   * (except the first line).
426
   */
427
  private String toIndentedString(Object o) {
428
    if (o == null) {
×
429
      return "null";
×
430
    }
431
    return o.toString().replace("\n", "\n    ");
×
432
  }
433

434
/**
435
   * Create an instance of PaymentMethod given an JSON string
436
   *
437
   * @param jsonString JSON string
438
   * @return An instance of PaymentMethod
439
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentMethod
440
   */
441
  public static PaymentMethod fromJson(String jsonString) throws JsonProcessingException {
442
    return JSON.getMapper().readValue(jsonString, PaymentMethod.class);
×
443
  }
444
/**
445
  * Convert an instance of PaymentMethod to an JSON string
446
  *
447
  * @return JSON string
448
  */
449
  public String toJson() throws JsonProcessingException {
450
    return JSON.getMapper().writeValueAsString(this);
×
451
  }
452
}
453

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