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

stripe / stripe-java / 4473

pending completion
4473

Pull #789

travis-ci

web-flow
[generated] source: spec3.sdk.yaml@spec-a6283af in master
Pull Request #789: [generated] source: spec3.sdk.yaml@spec-a6283af in master

2687 of 21349 relevant lines covered (12.59%)

23.79 hits per line

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

0.0
/src/main/java/com/stripe/param/PaymentIntentCreateParams.java
1
// Generated by com.stripe.generator.entity.SdkBuilder
2

3
package com.stripe.param;
4

5
import com.google.gson.annotations.SerializedName;
6
import com.stripe.net.ApiRequestParams;
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
public class PaymentIntentCreateParams extends ApiRequestParams {
×
14
  /**
15
   * A positive integer representing how much to charge in the [smallest currency
16
   * unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100
17
   * to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in
18
   * charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The
19
   * amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of
20
   * $999,999.99).
21
   */
22
  @SerializedName("amount")
23
  Long amount;
24

25
  /**
26
   * The amount of the application fee (if any) that will be applied to the payment and transferred
27
   * to the application owner's Stripe account. For more information, see the PaymentIntents [use
28
   * case for connected
29
   * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts).
30
   */
31
  @SerializedName("application_fee_amount")
32
  Long applicationFeeAmount;
33

34
  /**
35
   * One of `automatic` (default) or `manual`.
36
   *
37
   * <p>When the capture method is `automatic`, Stripe automatically captures funds when the
38
   * customer authorizes the payment.
39
   *
40
   * <p>Change `capture_method` to manual if you wish to [separate authorization and
41
   * capture](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#separate-authorization-and-capture)
42
   * for payment methods that support this.
43
   */
44
  @SerializedName("capture_method")
45
  CaptureMethod captureMethod;
46

47
  /**
48
   * Set to `true` to attempt to confirm this PaymentIntent immediately. This parameter defaults to
49
   * `false`. If the payment method attached is a card, a return_url may be provided in case
50
   * additional authentication is required.
51
   */
52
  @SerializedName("confirm")
53
  Boolean confirm;
54

55
  /**
56
   * One of `automatic` (default) or `manual`.
57
   *
58
   * <p>When the confirmation method is `automatic`, a PaymentIntent can be confirmed using a
59
   * publishable key. After `next_action`s are handled, no additional confirmation is required to
60
   * complete the payment.
61
   *
62
   * <p>When the confirmation method is `manual`, all payment attempts must be made using a secret
63
   * key. The PaymentIntent returns to the `requires_confirmation` state after handling
64
   * `next_action`s, and requires your server to initiate each payment attempt with an explicit
65
   * confirmation.
66
   *
67
   * <p>Learn more about the different [confirmation
68
   * flows](https://stripe.com/docs/payments/payment-intents#one-time-payments).
69
   */
70
  @SerializedName("confirmation_method")
71
  ConfirmationMethod confirmationMethod;
72

73
  /**
74
   * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in
75
   * lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
76
   */
77
  @SerializedName("currency")
78
  String currency;
79

80
  /** ID of the customer this PaymentIntent is for if one exists. */
81
  @SerializedName("customer")
82
  String customer;
83

84
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
85
  @SerializedName("description")
86
  String description;
87

88
  /** Specifies which fields in the response should be expanded. */
89
  @SerializedName("expand")
90
  List<String> expand;
91

92
  /**
93
   * Map of extra parameters for custom features not available in this client library. The content
94
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
95
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
96
   * param object. Effectively, this map is flattened to its parent instance.
97
   */
98
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
99
  Map<String, Object> extraParams;
100

101
  /**
102
   * Set of key-value pairs that you can attach to an object. This can be useful for storing
103
   * additional information about the object in a structured format.
104
   */
105
  @SerializedName("metadata")
106
  Map<String, String> metadata;
107

108
  /**
109
   * Used in payment flows that collect payment details and charge later, when the customer is not
110
   * available to complete additional required steps for the payment. Setting this parameter
111
   * indicates that this payment attempt is happening while the customer is not in your checkout
112
   * flow. Use `recurring` for payments made on a recurring basis (for example, subscriptions) and
113
   * `one_off` for all other off-session payments.
114
   */
115
  @SerializedName("off_session")
116
  OffSession offSession;
117

118
  /**
119
   * The Stripe account ID for which these funds are intended. For details, see the PaymentIntents
120
   * [use case for connected
121
   * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts).
122
   */
123
  @SerializedName("on_behalf_of")
124
  String onBehalfOf;
125

126
  /**
127
   * ID of the payment method (a PaymentMethod, Card, BankAccount, or saved Source object) to attach
128
   * to this PaymentIntent.
129
   */
130
  @SerializedName("payment_method")
131
  String paymentMethod;
132

133
  /**
134
   * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this
135
   * is not provided, defaults to ["card"].
136
   */
137
  @SerializedName("payment_method_types")
138
  List<String> paymentMethodTypes;
139

140
  /** Email address that the receipt for the resulting payment will be sent to. */
141
  @SerializedName("receipt_email")
142
  String receiptEmail;
143

144
  /**
145
   * The URL to redirect your customer back to after they authenticate or cancel their payment on
146
   * the payment method's app or site. If you'd prefer to redirect to a mobile application, you can
147
   * alternatively supply an application URI scheme. This param can only be used if `confirm=true`.
148
   */
149
  @SerializedName("return_url")
150
  String returnUrl;
151

152
  /**
153
   * If the PaymentIntent has a `payment_method` and a `customer` or if you're attaching a payment
154
   * method to the PaymentIntent in this request, you can pass `save_payment_method=true` to save
155
   * the payment method to the customer. Defaults to `false`.
156
   *
157
   * <p>If the payment method is already saved to a customer, this does nothing. If this type of
158
   * payment method cannot be saved to a customer, the request will error.
159
   */
160
  @SerializedName("save_payment_method")
161
  Boolean savePaymentMethod;
162

163
  /** Shipping information for this PaymentIntent. */
164
  @SerializedName("shipping")
165
  Shipping shipping;
166

167
  /**
168
   * This is a legacy field that will be removed in the future. It is the ID of the Source object to
169
   * attach to this PaymentIntent. Please use the `payment_method` field instead, which also
170
   * supports Source, Card, and BankAccount objects.
171
   */
172
  @SerializedName("source")
173
  String source;
174

175
  /**
176
   * Extra information about a PaymentIntent. This will appear on your customer's statement when
177
   * this PaymentIntent succeeds in creating a charge.
178
   */
179
  @SerializedName("statement_descriptor")
180
  String statementDescriptor;
181

182
  /**
183
   * The parameters used to automatically create a Transfer when the payment succeeds. For more
184
   * information, see the PaymentIntents [use case for connected
185
   * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts).
186
   */
187
  @SerializedName("transfer_data")
188
  TransferData transferData;
189

190
  /**
191
   * A string that identifies the resulting payment as part of a group. See the PaymentIntents [use
192
   * case for connected
193
   * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts) for
194
   * details.
195
   */
196
  @SerializedName("transfer_group")
197
  String transferGroup;
198

199
  private PaymentIntentCreateParams(
200
      Long amount,
201
      Long applicationFeeAmount,
202
      CaptureMethod captureMethod,
203
      Boolean confirm,
204
      ConfirmationMethod confirmationMethod,
205
      String currency,
206
      String customer,
207
      String description,
208
      List<String> expand,
209
      Map<String, Object> extraParams,
210
      Map<String, String> metadata,
211
      OffSession offSession,
212
      String onBehalfOf,
213
      String paymentMethod,
214
      List<String> paymentMethodTypes,
215
      String receiptEmail,
216
      String returnUrl,
217
      Boolean savePaymentMethod,
218
      Shipping shipping,
219
      String source,
220
      String statementDescriptor,
221
      TransferData transferData,
222
      String transferGroup) {
223
    this.amount = amount;
224
    this.applicationFeeAmount = applicationFeeAmount;
225
    this.captureMethod = captureMethod;
226
    this.confirm = confirm;
227
    this.confirmationMethod = confirmationMethod;
228
    this.currency = currency;
229
    this.customer = customer;
230
    this.description = description;
231
    this.expand = expand;
232
    this.extraParams = extraParams;
233
    this.metadata = metadata;
234
    this.offSession = offSession;
235
    this.onBehalfOf = onBehalfOf;
236
    this.paymentMethod = paymentMethod;
237
    this.paymentMethodTypes = paymentMethodTypes;
238
    this.receiptEmail = receiptEmail;
239
    this.returnUrl = returnUrl;
240
    this.savePaymentMethod = savePaymentMethod;
241
    this.shipping = shipping;
242
    this.source = source;
243
    this.statementDescriptor = statementDescriptor;
244
    this.transferData = transferData;
245
    this.transferGroup = transferGroup;
246
  }
247

248
  public static Builder builder() {
249
    return new com.stripe.param.PaymentIntentCreateParams.Builder();
×
250
  }
251

252
  public static class Builder {
253
    private Long amount;
254

255
    private Long applicationFeeAmount;
256

257
    private CaptureMethod captureMethod;
258

259
    private Boolean confirm;
260

261
    private ConfirmationMethod confirmationMethod;
262

263
    private String currency;
264

265
    private String customer;
266

267
    private String description;
268

269
    private List<String> expand;
270

271
    private Map<String, Object> extraParams;
272

273
    private Map<String, String> metadata;
274

275
    private OffSession offSession;
276

277
    private String onBehalfOf;
278

279
    private String paymentMethod;
280

281
    private List<String> paymentMethodTypes;
282

283
    private String receiptEmail;
284

285
    private String returnUrl;
286

287
    private Boolean savePaymentMethod;
288

289
    private Shipping shipping;
290

291
    private String source;
292

293
    private String statementDescriptor;
294

295
    private TransferData transferData;
296

297
    private String transferGroup;
298

299
    /** Finalize and obtain parameter instance from this builder. */
300
    public PaymentIntentCreateParams build() {
301
      return new PaymentIntentCreateParams(
×
302
          this.amount,
303
          this.applicationFeeAmount,
304
          this.captureMethod,
305
          this.confirm,
306
          this.confirmationMethod,
307
          this.currency,
308
          this.customer,
309
          this.description,
310
          this.expand,
311
          this.extraParams,
312
          this.metadata,
313
          this.offSession,
314
          this.onBehalfOf,
315
          this.paymentMethod,
316
          this.paymentMethodTypes,
317
          this.receiptEmail,
318
          this.returnUrl,
319
          this.savePaymentMethod,
320
          this.shipping,
321
          this.source,
322
          this.statementDescriptor,
323
          this.transferData,
324
          this.transferGroup);
325
    }
326

327
    /**
328
     * A positive integer representing how much to charge in the [smallest currency
329
     * unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or
330
     * 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent
331
     * in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
332
     * The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of
333
     * $999,999.99).
334
     */
335
    public Builder setAmount(Long amount) {
336
      this.amount = amount;
×
337
      return this;
×
338
    }
339

340
    /**
341
     * The amount of the application fee (if any) that will be applied to the payment and
342
     * transferred to the application owner's Stripe account. For more information, see the
343
     * PaymentIntents [use case for connected
344
     * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts).
345
     */
346
    public Builder setApplicationFeeAmount(Long applicationFeeAmount) {
347
      this.applicationFeeAmount = applicationFeeAmount;
×
348
      return this;
×
349
    }
350

351
    /**
352
     * One of `automatic` (default) or `manual`.
353
     *
354
     * <p>When the capture method is `automatic`, Stripe automatically captures funds when the
355
     * customer authorizes the payment.
356
     *
357
     * <p>Change `capture_method` to manual if you wish to [separate authorization and
358
     * capture](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#separate-authorization-and-capture)
359
     * for payment methods that support this.
360
     */
361
    public Builder setCaptureMethod(CaptureMethod captureMethod) {
362
      this.captureMethod = captureMethod;
×
363
      return this;
×
364
    }
365

366
    /**
367
     * Set to `true` to attempt to confirm this PaymentIntent immediately. This parameter defaults
368
     * to `false`. If the payment method attached is a card, a return_url may be provided in case
369
     * additional authentication is required.
370
     */
371
    public Builder setConfirm(Boolean confirm) {
372
      this.confirm = confirm;
×
373
      return this;
×
374
    }
375

376
    /**
377
     * One of `automatic` (default) or `manual`.
378
     *
379
     * <p>When the confirmation method is `automatic`, a PaymentIntent can be confirmed using a
380
     * publishable key. After `next_action`s are handled, no additional confirmation is required to
381
     * complete the payment.
382
     *
383
     * <p>When the confirmation method is `manual`, all payment attempts must be made using a secret
384
     * key. The PaymentIntent returns to the `requires_confirmation` state after handling
385
     * `next_action`s, and requires your server to initiate each payment attempt with an explicit
386
     * confirmation.
387
     *
388
     * <p>Learn more about the different [confirmation
389
     * flows](https://stripe.com/docs/payments/payment-intents#one-time-payments).
390
     */
391
    public Builder setConfirmationMethod(ConfirmationMethod confirmationMethod) {
392
      this.confirmationMethod = confirmationMethod;
×
393
      return this;
×
394
    }
395

396
    /**
397
     * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in
398
     * lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
399
     */
400
    public Builder setCurrency(String currency) {
401
      this.currency = currency;
×
402
      return this;
×
403
    }
404

405
    /** ID of the customer this PaymentIntent is for if one exists. */
406
    public Builder setCustomer(String customer) {
407
      this.customer = customer;
×
408
      return this;
×
409
    }
410

411
    /** An arbitrary string attached to the object. Often useful for displaying to users. */
412
    public Builder setDescription(String description) {
413
      this.description = description;
×
414
      return this;
×
415
    }
416

417
    /**
418
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
419
     * subsequent calls adds additional elements to the original list. See {@link
420
     * PaymentIntentCreateParams#expand} for the field documentation.
421
     */
422
    public Builder addExpand(String element) {
423
      if (this.expand == null) {
×
424
        this.expand = new ArrayList<>();
×
425
      }
426
      this.expand.add(element);
×
427
      return this;
×
428
    }
429

430
    /**
431
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
432
     * subsequent calls adds additional elements to the original list. See {@link
433
     * PaymentIntentCreateParams#expand} for the field documentation.
434
     */
435
    public Builder addAllExpand(List<String> elements) {
436
      if (this.expand == null) {
×
437
        this.expand = new ArrayList<>();
×
438
      }
439
      this.expand.addAll(elements);
×
440
      return this;
×
441
    }
442

443
    /**
444
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
445
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
446
     * PaymentIntentCreateParams#extraParams} for the field documentation.
447
     */
448
    public Builder putExtraParam(String key, Object value) {
449
      if (this.extraParams == null) {
×
450
        this.extraParams = new HashMap<>();
×
451
      }
452
      this.extraParams.put(key, value);
×
453
      return this;
×
454
    }
455

456
    /**
457
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
458
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
459
     * See {@link PaymentIntentCreateParams#extraParams} for the field documentation.
460
     */
461
    public Builder putAllExtraParam(Map<String, Object> map) {
462
      if (this.extraParams == null) {
×
463
        this.extraParams = new HashMap<>();
×
464
      }
465
      this.extraParams.putAll(map);
×
466
      return this;
×
467
    }
468

469
    /**
470
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
471
     * and subsequent calls add additional key/value pairs to the original map. See {@link
472
     * PaymentIntentCreateParams#metadata} for the field documentation.
473
     */
474
    public Builder putMetadata(String key, String value) {
475
      if (this.metadata == null) {
×
476
        this.metadata = new HashMap<>();
×
477
      }
478
      this.metadata.put(key, value);
×
479
      return this;
×
480
    }
481

482
    /**
483
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
484
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
485
     * See {@link PaymentIntentCreateParams#metadata} for the field documentation.
486
     */
487
    public Builder putAllMetadata(Map<String, String> map) {
488
      if (this.metadata == null) {
×
489
        this.metadata = new HashMap<>();
×
490
      }
491
      this.metadata.putAll(map);
×
492
      return this;
×
493
    }
494

495
    /**
496
     * Used in payment flows that collect payment details and charge later, when the customer is not
497
     * available to complete additional required steps for the payment. Setting this parameter
498
     * indicates that this payment attempt is happening while the customer is not in your checkout
499
     * flow. Use `recurring` for payments made on a recurring basis (for example, subscriptions) and
500
     * `one_off` for all other off-session payments.
501
     */
502
    public Builder setOffSession(OffSession offSession) {
503
      this.offSession = offSession;
×
504
      return this;
×
505
    }
506

507
    /**
508
     * The Stripe account ID for which these funds are intended. For details, see the PaymentIntents
509
     * [use case for connected
510
     * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts).
511
     */
512
    public Builder setOnBehalfOf(String onBehalfOf) {
513
      this.onBehalfOf = onBehalfOf;
×
514
      return this;
×
515
    }
516

517
    /**
518
     * ID of the payment method (a PaymentMethod, Card, BankAccount, or saved Source object) to
519
     * attach to this PaymentIntent.
520
     */
521
    public Builder setPaymentMethod(String paymentMethod) {
522
      this.paymentMethod = paymentMethod;
×
523
      return this;
×
524
    }
525

526
    /**
527
     * Add an element to `paymentMethodTypes` list. A list is initialized for the first `add/addAll`
528
     * call, and subsequent calls adds additional elements to the original list. See {@link
529
     * PaymentIntentCreateParams#paymentMethodTypes} for the field documentation.
530
     */
531
    public Builder addPaymentMethodType(String element) {
532
      if (this.paymentMethodTypes == null) {
×
533
        this.paymentMethodTypes = new ArrayList<>();
×
534
      }
535
      this.paymentMethodTypes.add(element);
×
536
      return this;
×
537
    }
538

539
    /**
540
     * Add all elements to `paymentMethodTypes` list. A list is initialized for the first
541
     * `add/addAll` call, and subsequent calls adds additional elements to the original list. See
542
     * {@link PaymentIntentCreateParams#paymentMethodTypes} for the field documentation.
543
     */
544
    public Builder addAllPaymentMethodType(List<String> elements) {
545
      if (this.paymentMethodTypes == null) {
×
546
        this.paymentMethodTypes = new ArrayList<>();
×
547
      }
548
      this.paymentMethodTypes.addAll(elements);
×
549
      return this;
×
550
    }
551

552
    /** Email address that the receipt for the resulting payment will be sent to. */
553
    public Builder setReceiptEmail(String receiptEmail) {
554
      this.receiptEmail = receiptEmail;
×
555
      return this;
×
556
    }
557

558
    /**
559
     * The URL to redirect your customer back to after they authenticate or cancel their payment on
560
     * the payment method's app or site. If you'd prefer to redirect to a mobile application, you
561
     * can alternatively supply an application URI scheme. This param can only be used if
562
     * `confirm=true`.
563
     */
564
    public Builder setReturnUrl(String returnUrl) {
565
      this.returnUrl = returnUrl;
×
566
      return this;
×
567
    }
568

569
    /**
570
     * If the PaymentIntent has a `payment_method` and a `customer` or if you're attaching a payment
571
     * method to the PaymentIntent in this request, you can pass `save_payment_method=true` to save
572
     * the payment method to the customer. Defaults to `false`.
573
     *
574
     * <p>If the payment method is already saved to a customer, this does nothing. If this type of
575
     * payment method cannot be saved to a customer, the request will error.
576
     */
577
    public Builder setSavePaymentMethod(Boolean savePaymentMethod) {
578
      this.savePaymentMethod = savePaymentMethod;
×
579
      return this;
×
580
    }
581

582
    /** Shipping information for this PaymentIntent. */
583
    public Builder setShipping(Shipping shipping) {
584
      this.shipping = shipping;
×
585
      return this;
×
586
    }
587

588
    /**
589
     * This is a legacy field that will be removed in the future. It is the ID of the Source object
590
     * to attach to this PaymentIntent. Please use the `payment_method` field instead, which also
591
     * supports Source, Card, and BankAccount objects.
592
     */
593
    public Builder setSource(String source) {
594
      this.source = source;
×
595
      return this;
×
596
    }
597

598
    /**
599
     * Extra information about a PaymentIntent. This will appear on your customer's statement when
600
     * this PaymentIntent succeeds in creating a charge.
601
     */
602
    public Builder setStatementDescriptor(String statementDescriptor) {
603
      this.statementDescriptor = statementDescriptor;
×
604
      return this;
×
605
    }
606

607
    /**
608
     * The parameters used to automatically create a Transfer when the payment succeeds. For more
609
     * information, see the PaymentIntents [use case for connected
610
     * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts).
611
     */
612
    public Builder setTransferData(TransferData transferData) {
613
      this.transferData = transferData;
×
614
      return this;
×
615
    }
616

617
    /**
618
     * A string that identifies the resulting payment as part of a group. See the PaymentIntents
619
     * [use case for connected
620
     * accounts](https://stripe.com/docs/payments/payment-intents/use-cases#connected-accounts) for
621
     * details.
622
     */
623
    public Builder setTransferGroup(String transferGroup) {
624
      this.transferGroup = transferGroup;
×
625
      return this;
×
626
    }
627
  }
628

629
  public static class Shipping {
×
630
    /** Shipping address. */
631
    @SerializedName("address")
632
    Address address;
633

634
    /** The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. */
635
    @SerializedName("carrier")
636
    String carrier;
637

638
    /**
639
     * Map of extra parameters for custom features not available in this client library. The content
640
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
641
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
642
     * param object. Effectively, this map is flattened to its parent instance.
643
     */
644
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
645
    Map<String, Object> extraParams;
646

647
    /** Recipient name. */
648
    @SerializedName("name")
649
    String name;
650

651
    /** Recipient phone (including extension). */
652
    @SerializedName("phone")
653
    String phone;
654

655
    /**
656
     * The tracking number for a physical product, obtained from the delivery service. If multiple
657
     * tracking numbers were generated for this purchase, please separate them with commas.
658
     */
659
    @SerializedName("tracking_number")
660
    String trackingNumber;
661

662
    private Shipping(
663
        Address address,
664
        String carrier,
665
        Map<String, Object> extraParams,
666
        String name,
667
        String phone,
668
        String trackingNumber) {
669
      this.address = address;
670
      this.carrier = carrier;
671
      this.extraParams = extraParams;
672
      this.name = name;
673
      this.phone = phone;
674
      this.trackingNumber = trackingNumber;
675
    }
676

677
    public static Builder builder() {
678
      return new com.stripe.param.PaymentIntentCreateParams.Shipping.Builder();
×
679
    }
680

681
    public static class Builder {
682
      private Address address;
683

684
      private String carrier;
685

686
      private Map<String, Object> extraParams;
687

688
      private String name;
689

690
      private String phone;
691

692
      private String trackingNumber;
693

694
      /** Finalize and obtain parameter instance from this builder. */
695
      public Shipping build() {
696
        return new Shipping(
×
697
            this.address,
698
            this.carrier,
699
            this.extraParams,
700
            this.name,
701
            this.phone,
702
            this.trackingNumber);
703
      }
704

705
      /** Shipping address. */
706
      public Builder setAddress(Address address) {
707
        this.address = address;
×
708
        return this;
×
709
      }
710

711
      /** The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. */
712
      public Builder setCarrier(String carrier) {
713
        this.carrier = carrier;
×
714
        return this;
×
715
      }
716

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

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

743
      /** Recipient name. */
744
      public Builder setName(String name) {
745
        this.name = name;
×
746
        return this;
×
747
      }
748

749
      /** Recipient phone (including extension). */
750
      public Builder setPhone(String phone) {
751
        this.phone = phone;
×
752
        return this;
×
753
      }
754

755
      /**
756
       * The tracking number for a physical product, obtained from the delivery service. If multiple
757
       * tracking numbers were generated for this purchase, please separate them with commas.
758
       */
759
      public Builder setTrackingNumber(String trackingNumber) {
760
        this.trackingNumber = trackingNumber;
×
761
        return this;
×
762
      }
763
    }
764

765
    public static class Address {
×
766
      @SerializedName("city")
767
      String city;
768

769
      @SerializedName("country")
770
      String country;
771

772
      /**
773
       * Map of extra parameters for custom features not available in this client library. The
774
       * content in this map is not serialized under this field's {@code @SerializedName} value.
775
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
776
       * name in this param object. Effectively, this map is flattened to its parent instance.
777
       */
778
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
779
      Map<String, Object> extraParams;
780

781
      @SerializedName("line1")
782
      String line1;
783

784
      @SerializedName("line2")
785
      String line2;
786

787
      @SerializedName("postal_code")
788
      String postalCode;
789

790
      @SerializedName("state")
791
      String state;
792

793
      private Address(
794
          String city,
795
          String country,
796
          Map<String, Object> extraParams,
797
          String line1,
798
          String line2,
799
          String postalCode,
800
          String state) {
801
        this.city = city;
802
        this.country = country;
803
        this.extraParams = extraParams;
804
        this.line1 = line1;
805
        this.line2 = line2;
806
        this.postalCode = postalCode;
807
        this.state = state;
808
      }
809

810
      public static Builder builder() {
811
        return new com.stripe.param.PaymentIntentCreateParams.Shipping.Address.Builder();
×
812
      }
813

814
      public static class Builder {
815
        private String city;
816

817
        private String country;
818

819
        private Map<String, Object> extraParams;
820

821
        private String line1;
822

823
        private String line2;
824

825
        private String postalCode;
826

827
        private String state;
828

829
        /** Finalize and obtain parameter instance from this builder. */
830
        public Address build() {
831
          return new Address(
×
832
              this.city,
833
              this.country,
834
              this.extraParams,
835
              this.line1,
836
              this.line2,
837
              this.postalCode,
838
              this.state);
839
        }
840

841
        public Builder setCity(String city) {
842
          this.city = city;
×
843
          return this;
×
844
        }
845

846
        public Builder setCountry(String country) {
847
          this.country = country;
×
848
          return this;
×
849
        }
850

851
        /**
852
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
853
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
854
         * map. See {@link PaymentIntentCreateParams.Shipping.Address#extraParams} for the field
855
         * documentation.
856
         */
857
        public Builder putExtraParam(String key, Object value) {
858
          if (this.extraParams == null) {
×
859
            this.extraParams = new HashMap<>();
×
860
          }
861
          this.extraParams.put(key, value);
×
862
          return this;
×
863
        }
864

865
        /**
866
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
867
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
868
         * map. See {@link PaymentIntentCreateParams.Shipping.Address#extraParams} for the field
869
         * documentation.
870
         */
871
        public Builder putAllExtraParam(Map<String, Object> map) {
872
          if (this.extraParams == null) {
×
873
            this.extraParams = new HashMap<>();
×
874
          }
875
          this.extraParams.putAll(map);
×
876
          return this;
×
877
        }
878

879
        public Builder setLine1(String line1) {
880
          this.line1 = line1;
×
881
          return this;
×
882
        }
883

884
        public Builder setLine2(String line2) {
885
          this.line2 = line2;
×
886
          return this;
×
887
        }
888

889
        public Builder setPostalCode(String postalCode) {
890
          this.postalCode = postalCode;
×
891
          return this;
×
892
        }
893

894
        public Builder setState(String state) {
895
          this.state = state;
×
896
          return this;
×
897
        }
898
      }
899
    }
900
  }
901

902
  public static class TransferData {
×
903
    /**
904
     * If specified, successful charges will be attributed to the destination account for tax
905
     * reporting, and the funds from charges will be transferred to the destination account. The ID
906
     * of the resulting transfer will be returned on the successful charge's `transfer` field.
907
     */
908
    @SerializedName("destination")
909
    String destination;
910

911
    /**
912
     * Map of extra parameters for custom features not available in this client library. The content
913
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
914
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
915
     * param object. Effectively, this map is flattened to its parent instance.
916
     */
917
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
918
    Map<String, Object> extraParams;
919

920
    private TransferData(String destination, Map<String, Object> extraParams) {
921
      this.destination = destination;
922
      this.extraParams = extraParams;
923
    }
924

925
    public static Builder builder() {
926
      return new com.stripe.param.PaymentIntentCreateParams.TransferData.Builder();
×
927
    }
928

929
    public static class Builder {
930
      private String destination;
931

932
      private Map<String, Object> extraParams;
933

934
      /** Finalize and obtain parameter instance from this builder. */
935
      public TransferData build() {
936
        return new TransferData(this.destination, this.extraParams);
×
937
      }
938

939
      /**
940
       * If specified, successful charges will be attributed to the destination account for tax
941
       * reporting, and the funds from charges will be transferred to the destination account. The
942
       * ID of the resulting transfer will be returned on the successful charge's `transfer` field.
943
       */
944
      public Builder setDestination(String destination) {
945
        this.destination = destination;
×
946
        return this;
×
947
      }
948

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

962
      /**
963
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
964
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
965
       * See {@link PaymentIntentCreateParams.TransferData#extraParams} for the field documentation.
966
       */
967
      public Builder putAllExtraParam(Map<String, Object> map) {
968
        if (this.extraParams == null) {
×
969
          this.extraParams = new HashMap<>();
×
970
        }
971
        this.extraParams.putAll(map);
×
972
        return this;
×
973
      }
974
    }
975
  }
976

977
  public enum CaptureMethod implements ApiRequestParams.EnumParam {
×
978
    @SerializedName("automatic")
×
979
    AUTOMATIC("automatic"),
980

981
    @SerializedName("manual")
×
982
    MANUAL("manual");
983

984
    @Getter(onMethod_ = {@Override})
985
    private final String value;
986

987
    CaptureMethod(String value) {
988
      this.value = value;
989
    }
990
  }
991

992
  public enum ConfirmationMethod implements ApiRequestParams.EnumParam {
×
993
    @SerializedName("automatic")
×
994
    AUTOMATIC("automatic"),
995

996
    @SerializedName("manual")
×
997
    MANUAL("manual");
998

999
    @Getter(onMethod_ = {@Override})
1000
    private final String value;
1001

1002
    ConfirmationMethod(String value) {
1003
      this.value = value;
1004
    }
1005
  }
1006

1007
  public enum OffSession implements ApiRequestParams.EnumParam {
×
1008
    @SerializedName("one_off")
×
1009
    ONE_OFF("one_off"),
1010

1011
    @SerializedName("recurring")
×
1012
    RECURRING("recurring");
1013

1014
    @Getter(onMethod_ = {@Override})
1015
    private final String value;
1016

1017
    OffSession(String value) {
1018
      this.value = value;
1019
    }
1020
  }
1021
}
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