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

stripe / stripe-java / #16659

21 Nov 2024 07:24PM UTC coverage: 12.4% (-0.01%) from 12.414%
#16659

push

github

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

Update generated code for beta

3 of 189 new or added lines in 10 files covered. (1.59%)

1 existing line in 1 file now uncovered.

18860 of 152092 relevant lines covered (12.4%)

0.12 hits per line

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

10.43
/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.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 PaymentIntentIncrementAuthorizationParams extends ApiRequestParams {
15
  /**
16
   * <strong>Required.</strong> The updated total amount that you intend to collect from the
17
   * cardholder. This amount must be greater than the currently authorized amount.
18
   */
19
  @SerializedName("amount")
20
  Long amount;
21

22
  /**
23
   * The amount of the application fee (if any) that will be requested to be applied to the payment
24
   * and transferred to the application owner's Stripe account. The amount of the application fee
25
   * collected will be capped at the total payment amount. For more information, see the
26
   * PaymentIntents <a href="https://stripe.com/docs/payments/connected-accounts">use case for
27
   * connected accounts</a>.
28
   */
29
  @SerializedName("application_fee_amount")
30
  Long applicationFeeAmount;
31

32
  /** Automations to be run during the PaymentIntent lifecycle. */
33
  @SerializedName("async_workflows")
34
  AsyncWorkflows asyncWorkflows;
35

36
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
37
  @SerializedName("description")
38
  String description;
39

40
  /** Specifies which fields in the response should be expanded. */
41
  @SerializedName("expand")
42
  List<String> expand;
43

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

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

62
  /** Payment method-specific configuration for this PaymentIntent. */
63
  @SerializedName("payment_method_options")
64
  PaymentMethodOptions paymentMethodOptions;
65

66
  /**
67
   * Text that appears on the customer's statement as the statement descriptor for a non-card or
68
   * card charge. This value overrides the account's default statement descriptor. For information
69
   * about requirements, including the 22-character limit, see <a
70
   * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
71
   * Descriptor docs</a>.
72
   */
73
  @SerializedName("statement_descriptor")
74
  String statementDescriptor;
75

76
  /**
77
   * The parameters used to automatically create a transfer after the payment is captured. Learn
78
   * more about the <a href="https://stripe.com/docs/payments/connected-accounts">use case for
79
   * connected accounts</a>.
80
   */
81
  @SerializedName("transfer_data")
82
  TransferData transferData;
83

84
  private PaymentIntentIncrementAuthorizationParams(
85
      Long amount,
86
      Long applicationFeeAmount,
87
      AsyncWorkflows asyncWorkflows,
88
      String description,
89
      List<String> expand,
90
      Map<String, Object> extraParams,
91
      Map<String, String> metadata,
92
      PaymentMethodOptions paymentMethodOptions,
93
      String statementDescriptor,
94
      TransferData transferData) {
1✔
95
    this.amount = amount;
1✔
96
    this.applicationFeeAmount = applicationFeeAmount;
1✔
97
    this.asyncWorkflows = asyncWorkflows;
1✔
98
    this.description = description;
1✔
99
    this.expand = expand;
1✔
100
    this.extraParams = extraParams;
1✔
101
    this.metadata = metadata;
1✔
102
    this.paymentMethodOptions = paymentMethodOptions;
1✔
103
    this.statementDescriptor = statementDescriptor;
1✔
104
    this.transferData = transferData;
1✔
105
  }
1✔
106

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

111
  public static class Builder {
1✔
112
    private Long amount;
113

114
    private Long applicationFeeAmount;
115

116
    private AsyncWorkflows asyncWorkflows;
117

118
    private String description;
119

120
    private List<String> expand;
121

122
    private Map<String, Object> extraParams;
123

124
    private Map<String, String> metadata;
125

126
    private PaymentMethodOptions paymentMethodOptions;
127

128
    private String statementDescriptor;
129

130
    private TransferData transferData;
131

132
    /** Finalize and obtain parameter instance from this builder. */
133
    public PaymentIntentIncrementAuthorizationParams build() {
134
      return new PaymentIntentIncrementAuthorizationParams(
1✔
135
          this.amount,
136
          this.applicationFeeAmount,
137
          this.asyncWorkflows,
138
          this.description,
139
          this.expand,
140
          this.extraParams,
141
          this.metadata,
142
          this.paymentMethodOptions,
143
          this.statementDescriptor,
144
          this.transferData);
145
    }
146

147
    /**
148
     * <strong>Required.</strong> The updated total amount that you intend to collect from the
149
     * cardholder. This amount must be greater than the currently authorized amount.
150
     */
151
    public Builder setAmount(Long amount) {
152
      this.amount = amount;
1✔
153
      return this;
1✔
154
    }
155

156
    /**
157
     * The amount of the application fee (if any) that will be requested to be applied to the
158
     * payment and transferred to the application owner's Stripe account. The amount of the
159
     * application fee collected will be capped at the total payment amount. For more information,
160
     * see the PaymentIntents <a href="https://stripe.com/docs/payments/connected-accounts">use case
161
     * for connected accounts</a>.
162
     */
163
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
164
      this.applicationFeeAmount = applicationFeeAmount;
×
165
      return this;
×
166
    }
167

168
    /** Automations to be run during the PaymentIntent lifecycle. */
169
    public Builder setAsyncWorkflows(
170
        PaymentIntentIncrementAuthorizationParams.AsyncWorkflows asyncWorkflows) {
171
      this.asyncWorkflows = asyncWorkflows;
×
172
      return this;
×
173
    }
174

175
    /** An arbitrary string attached to the object. Often useful for displaying to users. */
176
    public Builder setDescription(String description) {
177
      this.description = description;
×
178
      return this;
×
179
    }
180

181
    /**
182
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
183
     * subsequent calls adds additional elements to the original list. See {@link
184
     * PaymentIntentIncrementAuthorizationParams#expand} for the field documentation.
185
     */
186
    public Builder addExpand(String element) {
187
      if (this.expand == null) {
×
188
        this.expand = new ArrayList<>();
×
189
      }
190
      this.expand.add(element);
×
191
      return this;
×
192
    }
193

194
    /**
195
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
196
     * subsequent calls adds additional elements to the original list. See {@link
197
     * PaymentIntentIncrementAuthorizationParams#expand} for the field documentation.
198
     */
199
    public Builder addAllExpand(List<String> elements) {
200
      if (this.expand == null) {
×
201
        this.expand = new ArrayList<>();
×
202
      }
203
      this.expand.addAll(elements);
×
204
      return this;
×
205
    }
206

207
    /**
208
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
209
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
210
     * PaymentIntentIncrementAuthorizationParams#extraParams} for the field documentation.
211
     */
212
    public Builder putExtraParam(String key, Object value) {
213
      if (this.extraParams == null) {
×
214
        this.extraParams = new HashMap<>();
×
215
      }
216
      this.extraParams.put(key, value);
×
217
      return this;
×
218
    }
219

220
    /**
221
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
222
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
223
     * See {@link PaymentIntentIncrementAuthorizationParams#extraParams} for the field
224
     * documentation.
225
     */
226
    public Builder putAllExtraParam(Map<String, Object> map) {
227
      if (this.extraParams == null) {
×
228
        this.extraParams = new HashMap<>();
×
229
      }
230
      this.extraParams.putAll(map);
×
231
      return this;
×
232
    }
233

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

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

260
    /** Payment method-specific configuration for this PaymentIntent. */
261
    public Builder setPaymentMethodOptions(
262
        PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions paymentMethodOptions) {
NEW
263
      this.paymentMethodOptions = paymentMethodOptions;
×
NEW
264
      return this;
×
265
    }
266

267
    /**
268
     * Text that appears on the customer's statement as the statement descriptor for a non-card or
269
     * card charge. This value overrides the account's default statement descriptor. For information
270
     * about requirements, including the 22-character limit, see <a
271
     * href="https://docs.stripe.com/get-started/account/statement-descriptors">the Statement
272
     * Descriptor docs</a>.
273
     */
274
    public Builder setStatementDescriptor(String statementDescriptor) {
275
      this.statementDescriptor = statementDescriptor;
×
276
      return this;
×
277
    }
278

279
    /**
280
     * The parameters used to automatically create a transfer after the payment is captured. Learn
281
     * more about the <a href="https://stripe.com/docs/payments/connected-accounts">use case for
282
     * connected accounts</a>.
283
     */
284
    public Builder setTransferData(
285
        PaymentIntentIncrementAuthorizationParams.TransferData transferData) {
286
      this.transferData = transferData;
×
287
      return this;
×
288
    }
289
  }
290

291
  @Getter
292
  public static class AsyncWorkflows {
293
    /**
294
     * Map of extra parameters for custom features not available in this client library. The content
295
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
296
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
297
     * param object. Effectively, this map is flattened to its parent instance.
298
     */
299
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
300
    Map<String, Object> extraParams;
301

302
    /** Arguments passed in automations. */
303
    @SerializedName("inputs")
304
    Inputs inputs;
305

306
    private AsyncWorkflows(Map<String, Object> extraParams, Inputs inputs) {
×
307
      this.extraParams = extraParams;
×
308
      this.inputs = inputs;
×
309
    }
×
310

311
    public static Builder builder() {
312
      return new Builder();
×
313
    }
314

315
    public static class Builder {
×
316
      private Map<String, Object> extraParams;
317

318
      private Inputs inputs;
319

320
      /** Finalize and obtain parameter instance from this builder. */
321
      public PaymentIntentIncrementAuthorizationParams.AsyncWorkflows build() {
322
        return new PaymentIntentIncrementAuthorizationParams.AsyncWorkflows(
×
323
            this.extraParams, this.inputs);
324
      }
325

326
      /**
327
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
328
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
329
       * PaymentIntentIncrementAuthorizationParams.AsyncWorkflows#extraParams} for the field
330
       * documentation.
331
       */
332
      public Builder putExtraParam(String key, Object value) {
333
        if (this.extraParams == null) {
×
334
          this.extraParams = new HashMap<>();
×
335
        }
336
        this.extraParams.put(key, value);
×
337
        return this;
×
338
      }
339

340
      /**
341
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
342
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
343
       * See {@link PaymentIntentIncrementAuthorizationParams.AsyncWorkflows#extraParams} for the
344
       * field documentation.
345
       */
346
      public Builder putAllExtraParam(Map<String, Object> map) {
347
        if (this.extraParams == null) {
×
348
          this.extraParams = new HashMap<>();
×
349
        }
350
        this.extraParams.putAll(map);
×
351
        return this;
×
352
      }
353

354
      /** Arguments passed in automations. */
355
      public Builder setInputs(
356
          PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs inputs) {
357
        this.inputs = inputs;
×
358
        return this;
×
359
      }
360
    }
361

362
    @Getter
363
    public static class Inputs {
364
      /**
365
       * Map of extra parameters for custom features not available in this client library. The
366
       * content in this map is not serialized under this field's {@code @SerializedName} value.
367
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
368
       * name in this param object. Effectively, this map is flattened to its parent instance.
369
       */
370
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
371
      Map<String, Object> extraParams;
372

373
      /** Tax arguments for automations. */
374
      @SerializedName("tax")
375
      Tax tax;
376

377
      private Inputs(Map<String, Object> extraParams, Tax tax) {
×
378
        this.extraParams = extraParams;
×
379
        this.tax = tax;
×
380
      }
×
381

382
      public static Builder builder() {
383
        return new Builder();
×
384
      }
385

386
      public static class Builder {
×
387
        private Map<String, Object> extraParams;
388

389
        private Tax tax;
390

391
        /** Finalize and obtain parameter instance from this builder. */
392
        public PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs build() {
393
          return new PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs(
×
394
              this.extraParams, this.tax);
395
        }
396

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

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

427
        /** Tax arguments for automations. */
428
        public Builder setTax(
429
            PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs.Tax tax) {
430
          this.tax = tax;
×
431
          return this;
×
432
        }
433
      }
434

435
      @Getter
436
      public static class Tax {
437
        /**
438
         * <strong>Required.</strong> The <a
439
         * href="https://stripe.com/docs/api/tax/calculations">TaxCalculation</a> id
440
         */
441
        @SerializedName("calculation")
442
        Object calculation;
443

444
        /**
445
         * Map of extra parameters for custom features not available in this client library. The
446
         * content in this map is not serialized under this field's {@code @SerializedName} value.
447
         * Instead, each key/value pair is serialized as if the key is a root-level field
448
         * (serialized) name in this param object. Effectively, this map is flattened to its parent
449
         * instance.
450
         */
451
        @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
452
        Map<String, Object> extraParams;
453

454
        private Tax(Object calculation, Map<String, Object> extraParams) {
×
455
          this.calculation = calculation;
×
456
          this.extraParams = extraParams;
×
457
        }
×
458

459
        public static Builder builder() {
460
          return new Builder();
×
461
        }
462

463
        public static class Builder {
×
464
          private Object calculation;
465

466
          private Map<String, Object> extraParams;
467

468
          /** Finalize and obtain parameter instance from this builder. */
469
          public PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs.Tax build() {
470
            return new PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs.Tax(
×
471
                this.calculation, this.extraParams);
472
          }
473

474
          /**
475
           * <strong>Required.</strong> The <a
476
           * href="https://stripe.com/docs/api/tax/calculations">TaxCalculation</a> id
477
           */
478
          public Builder setCalculation(String calculation) {
479
            this.calculation = calculation;
×
480
            return this;
×
481
          }
482

483
          /**
484
           * <strong>Required.</strong> The <a
485
           * href="https://stripe.com/docs/api/tax/calculations">TaxCalculation</a> id
486
           */
487
          public Builder setCalculation(EmptyParam calculation) {
488
            this.calculation = calculation;
×
489
            return this;
×
490
          }
491

492
          /**
493
           * Add a key/value pair to `extraParams` map. A map is initialized for the first
494
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
495
           * map. See {@link
496
           * PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs.Tax#extraParams} for
497
           * the field documentation.
498
           */
499
          public Builder putExtraParam(String key, Object value) {
500
            if (this.extraParams == null) {
×
501
              this.extraParams = new HashMap<>();
×
502
            }
503
            this.extraParams.put(key, value);
×
504
            return this;
×
505
          }
506

507
          /**
508
           * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
509
           * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
510
           * map. See {@link
511
           * PaymentIntentIncrementAuthorizationParams.AsyncWorkflows.Inputs.Tax#extraParams} for
512
           * the field documentation.
513
           */
514
          public Builder putAllExtraParam(Map<String, Object> map) {
515
            if (this.extraParams == null) {
×
516
              this.extraParams = new HashMap<>();
×
517
            }
518
            this.extraParams.putAll(map);
×
519
            return this;
×
520
          }
521
        }
522
      }
523
    }
524
  }
525

526
  @Getter
527
  public static class PaymentMethodOptions {
528
    /** Configuration for any card payments attempted on this PaymentIntent. */
529
    @SerializedName("card")
530
    Card card;
531

532
    /**
533
     * Map of extra parameters for custom features not available in this client library. The content
534
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
535
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
536
     * param object. Effectively, this map is flattened to its parent instance.
537
     */
538
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
539
    Map<String, Object> extraParams;
540

NEW
541
    private PaymentMethodOptions(Card card, Map<String, Object> extraParams) {
×
NEW
542
      this.card = card;
×
NEW
543
      this.extraParams = extraParams;
×
NEW
544
    }
×
545

546
    public static Builder builder() {
NEW
547
      return new Builder();
×
548
    }
549

NEW
550
    public static class Builder {
×
551
      private Card card;
552

553
      private Map<String, Object> extraParams;
554

555
      /** Finalize and obtain parameter instance from this builder. */
556
      public PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions build() {
NEW
557
        return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions(
×
558
            this.card, this.extraParams);
559
      }
560

561
      /** Configuration for any card payments attempted on this PaymentIntent. */
562
      public Builder setCard(
563
          PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card card) {
NEW
564
        this.card = card;
×
NEW
565
        return this;
×
566
      }
567

568
      /**
569
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
570
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
571
       * PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions#extraParams} for the field
572
       * documentation.
573
       */
574
      public Builder putExtraParam(String key, Object value) {
NEW
575
        if (this.extraParams == null) {
×
NEW
576
          this.extraParams = new HashMap<>();
×
577
        }
NEW
578
        this.extraParams.put(key, value);
×
NEW
579
        return this;
×
580
      }
581

582
      /**
583
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
584
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
585
       * See {@link PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions#extraParams} for
586
       * the field documentation.
587
       */
588
      public Builder putAllExtraParam(Map<String, Object> map) {
NEW
589
        if (this.extraParams == null) {
×
NEW
590
          this.extraParams = new HashMap<>();
×
591
        }
NEW
592
        this.extraParams.putAll(map);
×
NEW
593
        return this;
×
594
      }
595
    }
596

597
    @Getter
598
    public static class Card {
599
      /**
600
       * Map of extra parameters for custom features not available in this client library. The
601
       * content in this map is not serialized under this field's {@code @SerializedName} value.
602
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
603
       * name in this param object. Effectively, this map is flattened to its parent instance.
604
       */
605
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
606
      Map<String, Object> extraParams;
607

608
      /** Request partial authorization on this PaymentIntent. */
609
      @SerializedName("request_partial_authorization")
610
      RequestPartialAuthorization requestPartialAuthorization;
611

612
      private Card(
613
          Map<String, Object> extraParams,
NEW
614
          RequestPartialAuthorization requestPartialAuthorization) {
×
NEW
615
        this.extraParams = extraParams;
×
NEW
616
        this.requestPartialAuthorization = requestPartialAuthorization;
×
NEW
617
      }
×
618

619
      public static Builder builder() {
NEW
620
        return new Builder();
×
621
      }
622

NEW
623
      public static class Builder {
×
624
        private Map<String, Object> extraParams;
625

626
        private RequestPartialAuthorization requestPartialAuthorization;
627

628
        /** Finalize and obtain parameter instance from this builder. */
629
        public PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card build() {
NEW
630
          return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card(
×
631
              this.extraParams, this.requestPartialAuthorization);
632
        }
633

634
        /**
635
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
636
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
637
         * map. See {@link
638
         * PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card#extraParams} for the
639
         * field documentation.
640
         */
641
        public Builder putExtraParam(String key, Object value) {
NEW
642
          if (this.extraParams == null) {
×
NEW
643
            this.extraParams = new HashMap<>();
×
644
          }
NEW
645
          this.extraParams.put(key, value);
×
NEW
646
          return this;
×
647
        }
648

649
        /**
650
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
651
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
652
         * map. See {@link
653
         * PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card#extraParams} for the
654
         * field documentation.
655
         */
656
        public Builder putAllExtraParam(Map<String, Object> map) {
NEW
657
          if (this.extraParams == null) {
×
NEW
658
            this.extraParams = new HashMap<>();
×
659
          }
NEW
660
          this.extraParams.putAll(map);
×
NEW
661
          return this;
×
662
        }
663

664
        /** Request partial authorization on this PaymentIntent. */
665
        public Builder setRequestPartialAuthorization(
666
            PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card
667
                    .RequestPartialAuthorization
668
                requestPartialAuthorization) {
NEW
669
          this.requestPartialAuthorization = requestPartialAuthorization;
×
NEW
670
          return this;
×
671
        }
672
      }
673

NEW
674
      public enum RequestPartialAuthorization implements ApiRequestParams.EnumParam {
×
NEW
675
        @SerializedName("if_available")
×
676
        IF_AVAILABLE("if_available"),
677

NEW
678
        @SerializedName("never")
×
679
        NEVER("never");
680

681
        @Getter(onMethod_ = {@Override})
682
        private final String value;
683

NEW
684
        RequestPartialAuthorization(String value) {
×
NEW
685
          this.value = value;
×
NEW
686
        }
×
687
      }
688
    }
689
  }
690

691
  @Getter
692
  public static class TransferData {
693
    /** The amount that will be transferred automatically when a charge succeeds. */
694
    @SerializedName("amount")
695
    Long amount;
696

697
    /**
698
     * Map of extra parameters for custom features not available in this client library. The content
699
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
700
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
701
     * param object. Effectively, this map is flattened to its parent instance.
702
     */
703
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
704
    Map<String, Object> extraParams;
705

706
    private TransferData(Long amount, Map<String, Object> extraParams) {
×
707
      this.amount = amount;
×
708
      this.extraParams = extraParams;
×
709
    }
×
710

711
    public static Builder builder() {
712
      return new Builder();
×
713
    }
714

715
    public static class Builder {
×
716
      private Long amount;
717

718
      private Map<String, Object> extraParams;
719

720
      /** Finalize and obtain parameter instance from this builder. */
721
      public PaymentIntentIncrementAuthorizationParams.TransferData build() {
722
        return new PaymentIntentIncrementAuthorizationParams.TransferData(
×
723
            this.amount, this.extraParams);
724
      }
725

726
      /** The amount that will be transferred automatically when a charge succeeds. */
727
      public Builder setAmount(Long amount) {
728
        this.amount = amount;
×
729
        return this;
×
730
      }
731

732
      /**
733
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
734
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
735
       * PaymentIntentIncrementAuthorizationParams.TransferData#extraParams} for the field
736
       * documentation.
737
       */
738
      public Builder putExtraParam(String key, Object value) {
739
        if (this.extraParams == null) {
×
740
          this.extraParams = new HashMap<>();
×
741
        }
742
        this.extraParams.put(key, value);
×
743
        return this;
×
744
      }
745

746
      /**
747
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
748
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
749
       * See {@link PaymentIntentIncrementAuthorizationParams.TransferData#extraParams} for the
750
       * field documentation.
751
       */
752
      public Builder putAllExtraParam(Map<String, Object> map) {
753
        if (this.extraParams == null) {
×
754
          this.extraParams = new HashMap<>();
×
755
        }
756
        this.extraParams.putAll(map);
×
757
        return this;
×
758
      }
759
    }
760
  }
761
}
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