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

stripe / stripe-java / #16517

08 Oct 2024 06:27PM UTC coverage: 12.74% (-0.2%) from 12.899%
#16517

push

github

web-flow
Merge pull request #1872 from stripe/latest-codegen-beta

Update generated code for beta

53 of 2404 new or added lines in 50 files covered. (2.2%)

91 existing lines in 27 files now uncovered.

18753 of 147196 relevant lines covered (12.74%)

0.13 hits per line

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

6.57
/src/main/java/com/stripe/param/PaymentMethodUpdateParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.net.ApiRequestParams;
6
import com.stripe.param.common.EmptyParam;
7
import java.util.ArrayList;
8
import java.util.HashMap;
9
import java.util.List;
10
import java.util.Map;
11
import lombok.Getter;
12

13
@Getter
14
public class PaymentMethodUpdateParams extends ApiRequestParams {
15
  /**
16
   * This field indicates whether this payment method can be shown again to its customer in a
17
   * checkout flow. Stripe products such as Checkout and Elements use this field to determine
18
   * whether a payment method can be shown as a saved payment method in a checkout flow. The field
19
   * defaults to {@code unspecified}.
20
   */
21
  @SerializedName("allow_redisplay")
22
  AllowRedisplay allowRedisplay;
23

24
  /**
25
   * Billing information associated with the PaymentMethod that may be used or required by
26
   * particular types of payment methods.
27
   */
28
  @SerializedName("billing_details")
29
  BillingDetails billingDetails;
30

31
  /** If this is a {@code card} PaymentMethod, this hash contains the user's card details. */
32
  @SerializedName("card")
33
  Card card;
34

35
  /** Specifies which fields in the response should be expanded. */
36
  @SerializedName("expand")
37
  List<String> expand;
38

39
  /**
40
   * Map of extra parameters for custom features not available in this client library. The content
41
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
42
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
43
   * param object. Effectively, this map is flattened to its parent instance.
44
   */
45
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
46
  Map<String, Object> extraParams;
47

48
  /**
49
   * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment
50
   * method.
51
   */
52
  @SerializedName("link")
53
  Link link;
54

55
  /**
56
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
57
   * to an object. This can be useful for storing additional information about the object in a
58
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
59
   * be unset by posting an empty value to {@code metadata}.
60
   */
61
  @SerializedName("metadata")
62
  Object metadata;
63

64
  /**
65
   * If this is a {@code naver_pay} PaymentMethod, this hash contains details about the Naver Pay
66
   * payment method.
67
   */
68
  @SerializedName("naver_pay")
69
  NaverPay naverPay;
70

71
  /**
72
   * If this is a {@code payto} PaymentMethod, this hash contains details about the PayTo payment
73
   * method.
74
   */
75
  @SerializedName("payto")
76
  Payto payto;
77

78
  /**
79
   * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US
80
   * bank account payment method.
81
   */
82
  @SerializedName("us_bank_account")
83
  UsBankAccount usBankAccount;
84

85
  private PaymentMethodUpdateParams(
86
      AllowRedisplay allowRedisplay,
87
      BillingDetails billingDetails,
88
      Card card,
89
      List<String> expand,
90
      Map<String, Object> extraParams,
91
      Link link,
92
      Object metadata,
93
      NaverPay naverPay,
94
      Payto payto,
95
      UsBankAccount usBankAccount) {
1✔
96
    this.allowRedisplay = allowRedisplay;
1✔
97
    this.billingDetails = billingDetails;
1✔
98
    this.card = card;
1✔
99
    this.expand = expand;
1✔
100
    this.extraParams = extraParams;
1✔
101
    this.link = link;
1✔
102
    this.metadata = metadata;
1✔
103
    this.naverPay = naverPay;
1✔
104
    this.payto = payto;
1✔
105
    this.usBankAccount = usBankAccount;
1✔
106
  }
1✔
107

108
  public static Builder builder() {
109
    return new Builder();
1✔
110
  }
111

112
  public static class Builder {
1✔
113
    private AllowRedisplay allowRedisplay;
114

115
    private BillingDetails billingDetails;
116

117
    private Card card;
118

119
    private List<String> expand;
120

121
    private Map<String, Object> extraParams;
122

123
    private Link link;
124

125
    private Object metadata;
126

127
    private NaverPay naverPay;
128

129
    private Payto payto;
130

131
    private UsBankAccount usBankAccount;
132

133
    /** Finalize and obtain parameter instance from this builder. */
134
    public PaymentMethodUpdateParams build() {
135
      return new PaymentMethodUpdateParams(
1✔
136
          this.allowRedisplay,
137
          this.billingDetails,
138
          this.card,
139
          this.expand,
140
          this.extraParams,
141
          this.link,
142
          this.metadata,
143
          this.naverPay,
144
          this.payto,
145
          this.usBankAccount);
146
    }
147

148
    /**
149
     * This field indicates whether this payment method can be shown again to its customer in a
150
     * checkout flow. Stripe products such as Checkout and Elements use this field to determine
151
     * whether a payment method can be shown as a saved payment method in a checkout flow. The field
152
     * defaults to {@code unspecified}.
153
     */
154
    public Builder setAllowRedisplay(PaymentMethodUpdateParams.AllowRedisplay allowRedisplay) {
155
      this.allowRedisplay = allowRedisplay;
×
156
      return this;
×
157
    }
158

159
    /**
160
     * Billing information associated with the PaymentMethod that may be used or required by
161
     * particular types of payment methods.
162
     */
163
    public Builder setBillingDetails(PaymentMethodUpdateParams.BillingDetails billingDetails) {
164
      this.billingDetails = billingDetails;
×
165
      return this;
×
166
    }
167

168
    /** If this is a {@code card} PaymentMethod, this hash contains the user's card details. */
169
    public Builder setCard(PaymentMethodUpdateParams.Card card) {
170
      this.card = card;
×
171
      return this;
×
172
    }
173

174
    /**
175
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
176
     * subsequent calls adds additional elements to the original list. See {@link
177
     * PaymentMethodUpdateParams#expand} for the field documentation.
178
     */
179
    public Builder addExpand(String element) {
180
      if (this.expand == null) {
×
181
        this.expand = new ArrayList<>();
×
182
      }
183
      this.expand.add(element);
×
184
      return this;
×
185
    }
186

187
    /**
188
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
189
     * subsequent calls adds additional elements to the original list. See {@link
190
     * PaymentMethodUpdateParams#expand} for the field documentation.
191
     */
192
    public Builder addAllExpand(List<String> elements) {
193
      if (this.expand == null) {
×
194
        this.expand = new ArrayList<>();
×
195
      }
196
      this.expand.addAll(elements);
×
197
      return this;
×
198
    }
199

200
    /**
201
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
202
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
203
     * PaymentMethodUpdateParams#extraParams} for the field documentation.
204
     */
205
    public Builder putExtraParam(String key, Object value) {
206
      if (this.extraParams == null) {
×
207
        this.extraParams = new HashMap<>();
×
208
      }
209
      this.extraParams.put(key, value);
×
210
      return this;
×
211
    }
212

213
    /**
214
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
215
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
216
     * See {@link PaymentMethodUpdateParams#extraParams} for the field documentation.
217
     */
218
    public Builder putAllExtraParam(Map<String, Object> map) {
219
      if (this.extraParams == null) {
×
220
        this.extraParams = new HashMap<>();
×
221
      }
222
      this.extraParams.putAll(map);
×
223
      return this;
×
224
    }
225

226
    /**
227
     * If this is an {@code Link} PaymentMethod, this hash contains details about the Link payment
228
     * method.
229
     */
230
    public Builder setLink(PaymentMethodUpdateParams.Link link) {
231
      this.link = link;
×
232
      return this;
×
233
    }
234

235
    /**
236
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
237
     * and subsequent calls add additional key/value pairs to the original map. See {@link
238
     * PaymentMethodUpdateParams#metadata} for the field documentation.
239
     */
240
    @SuppressWarnings("unchecked")
241
    public Builder putMetadata(String key, String value) {
242
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
1✔
243
        this.metadata = new HashMap<String, String>();
1✔
244
      }
245
      ((Map<String, String>) this.metadata).put(key, value);
1✔
246
      return this;
1✔
247
    }
248

249
    /**
250
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
251
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
252
     * See {@link PaymentMethodUpdateParams#metadata} for the field documentation.
253
     */
254
    @SuppressWarnings("unchecked")
255
    public Builder putAllMetadata(Map<String, String> map) {
256
      if (this.metadata == null || this.metadata instanceof EmptyParam) {
×
257
        this.metadata = new HashMap<String, String>();
×
258
      }
259
      ((Map<String, String>) this.metadata).putAll(map);
×
260
      return this;
×
261
    }
262

263
    /**
264
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
265
     * to an object. This can be useful for storing additional information about the object in a
266
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
267
     * can be unset by posting an empty value to {@code metadata}.
268
     */
269
    public Builder setMetadata(EmptyParam metadata) {
270
      this.metadata = metadata;
×
271
      return this;
×
272
    }
273

274
    /**
275
     * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
276
     * to an object. This can be useful for storing additional information about the object in a
277
     * structured format. Individual keys can be unset by posting an empty value to them. All keys
278
     * can be unset by posting an empty value to {@code metadata}.
279
     */
280
    public Builder setMetadata(Map<String, String> metadata) {
281
      this.metadata = metadata;
×
282
      return this;
×
283
    }
284

285
    /**
286
     * If this is a {@code naver_pay} PaymentMethod, this hash contains details about the Naver Pay
287
     * payment method.
288
     */
289
    public Builder setNaverPay(PaymentMethodUpdateParams.NaverPay naverPay) {
NEW
290
      this.naverPay = naverPay;
×
NEW
291
      return this;
×
292
    }
293

294
    /**
295
     * If this is a {@code payto} PaymentMethod, this hash contains details about the PayTo payment
296
     * method.
297
     */
298
    public Builder setPayto(PaymentMethodUpdateParams.Payto payto) {
299
      this.payto = payto;
×
300
      return this;
×
301
    }
302

303
    /**
304
     * If this is an {@code us_bank_account} PaymentMethod, this hash contains details about the US
305
     * bank account payment method.
306
     */
307
    public Builder setUsBankAccount(PaymentMethodUpdateParams.UsBankAccount usBankAccount) {
308
      this.usBankAccount = usBankAccount;
×
309
      return this;
×
310
    }
311
  }
312

313
  @Getter
314
  public static class BillingDetails {
315
    /** Billing address. */
316
    @SerializedName("address")
317
    Object address;
318

319
    /** Email address. */
320
    @SerializedName("email")
321
    Object email;
322

323
    /**
324
     * Map of extra parameters for custom features not available in this client library. The content
325
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
326
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
327
     * param object. Effectively, this map is flattened to its parent instance.
328
     */
329
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
330
    Map<String, Object> extraParams;
331

332
    /** Full name. */
333
    @SerializedName("name")
334
    Object name;
335

336
    /** Billing phone number (including extension). */
337
    @SerializedName("phone")
338
    Object phone;
339

340
    private BillingDetails(
341
        Object address, Object email, Map<String, Object> extraParams, Object name, Object phone) {
×
342
      this.address = address;
×
343
      this.email = email;
×
344
      this.extraParams = extraParams;
×
345
      this.name = name;
×
346
      this.phone = phone;
×
347
    }
×
348

349
    public static Builder builder() {
350
      return new Builder();
×
351
    }
352

353
    public static class Builder {
×
354
      private Object address;
355

356
      private Object email;
357

358
      private Map<String, Object> extraParams;
359

360
      private Object name;
361

362
      private Object phone;
363

364
      /** Finalize and obtain parameter instance from this builder. */
365
      public PaymentMethodUpdateParams.BillingDetails build() {
366
        return new PaymentMethodUpdateParams.BillingDetails(
×
367
            this.address, this.email, this.extraParams, this.name, this.phone);
368
      }
369

370
      /** Billing address. */
371
      public Builder setAddress(PaymentMethodUpdateParams.BillingDetails.Address address) {
372
        this.address = address;
×
373
        return this;
×
374
      }
375

376
      /** Billing address. */
377
      public Builder setAddress(EmptyParam address) {
378
        this.address = address;
×
379
        return this;
×
380
      }
381

382
      /** Email address. */
383
      public Builder setEmail(String email) {
384
        this.email = email;
×
385
        return this;
×
386
      }
387

388
      /** Email address. */
389
      public Builder setEmail(EmptyParam email) {
390
        this.email = email;
×
391
        return this;
×
392
      }
393

394
      /**
395
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
396
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
397
       * PaymentMethodUpdateParams.BillingDetails#extraParams} for the field documentation.
398
       */
399
      public Builder putExtraParam(String key, Object value) {
400
        if (this.extraParams == null) {
×
401
          this.extraParams = new HashMap<>();
×
402
        }
403
        this.extraParams.put(key, value);
×
404
        return this;
×
405
      }
406

407
      /**
408
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
409
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
410
       * See {@link PaymentMethodUpdateParams.BillingDetails#extraParams} for the field
411
       * documentation.
412
       */
413
      public Builder putAllExtraParam(Map<String, Object> map) {
414
        if (this.extraParams == null) {
×
415
          this.extraParams = new HashMap<>();
×
416
        }
417
        this.extraParams.putAll(map);
×
418
        return this;
×
419
      }
420

421
      /** Full name. */
422
      public Builder setName(String name) {
423
        this.name = name;
×
424
        return this;
×
425
      }
426

427
      /** Full name. */
428
      public Builder setName(EmptyParam name) {
429
        this.name = name;
×
430
        return this;
×
431
      }
432

433
      /** Billing phone number (including extension). */
434
      public Builder setPhone(String phone) {
435
        this.phone = phone;
×
436
        return this;
×
437
      }
438

439
      /** Billing phone number (including extension). */
440
      public Builder setPhone(EmptyParam phone) {
441
        this.phone = phone;
×
442
        return this;
×
443
      }
444
    }
445

446
    @Getter
447
    public static class Address {
448
      /** City, district, suburb, town, or village. */
449
      @SerializedName("city")
450
      Object city;
451

452
      /**
453
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
454
       * 3166-1 alpha-2</a>).
455
       */
456
      @SerializedName("country")
457
      Object country;
458

459
      /**
460
       * Map of extra parameters for custom features not available in this client library. The
461
       * content in this map is not serialized under this field's {@code @SerializedName} value.
462
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
463
       * name in this param object. Effectively, this map is flattened to its parent instance.
464
       */
465
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
466
      Map<String, Object> extraParams;
467

468
      /** Address line 1 (e.g., street, PO Box, or company name). */
469
      @SerializedName("line1")
470
      Object line1;
471

472
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
473
      @SerializedName("line2")
474
      Object line2;
475

476
      /** ZIP or postal code. */
477
      @SerializedName("postal_code")
478
      Object postalCode;
479

480
      /** State, county, province, or region. */
481
      @SerializedName("state")
482
      Object state;
483

484
      private Address(
485
          Object city,
486
          Object country,
487
          Map<String, Object> extraParams,
488
          Object line1,
489
          Object line2,
490
          Object postalCode,
491
          Object state) {
×
492
        this.city = city;
×
493
        this.country = country;
×
494
        this.extraParams = extraParams;
×
495
        this.line1 = line1;
×
496
        this.line2 = line2;
×
497
        this.postalCode = postalCode;
×
498
        this.state = state;
×
499
      }
×
500

501
      public static Builder builder() {
502
        return new Builder();
×
503
      }
504

505
      public static class Builder {
×
506
        private Object city;
507

508
        private Object country;
509

510
        private Map<String, Object> extraParams;
511

512
        private Object line1;
513

514
        private Object line2;
515

516
        private Object postalCode;
517

518
        private Object state;
519

520
        /** Finalize and obtain parameter instance from this builder. */
521
        public PaymentMethodUpdateParams.BillingDetails.Address build() {
522
          return new PaymentMethodUpdateParams.BillingDetails.Address(
×
523
              this.city,
524
              this.country,
525
              this.extraParams,
526
              this.line1,
527
              this.line2,
528
              this.postalCode,
529
              this.state);
530
        }
531

532
        /** City, district, suburb, town, or village. */
533
        public Builder setCity(String city) {
534
          this.city = city;
×
535
          return this;
×
536
        }
537

538
        /** City, district, suburb, town, or village. */
539
        public Builder setCity(EmptyParam city) {
540
          this.city = city;
×
541
          return this;
×
542
        }
543

544
        /**
545
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
546
         * 3166-1 alpha-2</a>).
547
         */
548
        public Builder setCountry(String country) {
549
          this.country = country;
×
550
          return this;
×
551
        }
552

553
        /**
554
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
555
         * 3166-1 alpha-2</a>).
556
         */
557
        public Builder setCountry(EmptyParam country) {
558
          this.country = country;
×
559
          return this;
×
560
        }
561

562
        /**
563
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
564
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
565
         * map. See {@link PaymentMethodUpdateParams.BillingDetails.Address#extraParams} for the
566
         * field documentation.
567
         */
568
        public Builder putExtraParam(String key, Object value) {
569
          if (this.extraParams == null) {
×
570
            this.extraParams = new HashMap<>();
×
571
          }
572
          this.extraParams.put(key, value);
×
573
          return this;
×
574
        }
575

576
        /**
577
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
578
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
579
         * map. See {@link PaymentMethodUpdateParams.BillingDetails.Address#extraParams} for the
580
         * field documentation.
581
         */
582
        public Builder putAllExtraParam(Map<String, Object> map) {
583
          if (this.extraParams == null) {
×
584
            this.extraParams = new HashMap<>();
×
585
          }
586
          this.extraParams.putAll(map);
×
587
          return this;
×
588
        }
589

590
        /** Address line 1 (e.g., street, PO Box, or company name). */
591
        public Builder setLine1(String line1) {
592
          this.line1 = line1;
×
593
          return this;
×
594
        }
595

596
        /** Address line 1 (e.g., street, PO Box, or company name). */
597
        public Builder setLine1(EmptyParam line1) {
598
          this.line1 = line1;
×
599
          return this;
×
600
        }
601

602
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
603
        public Builder setLine2(String line2) {
604
          this.line2 = line2;
×
605
          return this;
×
606
        }
607

608
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
609
        public Builder setLine2(EmptyParam line2) {
610
          this.line2 = line2;
×
611
          return this;
×
612
        }
613

614
        /** ZIP or postal code. */
615
        public Builder setPostalCode(String postalCode) {
616
          this.postalCode = postalCode;
×
617
          return this;
×
618
        }
619

620
        /** ZIP or postal code. */
621
        public Builder setPostalCode(EmptyParam postalCode) {
622
          this.postalCode = postalCode;
×
623
          return this;
×
624
        }
625

626
        /** State, county, province, or region. */
627
        public Builder setState(String state) {
628
          this.state = state;
×
629
          return this;
×
630
        }
631

632
        /** State, county, province, or region. */
633
        public Builder setState(EmptyParam state) {
634
          this.state = state;
×
635
          return this;
×
636
        }
637
      }
638
    }
639
  }
640

641
  @Getter
642
  public static class Card {
643
    /** Two-digit number representing the card's expiration month. */
644
    @SerializedName("exp_month")
645
    Long expMonth;
646

647
    /** Four-digit number representing the card's expiration year. */
648
    @SerializedName("exp_year")
649
    Long expYear;
650

651
    /**
652
     * Map of extra parameters for custom features not available in this client library. The content
653
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
654
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
655
     * param object. Effectively, this map is flattened to its parent instance.
656
     */
657
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
658
    Map<String, Object> extraParams;
659

660
    /** Contains information about card networks used to process the payment. */
661
    @SerializedName("networks")
662
    Networks networks;
663

664
    private Card(Long expMonth, Long expYear, Map<String, Object> extraParams, Networks networks) {
×
665
      this.expMonth = expMonth;
×
666
      this.expYear = expYear;
×
667
      this.extraParams = extraParams;
×
668
      this.networks = networks;
×
669
    }
×
670

671
    public static Builder builder() {
672
      return new Builder();
×
673
    }
674

675
    public static class Builder {
×
676
      private Long expMonth;
677

678
      private Long expYear;
679

680
      private Map<String, Object> extraParams;
681

682
      private Networks networks;
683

684
      /** Finalize and obtain parameter instance from this builder. */
685
      public PaymentMethodUpdateParams.Card build() {
686
        return new PaymentMethodUpdateParams.Card(
×
687
            this.expMonth, this.expYear, this.extraParams, this.networks);
688
      }
689

690
      /** Two-digit number representing the card's expiration month. */
691
      public Builder setExpMonth(Long expMonth) {
692
        this.expMonth = expMonth;
×
693
        return this;
×
694
      }
695

696
      /** Four-digit number representing the card's expiration year. */
697
      public Builder setExpYear(Long expYear) {
698
        this.expYear = expYear;
×
699
        return this;
×
700
      }
701

702
      /**
703
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
704
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
705
       * PaymentMethodUpdateParams.Card#extraParams} for the field documentation.
706
       */
707
      public Builder putExtraParam(String key, Object value) {
708
        if (this.extraParams == null) {
×
709
          this.extraParams = new HashMap<>();
×
710
        }
711
        this.extraParams.put(key, value);
×
712
        return this;
×
713
      }
714

715
      /**
716
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
717
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
718
       * See {@link PaymentMethodUpdateParams.Card#extraParams} for the field documentation.
719
       */
720
      public Builder putAllExtraParam(Map<String, Object> map) {
721
        if (this.extraParams == null) {
×
722
          this.extraParams = new HashMap<>();
×
723
        }
724
        this.extraParams.putAll(map);
×
725
        return this;
×
726
      }
727

728
      /** Contains information about card networks used to process the payment. */
729
      public Builder setNetworks(PaymentMethodUpdateParams.Card.Networks networks) {
730
        this.networks = networks;
×
731
        return this;
×
732
      }
733
    }
734

735
    @Getter
736
    public static class Networks {
737
      /**
738
       * Map of extra parameters for custom features not available in this client library. The
739
       * content in this map is not serialized under this field's {@code @SerializedName} value.
740
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
741
       * name in this param object. Effectively, this map is flattened to its parent instance.
742
       */
743
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
744
      Map<String, Object> extraParams;
745

746
      /**
747
       * The customer's preferred card network for co-branded cards. Supports {@code
748
       * cartes_bancaires}, {@code mastercard}, or {@code visa}. Selection of a network that does
749
       * not apply to the card will be stored as {@code invalid_preference} on the card.
750
       */
751
      @SerializedName("preferred")
752
      ApiRequestParams.EnumParam preferred;
753

754
      private Networks(Map<String, Object> extraParams, ApiRequestParams.EnumParam preferred) {
×
755
        this.extraParams = extraParams;
×
756
        this.preferred = preferred;
×
757
      }
×
758

759
      public static Builder builder() {
760
        return new Builder();
×
761
      }
762

763
      public static class Builder {
×
764
        private Map<String, Object> extraParams;
765

766
        private ApiRequestParams.EnumParam preferred;
767

768
        /** Finalize and obtain parameter instance from this builder. */
769
        public PaymentMethodUpdateParams.Card.Networks build() {
770
          return new PaymentMethodUpdateParams.Card.Networks(this.extraParams, this.preferred);
×
771
        }
772

773
        /**
774
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
775
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
776
         * map. See {@link PaymentMethodUpdateParams.Card.Networks#extraParams} for the field
777
         * documentation.
778
         */
779
        public Builder putExtraParam(String key, Object value) {
780
          if (this.extraParams == null) {
×
781
            this.extraParams = new HashMap<>();
×
782
          }
783
          this.extraParams.put(key, value);
×
784
          return this;
×
785
        }
786

787
        /**
788
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
789
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
790
         * map. See {@link PaymentMethodUpdateParams.Card.Networks#extraParams} for the field
791
         * documentation.
792
         */
793
        public Builder putAllExtraParam(Map<String, Object> map) {
794
          if (this.extraParams == null) {
×
795
            this.extraParams = new HashMap<>();
×
796
          }
797
          this.extraParams.putAll(map);
×
798
          return this;
×
799
        }
800

801
        /**
802
         * The customer's preferred card network for co-branded cards. Supports {@code
803
         * cartes_bancaires}, {@code mastercard}, or {@code visa}. Selection of a network that does
804
         * not apply to the card will be stored as {@code invalid_preference} on the card.
805
         */
806
        public Builder setPreferred(PaymentMethodUpdateParams.Card.Networks.Preferred preferred) {
807
          this.preferred = preferred;
×
808
          return this;
×
809
        }
810

811
        /**
812
         * The customer's preferred card network for co-branded cards. Supports {@code
813
         * cartes_bancaires}, {@code mastercard}, or {@code visa}. Selection of a network that does
814
         * not apply to the card will be stored as {@code invalid_preference} on the card.
815
         */
816
        public Builder setPreferred(EmptyParam preferred) {
817
          this.preferred = preferred;
×
818
          return this;
×
819
        }
820
      }
821

822
      public enum Preferred implements ApiRequestParams.EnumParam {
×
823
        @SerializedName("cartes_bancaires")
×
824
        CARTES_BANCAIRES("cartes_bancaires"),
825

826
        @SerializedName("mastercard")
×
827
        MASTERCARD("mastercard"),
828

829
        @SerializedName("visa")
×
830
        VISA("visa");
831

832
        @Getter(onMethod_ = {@Override})
833
        private final String value;
834

835
        Preferred(String value) {
×
836
          this.value = value;
×
837
        }
×
838
      }
839
    }
840
  }
841

842
  @Getter
843
  public static class Link {
844
    /**
845
     * Map of extra parameters for custom features not available in this client library. The content
846
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
847
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
848
     * param object. Effectively, this map is flattened to its parent instance.
849
     */
850
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
851
    Map<String, Object> extraParams;
852

853
    private Link(Map<String, Object> extraParams) {
×
854
      this.extraParams = extraParams;
×
855
    }
×
856

857
    public static Builder builder() {
858
      return new Builder();
×
859
    }
860

861
    public static class Builder {
×
862
      private Map<String, Object> extraParams;
863

864
      /** Finalize and obtain parameter instance from this builder. */
865
      public PaymentMethodUpdateParams.Link build() {
866
        return new PaymentMethodUpdateParams.Link(this.extraParams);
×
867
      }
868

869
      /**
870
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
871
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
872
       * PaymentMethodUpdateParams.Link#extraParams} for the field documentation.
873
       */
874
      public Builder putExtraParam(String key, Object value) {
875
        if (this.extraParams == null) {
×
876
          this.extraParams = new HashMap<>();
×
877
        }
878
        this.extraParams.put(key, value);
×
879
        return this;
×
880
      }
881

882
      /**
883
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
884
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
885
       * See {@link PaymentMethodUpdateParams.Link#extraParams} for the field documentation.
886
       */
887
      public Builder putAllExtraParam(Map<String, Object> map) {
888
        if (this.extraParams == null) {
×
889
          this.extraParams = new HashMap<>();
×
890
        }
891
        this.extraParams.putAll(map);
×
892
        return this;
×
893
      }
894
    }
895
  }
896

897
  @Getter
898
  public static class NaverPay {
899
    /**
900
     * Map of extra parameters for custom features not available in this client library. The content
901
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
902
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
903
     * param object. Effectively, this map is flattened to its parent instance.
904
     */
905
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
906
    Map<String, Object> extraParams;
907

908
    /**
909
     * Whether to use Naver Pay points or a card to fund this transaction. If not provided, this
910
     * defaults to {@code card}.
911
     */
912
    @SerializedName("funding")
913
    Funding funding;
914

NEW
915
    private NaverPay(Map<String, Object> extraParams, Funding funding) {
×
NEW
916
      this.extraParams = extraParams;
×
NEW
917
      this.funding = funding;
×
NEW
918
    }
×
919

920
    public static Builder builder() {
NEW
921
      return new Builder();
×
922
    }
923

NEW
924
    public static class Builder {
×
925
      private Map<String, Object> extraParams;
926

927
      private Funding funding;
928

929
      /** Finalize and obtain parameter instance from this builder. */
930
      public PaymentMethodUpdateParams.NaverPay build() {
NEW
931
        return new PaymentMethodUpdateParams.NaverPay(this.extraParams, this.funding);
×
932
      }
933

934
      /**
935
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
936
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
937
       * PaymentMethodUpdateParams.NaverPay#extraParams} for the field documentation.
938
       */
939
      public Builder putExtraParam(String key, Object value) {
NEW
940
        if (this.extraParams == null) {
×
NEW
941
          this.extraParams = new HashMap<>();
×
942
        }
NEW
943
        this.extraParams.put(key, value);
×
NEW
944
        return this;
×
945
      }
946

947
      /**
948
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
949
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
950
       * See {@link PaymentMethodUpdateParams.NaverPay#extraParams} for the field documentation.
951
       */
952
      public Builder putAllExtraParam(Map<String, Object> map) {
NEW
953
        if (this.extraParams == null) {
×
NEW
954
          this.extraParams = new HashMap<>();
×
955
        }
NEW
956
        this.extraParams.putAll(map);
×
NEW
957
        return this;
×
958
      }
959

960
      /**
961
       * Whether to use Naver Pay points or a card to fund this transaction. If not provided, this
962
       * defaults to {@code card}.
963
       */
964
      public Builder setFunding(PaymentMethodUpdateParams.NaverPay.Funding funding) {
NEW
965
        this.funding = funding;
×
NEW
966
        return this;
×
967
      }
968
    }
969

NEW
970
    public enum Funding implements ApiRequestParams.EnumParam {
×
NEW
971
      @SerializedName("card")
×
972
      CARD("card"),
973

NEW
974
      @SerializedName("points")
×
975
      POINTS("points");
976

977
      @Getter(onMethod_ = {@Override})
978
      private final String value;
979

NEW
980
      Funding(String value) {
×
NEW
981
        this.value = value;
×
NEW
982
      }
×
983
    }
984
  }
985

986
  @Getter
987
  public static class Payto {
988
    /** The account number for the bank account. */
989
    @SerializedName("account_number")
990
    Object accountNumber;
991

992
    /** Bank-State-Branch number of the bank account. */
993
    @SerializedName("bsb_number")
994
    Object bsbNumber;
995

996
    /**
997
     * Map of extra parameters for custom features not available in this client library. The content
998
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
999
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1000
     * param object. Effectively, this map is flattened to its parent instance.
1001
     */
1002
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1003
    Map<String, Object> extraParams;
1004

1005
    /** The PayID alias for the bank account. */
1006
    @SerializedName("pay_id")
1007
    Object payId;
1008

1009
    private Payto(
1010
        Object accountNumber, Object bsbNumber, Map<String, Object> extraParams, Object payId) {
×
1011
      this.accountNumber = accountNumber;
×
1012
      this.bsbNumber = bsbNumber;
×
1013
      this.extraParams = extraParams;
×
1014
      this.payId = payId;
×
1015
    }
×
1016

1017
    public static Builder builder() {
1018
      return new Builder();
×
1019
    }
1020

1021
    public static class Builder {
×
1022
      private Object accountNumber;
1023

1024
      private Object bsbNumber;
1025

1026
      private Map<String, Object> extraParams;
1027

1028
      private Object payId;
1029

1030
      /** Finalize and obtain parameter instance from this builder. */
1031
      public PaymentMethodUpdateParams.Payto build() {
1032
        return new PaymentMethodUpdateParams.Payto(
×
1033
            this.accountNumber, this.bsbNumber, this.extraParams, this.payId);
1034
      }
1035

1036
      /** The account number for the bank account. */
1037
      public Builder setAccountNumber(String accountNumber) {
1038
        this.accountNumber = accountNumber;
×
1039
        return this;
×
1040
      }
1041

1042
      /** The account number for the bank account. */
1043
      public Builder setAccountNumber(EmptyParam accountNumber) {
1044
        this.accountNumber = accountNumber;
×
1045
        return this;
×
1046
      }
1047

1048
      /** Bank-State-Branch number of the bank account. */
1049
      public Builder setBsbNumber(String bsbNumber) {
1050
        this.bsbNumber = bsbNumber;
×
1051
        return this;
×
1052
      }
1053

1054
      /** Bank-State-Branch number of the bank account. */
1055
      public Builder setBsbNumber(EmptyParam bsbNumber) {
1056
        this.bsbNumber = bsbNumber;
×
1057
        return this;
×
1058
      }
1059

1060
      /**
1061
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1062
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1063
       * PaymentMethodUpdateParams.Payto#extraParams} for the field documentation.
1064
       */
1065
      public Builder putExtraParam(String key, Object value) {
1066
        if (this.extraParams == null) {
×
1067
          this.extraParams = new HashMap<>();
×
1068
        }
1069
        this.extraParams.put(key, value);
×
1070
        return this;
×
1071
      }
1072

1073
      /**
1074
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1075
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1076
       * See {@link PaymentMethodUpdateParams.Payto#extraParams} for the field documentation.
1077
       */
1078
      public Builder putAllExtraParam(Map<String, Object> map) {
1079
        if (this.extraParams == null) {
×
1080
          this.extraParams = new HashMap<>();
×
1081
        }
1082
        this.extraParams.putAll(map);
×
1083
        return this;
×
1084
      }
1085

1086
      /** The PayID alias for the bank account. */
1087
      public Builder setPayId(String payId) {
1088
        this.payId = payId;
×
1089
        return this;
×
1090
      }
1091

1092
      /** The PayID alias for the bank account. */
1093
      public Builder setPayId(EmptyParam payId) {
1094
        this.payId = payId;
×
1095
        return this;
×
1096
      }
1097
    }
1098
  }
1099

1100
  @Getter
1101
  public static class UsBankAccount {
1102
    /** Bank account holder type. */
1103
    @SerializedName("account_holder_type")
1104
    AccountHolderType accountHolderType;
1105

1106
    /** Bank account type. */
1107
    @SerializedName("account_type")
1108
    AccountType accountType;
1109

1110
    /**
1111
     * Map of extra parameters for custom features not available in this client library. The content
1112
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
1113
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
1114
     * param object. Effectively, this map is flattened to its parent instance.
1115
     */
1116
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
1117
    Map<String, Object> extraParams;
1118

1119
    private UsBankAccount(
1120
        AccountHolderType accountHolderType,
1121
        AccountType accountType,
1122
        Map<String, Object> extraParams) {
×
1123
      this.accountHolderType = accountHolderType;
×
1124
      this.accountType = accountType;
×
1125
      this.extraParams = extraParams;
×
1126
    }
×
1127

1128
    public static Builder builder() {
1129
      return new Builder();
×
1130
    }
1131

1132
    public static class Builder {
×
1133
      private AccountHolderType accountHolderType;
1134

1135
      private AccountType accountType;
1136

1137
      private Map<String, Object> extraParams;
1138

1139
      /** Finalize and obtain parameter instance from this builder. */
1140
      public PaymentMethodUpdateParams.UsBankAccount build() {
1141
        return new PaymentMethodUpdateParams.UsBankAccount(
×
1142
            this.accountHolderType, this.accountType, this.extraParams);
1143
      }
1144

1145
      /** Bank account holder type. */
1146
      public Builder setAccountHolderType(
1147
          PaymentMethodUpdateParams.UsBankAccount.AccountHolderType accountHolderType) {
1148
        this.accountHolderType = accountHolderType;
×
1149
        return this;
×
1150
      }
1151

1152
      /** Bank account type. */
1153
      public Builder setAccountType(
1154
          PaymentMethodUpdateParams.UsBankAccount.AccountType accountType) {
1155
        this.accountType = accountType;
×
1156
        return this;
×
1157
      }
1158

1159
      /**
1160
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
1161
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
1162
       * PaymentMethodUpdateParams.UsBankAccount#extraParams} for the field documentation.
1163
       */
1164
      public Builder putExtraParam(String key, Object value) {
1165
        if (this.extraParams == null) {
×
1166
          this.extraParams = new HashMap<>();
×
1167
        }
1168
        this.extraParams.put(key, value);
×
1169
        return this;
×
1170
      }
1171

1172
      /**
1173
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
1174
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
1175
       * See {@link PaymentMethodUpdateParams.UsBankAccount#extraParams} for the field
1176
       * documentation.
1177
       */
1178
      public Builder putAllExtraParam(Map<String, Object> map) {
1179
        if (this.extraParams == null) {
×
1180
          this.extraParams = new HashMap<>();
×
1181
        }
1182
        this.extraParams.putAll(map);
×
1183
        return this;
×
1184
      }
1185
    }
1186

1187
    public enum AccountHolderType implements ApiRequestParams.EnumParam {
×
1188
      @SerializedName("company")
×
1189
      COMPANY("company"),
1190

1191
      @SerializedName("individual")
×
1192
      INDIVIDUAL("individual");
1193

1194
      @Getter(onMethod_ = {@Override})
1195
      private final String value;
1196

1197
      AccountHolderType(String value) {
×
1198
        this.value = value;
×
1199
      }
×
1200
    }
1201

1202
    public enum AccountType implements ApiRequestParams.EnumParam {
×
1203
      @SerializedName("checking")
×
1204
      CHECKING("checking"),
1205

1206
      @SerializedName("savings")
×
1207
      SAVINGS("savings");
1208

1209
      @Getter(onMethod_ = {@Override})
1210
      private final String value;
1211

1212
      AccountType(String value) {
×
1213
        this.value = value;
×
1214
      }
×
1215
    }
1216
  }
1217

1218
  public enum AllowRedisplay implements ApiRequestParams.EnumParam {
×
1219
    @SerializedName("always")
×
1220
    ALWAYS("always"),
1221

1222
    @SerializedName("limited")
×
1223
    LIMITED("limited"),
1224

1225
    @SerializedName("unspecified")
×
1226
    UNSPECIFIED("unspecified");
1227

1228
    @Getter(onMethod_ = {@Override})
1229
    private final String value;
1230

1231
    AllowRedisplay(String value) {
×
1232
      this.value = value;
×
1233
    }
×
1234
  }
1235
}
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