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

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

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

54.1
/src/main/java/com/stripe/model/Source.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.net.StripeResponseGetter;
12
import com.stripe.param.SourceCreateParams;
13
import com.stripe.param.SourceDetachParams;
14
import com.stripe.param.SourceRetrieveParams;
15
import com.stripe.param.SourceSourceTransactionsParams;
16
import com.stripe.param.SourceUpdateParams;
17
import com.stripe.param.SourceVerifyParams;
18
import java.util.List;
19
import java.util.Map;
20
import lombok.EqualsAndHashCode;
21
import lombok.Getter;
22
import lombok.Setter;
23

24
/**
25
 * {@code Source} objects allow you to accept a variety of payment methods. They represent a
26
 * customer's payment instrument, and can be used with the Stripe API just like a {@code Card}
27
 * object: once chargeable, they can be charged, or can be attached to customers.
28
 *
29
 * <p>Stripe doesn't recommend using the deprecated <a
30
 * href="https://stripe.com/docs/api/sources">Sources API</a>. We recommend that you adopt the <a
31
 * href="https://stripe.com/docs/api/payment_methods">PaymentMethods API</a>. This newer API
32
 * provides access to our latest features and payment method types.
33
 *
34
 * <p>Related guides: <a href="https://stripe.com/docs/sources">Sources API</a> and <a
35
 * href="https://stripe.com/docs/sources/customers">Sources &amp; Customers</a>.
36
 */
37
@Getter
38
@Setter
39
@EqualsAndHashCode(callSuper = false)
40
public class Source extends ApiResource implements MetadataStore<Source>, PaymentSource {
1✔
41
  @SerializedName("ach_credit_transfer")
42
  AchCreditTransfer achCreditTransfer;
43

44
  @SerializedName("ach_debit")
45
  AchDebit achDebit;
46

47
  @SerializedName("acss_debit")
48
  AcssDebit acssDebit;
49

50
  @SerializedName("alipay")
51
  Alipay alipay;
52

53
  /**
54
   * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1,
55
   * Japanese Yen being a zero-decimal currency) representing the total amount associated with the
56
   * source. This is the amount for which the source will be chargeable once ready. Required for
57
   * {@code single_use} sources.
58
   */
59
  @SerializedName("amount")
60
  Long amount;
61

62
  @SerializedName("au_becs_debit")
63
  AuBecsDebit auBecsDebit;
64

65
  @SerializedName("bancontact")
66
  Bancontact bancontact;
67

68
  @SerializedName("card")
69
  Card card;
70

71
  @SerializedName("card_present")
72
  CardPresent cardPresent;
73

74
  /** The client secret of the source. Used for client-side retrieval using a publishable key. */
75
  @SerializedName("client_secret")
76
  String clientSecret;
77

78
  @SerializedName("code_verification")
79
  CodeVerification codeVerification;
80

81
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
82
  @SerializedName("created")
83
  Long created;
84

85
  /**
86
   * Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a>
87
   * associated with the source. This is the currency for which the source will be chargeable once
88
   * ready. Required for {@code single_use} sources.
89
   */
90
  @SerializedName("currency")
91
  String currency;
92

93
  /**
94
   * The ID of the customer to which this source is attached. This will not be present when the
95
   * source has not been attached to a customer.
96
   */
97
  @SerializedName("customer")
98
  String customer;
99

100
  @SerializedName("eps")
101
  Eps eps;
102

103
  /**
104
   * The authentication {@code flow} of the source. {@code flow} is one of {@code redirect}, {@code
105
   * receiver}, {@code code_verification}, {@code none}.
106
   */
107
  @SerializedName("flow")
108
  String flow;
109

110
  @SerializedName("giropay")
111
  Giropay giropay;
112

113
  /** Unique identifier for the object. */
114
  @Getter(onMethod_ = {@Override})
115
  @SerializedName("id")
116
  String id;
117

118
  @SerializedName("ideal")
119
  Ideal ideal;
120

121
  @SerializedName("klarna")
122
  Klarna klarna;
123

124
  /**
125
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
126
   * object exists in test mode.
127
   */
128
  @SerializedName("livemode")
129
  Boolean livemode;
130

131
  /**
132
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
133
   * to an object. This can be useful for storing additional information about the object in a
134
   * structured format.
135
   */
136
  @Getter(onMethod_ = {@Override})
137
  @SerializedName("metadata")
138
  Map<String, String> metadata;
139

140
  @SerializedName("multibanco")
141
  Multibanco multibanco;
142

143
  /**
144
   * String representing the object's type. Objects of the same type share the same value.
145
   *
146
   * <p>Equal to {@code source}.
147
   */
148
  @SerializedName("object")
149
  String object;
150

151
  /**
152
   * Information about the owner of the payment instrument that may be used or required by
153
   * particular source types.
154
   */
155
  @SerializedName("owner")
156
  Owner owner;
157

158
  @SerializedName("p24")
159
  P24 p24;
160

161
  @SerializedName("paypal")
162
  Paypal paypal;
163

164
  @SerializedName("receiver")
165
  Receiver receiver;
166

167
  @SerializedName("redirect")
168
  Redirect redirect;
169

170
  @SerializedName("sepa_credit_transfer")
171
  SepaCreditTransfer sepaCreditTransfer;
172

173
  @SerializedName("sepa_debit")
174
  SepaDebit sepaDebit;
175

176
  @SerializedName("sofort")
177
  Sofort sofort;
178

179
  @SerializedName("source_order")
180
  SourceOrder sourceOrder;
181

182
  /**
183
   * Extra information about a source. This will appear on your customer's statement every time you
184
   * charge the source.
185
   */
186
  @SerializedName("statement_descriptor")
187
  String statementDescriptor;
188

189
  /**
190
   * The status of the source, one of {@code canceled}, {@code chargeable}, {@code consumed}, {@code
191
   * failed}, or {@code pending}. Only {@code chargeable} sources can be used to create a charge.
192
   */
193
  @SerializedName("status")
194
  String status;
195

196
  @SerializedName("three_d_secure")
197
  ThreeDSecure threeDSecure;
198

199
  /**
200
   * The {@code type} of the source. The {@code type} is a payment method, one of {@code
201
   * ach_credit_transfer}, {@code ach_debit}, {@code alipay}, {@code bancontact}, {@code card},
202
   * {@code card_present}, {@code eps}, {@code giropay}, {@code ideal}, {@code multibanco}, {@code
203
   * klarna}, {@code p24}, {@code sepa_debit}, {@code sofort}, {@code three_d_secure}, or {@code
204
   * wechat}. An additional hash is included on the source with a name matching this value. It
205
   * contains additional information specific to the <a
206
   * href="https://stripe.com/docs/sources">payment method</a> used.
207
   */
208
  @SerializedName("type")
209
  String type;
210

211
  /**
212
   * Either {@code reusable} or {@code single_use}. Whether this source should be reusable or not.
213
   * Some source types may or may not be reusable by construction, while others may leave the option
214
   * at creation. If an incompatible value is passed, an error will be returned.
215
   */
216
  @SerializedName("usage")
217
  String usage;
218

219
  @SerializedName("wechat")
220
  Wechat wechat;
221

222
  /** Creates a new source object. */
223
  public static Source create(Map<String, Object> params) throws StripeException {
224
    return create(params, (RequestOptions) null);
1✔
225
  }
226

227
  /** Creates a new source object. */
228
  public static Source create(Map<String, Object> params, RequestOptions options)
229
      throws StripeException {
230
    String path = "/v1/sources";
1✔
231
    ApiRequest request =
1✔
232
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
233
    return getGlobalResponseGetter().request(request, Source.class);
1✔
234
  }
235

236
  /** Creates a new source object. */
237
  public static Source create(SourceCreateParams params) throws StripeException {
238
    return create(params, (RequestOptions) null);
×
239
  }
240

241
  /** Creates a new source object. */
242
  public static Source create(SourceCreateParams params, RequestOptions options)
243
      throws StripeException {
244
    String path = "/v1/sources";
×
245
    ApiResource.checkNullTypedParams(path, params);
×
246
    ApiRequest request =
×
247
        new ApiRequest(
248
            BaseAddress.API,
249
            ApiResource.RequestMethod.POST,
250
            path,
251
            ApiRequestParams.paramsToMap(params),
×
252
            options);
UNCOV
253
    return getGlobalResponseGetter().request(request, Source.class);
×
254
  }
255

256
  /** Delete a specified source for a given customer. */
257
  public Source detach() throws StripeException {
258
    return detach((Map<String, Object>) null, (RequestOptions) null);
1✔
259
  }
260

261
  /** Delete a specified source for a given customer. */
262
  public Source detach(Map<String, Object> params) throws StripeException {
263
    return detach(params, (RequestOptions) null);
×
264
  }
265

266
  /** Delete a specified source for a given customer. */
267
  public Source detach(Map<String, Object> params, RequestOptions options) throws StripeException {
268
    String path =
1✔
269
        String.format(
1✔
270
            "/v1/customers/%s/sources/%s",
271
            ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
1✔
272
    ApiRequest request =
1✔
273
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options);
274
    return getResponseGetter().request(request, Source.class);
1✔
275
  }
276

277
  /** Delete a specified source for a given customer. */
278
  public Source detach(SourceDetachParams params) throws StripeException {
279
    return detach(params, (RequestOptions) null);
×
280
  }
281

282
  /** Delete a specified source for a given customer. */
283
  public Source detach(SourceDetachParams params, RequestOptions options) throws StripeException {
284
    String path =
×
285
        String.format(
×
286
            "/v1/customers/%s/sources/%s",
287
            ApiResource.urlEncodeId(this.getCustomer()), ApiResource.urlEncodeId(this.getId()));
×
288
    ApiResource.checkNullTypedParams(path, params);
×
289
    ApiRequest request =
×
290
        new ApiRequest(
291
            BaseAddress.API,
292
            ApiResource.RequestMethod.DELETE,
293
            path,
294
            ApiRequestParams.paramsToMap(params),
×
295
            options);
UNCOV
296
    return getResponseGetter().request(request, Source.class);
×
297
  }
298

299
  /**
300
   * Retrieves an existing source object. Supply the unique source ID from a source creation request
301
   * and Stripe will return the corresponding up-to-date source object information.
302
   */
303
  public static Source retrieve(String source) throws StripeException {
304
    return retrieve(source, (Map<String, Object>) null, (RequestOptions) null);
1✔
305
  }
306

307
  /**
308
   * Retrieves an existing source object. Supply the unique source ID from a source creation request
309
   * and Stripe will return the corresponding up-to-date source object information.
310
   */
311
  public static Source retrieve(String source, RequestOptions options) throws StripeException {
312
    return retrieve(source, (Map<String, Object>) null, options);
×
313
  }
314

315
  /**
316
   * Retrieves an existing source object. Supply the unique source ID from a source creation request
317
   * and Stripe will return the corresponding up-to-date source object information.
318
   */
319
  public static Source retrieve(String source, Map<String, Object> params, RequestOptions options)
320
      throws StripeException {
321
    String path = String.format("/v1/sources/%s", ApiResource.urlEncodeId(source));
1✔
322
    ApiRequest request =
1✔
323
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
324
    return getGlobalResponseGetter().request(request, Source.class);
1✔
325
  }
326

327
  /**
328
   * Retrieves an existing source object. Supply the unique source ID from a source creation request
329
   * and Stripe will return the corresponding up-to-date source object information.
330
   */
331
  public static Source retrieve(String source, SourceRetrieveParams params, RequestOptions options)
332
      throws StripeException {
333
    String path = String.format("/v1/sources/%s", ApiResource.urlEncodeId(source));
×
334
    ApiResource.checkNullTypedParams(path, params);
×
335
    ApiRequest request =
×
336
        new ApiRequest(
337
            BaseAddress.API,
338
            ApiResource.RequestMethod.GET,
339
            path,
340
            ApiRequestParams.paramsToMap(params),
×
341
            options);
UNCOV
342
    return getGlobalResponseGetter().request(request, Source.class);
×
343
  }
344

345
  /** List source transactions for a given source. */
346
  public SourceTransactionCollection sourceTransactions() throws StripeException {
347
    return sourceTransactions((Map<String, Object>) null, (RequestOptions) null);
×
348
  }
349

350
  /** List source transactions for a given source. */
351
  public SourceTransactionCollection sourceTransactions(Map<String, Object> params)
352
      throws StripeException {
353
    return sourceTransactions(params, (RequestOptions) null);
1✔
354
  }
355

356
  /** List source transactions for a given source. */
357
  public SourceTransactionCollection sourceTransactions(
358
      Map<String, Object> params, RequestOptions options) throws StripeException {
359
    String path =
1✔
360
        String.format("/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(this.getId()));
1✔
361
    ApiRequest request =
1✔
362
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
363
    return getResponseGetter().request(request, SourceTransactionCollection.class);
1✔
364
  }
365

366
  /** List source transactions for a given source. */
367
  public SourceTransactionCollection sourceTransactions(SourceSourceTransactionsParams params)
368
      throws StripeException {
369
    return sourceTransactions(params, (RequestOptions) null);
×
370
  }
371

372
  /** List source transactions for a given source. */
373
  public SourceTransactionCollection sourceTransactions(
374
      SourceSourceTransactionsParams params, RequestOptions options) throws StripeException {
375
    String path =
×
376
        String.format("/v1/sources/%s/source_transactions", ApiResource.urlEncodeId(this.getId()));
×
377
    ApiResource.checkNullTypedParams(path, params);
×
378
    ApiRequest request =
×
379
        new ApiRequest(
380
            BaseAddress.API,
381
            ApiResource.RequestMethod.GET,
382
            path,
383
            ApiRequestParams.paramsToMap(params),
×
384
            options);
UNCOV
385
    return getResponseGetter().request(request, SourceTransactionCollection.class);
×
386
  }
387

388
  /**
389
   * Updates the specified source by setting the values of the parameters passed. Any parameters not
390
   * provided will be left unchanged.
391
   *
392
   * <p>This request accepts the {@code metadata} and {@code owner} as arguments. It is also
393
   * possible to update type specific information for selected payment methods. Please refer to our
394
   * <a href="https://stripe.com/docs/sources">payment method guides</a> for more detail.
395
   */
396
  @Override
397
  public Source update(Map<String, Object> params) throws StripeException {
398
    return update(params, (RequestOptions) null);
1✔
399
  }
400

401
  /**
402
   * Updates the specified source by setting the values of the parameters passed. Any parameters not
403
   * provided will be left unchanged.
404
   *
405
   * <p>This request accepts the {@code metadata} and {@code owner} as arguments. It is also
406
   * possible to update type specific information for selected payment methods. Please refer to our
407
   * <a href="https://stripe.com/docs/sources">payment method guides</a> for more detail.
408
   */
409
  @Override
410
  public Source update(Map<String, Object> params, RequestOptions options) throws StripeException {
411
    String path = String.format("/v1/sources/%s", ApiResource.urlEncodeId(this.getId()));
1✔
412
    ApiRequest request =
1✔
413
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
414
    return getResponseGetter().request(request, Source.class);
1✔
415
  }
416

417
  /**
418
   * Updates the specified source by setting the values of the parameters passed. Any parameters not
419
   * provided will be left unchanged.
420
   *
421
   * <p>This request accepts the {@code metadata} and {@code owner} as arguments. It is also
422
   * possible to update type specific information for selected payment methods. Please refer to our
423
   * <a href="https://stripe.com/docs/sources">payment method guides</a> for more detail.
424
   */
425
  public Source update(SourceUpdateParams params) throws StripeException {
426
    return update(params, (RequestOptions) null);
1✔
427
  }
428

429
  /**
430
   * Updates the specified source by setting the values of the parameters passed. Any parameters not
431
   * provided will be left unchanged.
432
   *
433
   * <p>This request accepts the {@code metadata} and {@code owner} as arguments. It is also
434
   * possible to update type specific information for selected payment methods. Please refer to our
435
   * <a href="https://stripe.com/docs/sources">payment method guides</a> for more detail.
436
   */
437
  public Source update(SourceUpdateParams params, RequestOptions options) throws StripeException {
438
    String path = String.format("/v1/sources/%s", ApiResource.urlEncodeId(this.getId()));
1✔
439
    ApiResource.checkNullTypedParams(path, params);
1✔
440
    ApiRequest request =
1✔
441
        new ApiRequest(
442
            BaseAddress.API,
443
            ApiResource.RequestMethod.POST,
444
            path,
445
            ApiRequestParams.paramsToMap(params),
1✔
446
            options);
447
    return getResponseGetter().request(request, Source.class);
1✔
448
  }
449

450
  /** Verify a given source. */
451
  public Source verify(Map<String, Object> params) throws StripeException {
452
    return verify(params, (RequestOptions) null);
1✔
453
  }
454

455
  /** Verify a given source. */
456
  public Source verify(Map<String, Object> params, RequestOptions options) throws StripeException {
457
    String path = String.format("/v1/sources/%s/verify", ApiResource.urlEncodeId(this.getId()));
1✔
458
    ApiRequest request =
1✔
459
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
460
    return getResponseGetter().request(request, Source.class);
1✔
461
  }
462

463
  /** Verify a given source. */
464
  public Source verify(SourceVerifyParams params) throws StripeException {
465
    return verify(params, (RequestOptions) null);
×
466
  }
467

468
  /** Verify a given source. */
469
  public Source verify(SourceVerifyParams params, RequestOptions options) throws StripeException {
470
    String path = String.format("/v1/sources/%s/verify", ApiResource.urlEncodeId(this.getId()));
×
471
    ApiResource.checkNullTypedParams(path, params);
×
472
    ApiRequest request =
×
473
        new ApiRequest(
474
            BaseAddress.API,
475
            ApiResource.RequestMethod.POST,
476
            path,
477
            ApiRequestParams.paramsToMap(params),
×
478
            options);
UNCOV
479
    return getResponseGetter().request(request, Source.class);
×
480
  }
481

482
  @Getter
483
  @Setter
484
  @EqualsAndHashCode(callSuper = false)
485
  public static class AchCreditTransfer extends StripeObject {
1✔
486
    @SerializedName("account_number")
487
    String accountNumber;
488

489
    @SerializedName("bank_name")
490
    String bankName;
491

492
    @SerializedName("fingerprint")
493
    String fingerprint;
494

495
    @SerializedName("refund_account_holder_name")
496
    String refundAccountHolderName;
497

498
    @SerializedName("refund_account_holder_type")
499
    String refundAccountHolderType;
500

501
    @SerializedName("refund_routing_number")
502
    String refundRoutingNumber;
503

504
    @SerializedName("routing_number")
505
    String routingNumber;
506

507
    @SerializedName("swift_code")
508
    String swiftCode;
509
  }
510

511
  @Getter
512
  @Setter
513
  @EqualsAndHashCode(callSuper = false)
514
  public static class AchDebit extends StripeObject {
1✔
515
    @SerializedName("bank_name")
516
    String bankName;
517

518
    @SerializedName("country")
519
    String country;
520

521
    @SerializedName("fingerprint")
522
    String fingerprint;
523

524
    @SerializedName("last4")
525
    String last4;
526

527
    @SerializedName("routing_number")
528
    String routingNumber;
529

530
    @SerializedName("type")
531
    String type;
532
  }
533

534
  @Getter
535
  @Setter
536
  @EqualsAndHashCode(callSuper = false)
537
  public static class AcssDebit extends StripeObject {
×
538
    @SerializedName("bank_address_city")
539
    String bankAddressCity;
540

541
    @SerializedName("bank_address_line_1")
542
    String bankAddressLine1;
543

544
    @SerializedName("bank_address_line_2")
545
    String bankAddressLine2;
546

547
    @SerializedName("bank_address_postal_code")
548
    String bankAddressPostalCode;
549

550
    @SerializedName("bank_name")
551
    String bankName;
552

553
    @SerializedName("category")
554
    String category;
555

556
    @SerializedName("country")
557
    String country;
558

559
    @SerializedName("fingerprint")
560
    String fingerprint;
561

562
    @SerializedName("last4")
563
    String last4;
564

565
    @SerializedName("routing_number")
566
    String routingNumber;
567
  }
568

569
  @Getter
570
  @Setter
571
  @EqualsAndHashCode(callSuper = false)
572
  public static class Alipay extends StripeObject {
×
573
    @SerializedName("data_string")
574
    String dataString;
575

576
    @SerializedName("native_url")
577
    String nativeUrl;
578

579
    @SerializedName("statement_descriptor")
580
    String statementDescriptor;
581
  }
582

583
  @Getter
584
  @Setter
585
  @EqualsAndHashCode(callSuper = false)
586
  public static class AuBecsDebit extends StripeObject {
×
587
    @SerializedName("bsb_number")
588
    String bsbNumber;
589

590
    @SerializedName("fingerprint")
591
    String fingerprint;
592

593
    @SerializedName("last4")
594
    String last4;
595
  }
596

597
  @Getter
598
  @Setter
599
  @EqualsAndHashCode(callSuper = false)
600
  public static class Bancontact extends StripeObject {
×
601
    @SerializedName("bank_code")
602
    String bankCode;
603

604
    @SerializedName("bank_name")
605
    String bankName;
606

607
    @SerializedName("bic")
608
    String bic;
609

610
    @SerializedName("iban_last4")
611
    String ibanLast4;
612

613
    @SerializedName("preferred_language")
614
    String preferredLanguage;
615

616
    @SerializedName("statement_descriptor")
617
    String statementDescriptor;
618
  }
619

620
  @Getter
621
  @Setter
622
  @EqualsAndHashCode(callSuper = false)
623
  public static class Card extends StripeObject {
×
624
    @SerializedName("address_line1_check")
625
    String addressLine1Check;
626

627
    @SerializedName("address_zip_check")
628
    String addressZipCheck;
629

630
    @SerializedName("brand")
631
    String brand;
632

633
    @SerializedName("country")
634
    String country;
635

636
    @SerializedName("cvc_check")
637
    String cvcCheck;
638

639
    @SerializedName("description")
640
    String description;
641

642
    @SerializedName("dynamic_last4")
643
    String dynamicLast4;
644

645
    @SerializedName("exp_month")
646
    Long expMonth;
647

648
    @SerializedName("exp_year")
649
    Long expYear;
650

651
    @SerializedName("fingerprint")
652
    String fingerprint;
653

654
    @SerializedName("funding")
655
    String funding;
656

657
    @SerializedName("iin")
658
    String iin;
659

660
    @SerializedName("issuer")
661
    String issuer;
662

663
    @SerializedName("last4")
664
    String last4;
665

666
    @SerializedName("name")
667
    String name;
668

669
    @SerializedName("three_d_secure")
670
    String threeDSecure;
671

672
    @SerializedName("tokenization_method")
673
    String tokenizationMethod;
674
  }
675

676
  @Getter
677
  @Setter
678
  @EqualsAndHashCode(callSuper = false)
679
  public static class CardPresent extends StripeObject {
×
680
    @SerializedName("application_cryptogram")
681
    String applicationCryptogram;
682

683
    @SerializedName("application_preferred_name")
684
    String applicationPreferredName;
685

686
    @SerializedName("authorization_code")
687
    String authorizationCode;
688

689
    @SerializedName("authorization_response_code")
690
    String authorizationResponseCode;
691

692
    @SerializedName("brand")
693
    String brand;
694

695
    @SerializedName("country")
696
    String country;
697

698
    @SerializedName("cvm_type")
699
    String cvmType;
700

701
    @SerializedName("data_type")
702
    String dataType;
703

704
    @SerializedName("dedicated_file_name")
705
    String dedicatedFileName;
706

707
    @SerializedName("description")
708
    String description;
709

710
    @SerializedName("emv_auth_data")
711
    String emvAuthData;
712

713
    @SerializedName("evidence_customer_signature")
714
    String evidenceCustomerSignature;
715

716
    @SerializedName("evidence_transaction_certificate")
717
    String evidenceTransactionCertificate;
718

719
    @SerializedName("exp_month")
720
    Long expMonth;
721

722
    @SerializedName("exp_year")
723
    Long expYear;
724

725
    @SerializedName("fingerprint")
726
    String fingerprint;
727

728
    @SerializedName("funding")
729
    String funding;
730

731
    @SerializedName("iin")
732
    String iin;
733

734
    @SerializedName("issuer")
735
    String issuer;
736

737
    @SerializedName("last4")
738
    String last4;
739

740
    @SerializedName("pos_device_id")
741
    String posDeviceId;
742

743
    @SerializedName("pos_entry_mode")
744
    String posEntryMode;
745

746
    @SerializedName("read_method")
747
    String readMethod;
748

749
    @SerializedName("reader")
750
    String reader;
751

752
    @SerializedName("terminal_verification_results")
753
    String terminalVerificationResults;
754

755
    @SerializedName("transaction_status_information")
756
    String transactionStatusInformation;
757
  }
758

759
  @Getter
760
  @Setter
761
  @EqualsAndHashCode(callSuper = false)
762
  public static class CodeVerification extends StripeObject {
×
763
    /**
764
     * The number of attempts remaining to authenticate the source object with a verification code.
765
     */
766
    @SerializedName("attempts_remaining")
767
    Long attemptsRemaining;
768

769
    /**
770
     * The status of the code verification, either {@code pending} (awaiting verification, {@code
771
     * attempts_remaining} should be greater than 0), {@code succeeded} (successful verification) or
772
     * {@code failed} (failed verification, cannot be verified anymore as {@code attempts_remaining}
773
     * should be 0).
774
     */
775
    @SerializedName("status")
776
    String status;
777
  }
778

779
  @Getter
780
  @Setter
781
  @EqualsAndHashCode(callSuper = false)
782
  public static class Eps extends StripeObject {
×
783
    @SerializedName("reference")
784
    String reference;
785

786
    @SerializedName("statement_descriptor")
787
    String statementDescriptor;
788
  }
789

790
  @Getter
791
  @Setter
792
  @EqualsAndHashCode(callSuper = false)
793
  public static class Giropay extends StripeObject {
×
794
    @SerializedName("bank_code")
795
    String bankCode;
796

797
    @SerializedName("bank_name")
798
    String bankName;
799

800
    @SerializedName("bic")
801
    String bic;
802

803
    @SerializedName("statement_descriptor")
804
    String statementDescriptor;
805
  }
806

807
  @Getter
808
  @Setter
809
  @EqualsAndHashCode(callSuper = false)
810
  public static class Ideal extends StripeObject {
×
811
    @SerializedName("bank")
812
    String bank;
813

814
    @SerializedName("bic")
815
    String bic;
816

817
    @SerializedName("iban_last4")
818
    String ibanLast4;
819

820
    @SerializedName("statement_descriptor")
821
    String statementDescriptor;
822
  }
823

824
  @Getter
825
  @Setter
826
  @EqualsAndHashCode(callSuper = false)
827
  public static class Klarna extends StripeObject {
×
828
    @SerializedName("background_image_url")
829
    String backgroundImageUrl;
830

831
    @SerializedName("client_token")
832
    String clientToken;
833

834
    @SerializedName("first_name")
835
    String firstName;
836

837
    @SerializedName("last_name")
838
    String lastName;
839

840
    @SerializedName("locale")
841
    String locale;
842

843
    @SerializedName("logo_url")
844
    String logoUrl;
845

846
    @SerializedName("page_title")
847
    String pageTitle;
848

849
    @SerializedName("pay_later_asset_urls_descriptive")
850
    String payLaterAssetUrlsDescriptive;
851

852
    @SerializedName("pay_later_asset_urls_standard")
853
    String payLaterAssetUrlsStandard;
854

855
    @SerializedName("pay_later_name")
856
    String payLaterName;
857

858
    @SerializedName("pay_later_redirect_url")
859
    String payLaterRedirectUrl;
860

861
    @SerializedName("pay_now_asset_urls_descriptive")
862
    String payNowAssetUrlsDescriptive;
863

864
    @SerializedName("pay_now_asset_urls_standard")
865
    String payNowAssetUrlsStandard;
866

867
    @SerializedName("pay_now_name")
868
    String payNowName;
869

870
    @SerializedName("pay_now_redirect_url")
871
    String payNowRedirectUrl;
872

873
    @SerializedName("pay_over_time_asset_urls_descriptive")
874
    String payOverTimeAssetUrlsDescriptive;
875

876
    @SerializedName("pay_over_time_asset_urls_standard")
877
    String payOverTimeAssetUrlsStandard;
878

879
    @SerializedName("pay_over_time_name")
880
    String payOverTimeName;
881

882
    @SerializedName("pay_over_time_redirect_url")
883
    String payOverTimeRedirectUrl;
884

885
    @SerializedName("payment_method_categories")
886
    String paymentMethodCategories;
887

888
    @SerializedName("purchase_country")
889
    String purchaseCountry;
890

891
    @SerializedName("purchase_type")
892
    String purchaseType;
893

894
    @SerializedName("redirect_url")
895
    String redirectUrl;
896

897
    @SerializedName("shipping_delay")
898
    Long shippingDelay;
899

900
    @SerializedName("shipping_first_name")
901
    String shippingFirstName;
902

903
    @SerializedName("shipping_last_name")
904
    String shippingLastName;
905
  }
906

907
  @Getter
908
  @Setter
909
  @EqualsAndHashCode(callSuper = false)
910
  public static class Multibanco extends StripeObject {
×
911
    @SerializedName("entity")
912
    String entity;
913

914
    @SerializedName("reference")
915
    String reference;
916

917
    @SerializedName("refund_account_holder_address_city")
918
    String refundAccountHolderAddressCity;
919

920
    @SerializedName("refund_account_holder_address_country")
921
    String refundAccountHolderAddressCountry;
922

923
    @SerializedName("refund_account_holder_address_line1")
924
    String refundAccountHolderAddressLine1;
925

926
    @SerializedName("refund_account_holder_address_line2")
927
    String refundAccountHolderAddressLine2;
928

929
    @SerializedName("refund_account_holder_address_postal_code")
930
    String refundAccountHolderAddressPostalCode;
931

932
    @SerializedName("refund_account_holder_address_state")
933
    String refundAccountHolderAddressState;
934

935
    @SerializedName("refund_account_holder_name")
936
    String refundAccountHolderName;
937

938
    @SerializedName("refund_iban")
939
    String refundIban;
940
  }
941

942
  @Getter
943
  @Setter
944
  @EqualsAndHashCode(callSuper = false)
945
  public static class Owner extends StripeObject {
1✔
946
    /** Owner's address. */
947
    @SerializedName("address")
948
    Address address;
949

950
    /** Owner's email address. */
951
    @SerializedName("email")
952
    String email;
953

954
    /** Owner's full name. */
955
    @SerializedName("name")
956
    String name;
957

958
    /** Owner's phone number (including extension). */
959
    @SerializedName("phone")
960
    String phone;
961

962
    /**
963
     * Verified owner's address. Verified values are verified or provided by the payment method
964
     * directly (and if supported) at the time of authorization or settlement. They cannot be set or
965
     * mutated.
966
     */
967
    @SerializedName("verified_address")
968
    Address verifiedAddress;
969

970
    /**
971
     * Verified owner's email address. Verified values are verified or provided by the payment
972
     * method directly (and if supported) at the time of authorization or settlement. They cannot be
973
     * set or mutated.
974
     */
975
    @SerializedName("verified_email")
976
    String verifiedEmail;
977

978
    /**
979
     * Verified owner's full name. Verified values are verified or provided by the payment method
980
     * directly (and if supported) at the time of authorization or settlement. They cannot be set or
981
     * mutated.
982
     */
983
    @SerializedName("verified_name")
984
    String verifiedName;
985

986
    /**
987
     * Verified owner's phone number (including extension). Verified values are verified or provided
988
     * by the payment method directly (and if supported) at the time of authorization or settlement.
989
     * They cannot be set or mutated.
990
     */
991
    @SerializedName("verified_phone")
992
    String verifiedPhone;
993
  }
994

995
  @Getter
996
  @Setter
997
  @EqualsAndHashCode(callSuper = false)
998
  public static class P24 extends StripeObject {
×
999
    @SerializedName("reference")
1000
    String reference;
1001
  }
1002

1003
  @Getter
1004
  @Setter
1005
  @EqualsAndHashCode(callSuper = false)
1006
  public static class Paypal extends StripeObject {
×
1007
    @SerializedName("billing_agreement")
1008
    String billingAgreement;
1009

1010
    @SerializedName("fingerprint")
1011
    String fingerprint;
1012

1013
    @SerializedName("payer_id")
1014
    String payerId;
1015

1016
    @SerializedName("reference_id")
1017
    String referenceId;
1018

1019
    @SerializedName("reference_transaction_amount")
1020
    String referenceTransactionAmount;
1021

1022
    @SerializedName("reference_transaction_charged")
1023
    Boolean referenceTransactionCharged;
1024

1025
    @SerializedName("statement_descriptor")
1026
    String statementDescriptor;
1027

1028
    @SerializedName("transaction_id")
1029
    String transactionId;
1030

1031
    @SerializedName("verified_email")
1032
    String verifiedEmail;
1033
  }
1034

1035
  @Getter
1036
  @Setter
1037
  @EqualsAndHashCode(callSuper = false)
1038
  public static class Receiver extends StripeObject {
1✔
1039
    /**
1040
     * The address of the receiver source. This is the value that should be communicated to the
1041
     * customer to send their funds to.
1042
     */
1043
    @SerializedName("address")
1044
    String address;
1045

1046
    /**
1047
     * The total amount that was moved to your balance. This is almost always equal to the amount
1048
     * charged. In rare cases when customers deposit excess funds and we are unable to refund those,
1049
     * those funds get moved to your balance and show up in amount_charged as well. The amount
1050
     * charged is expressed in the source's currency.
1051
     */
1052
    @SerializedName("amount_charged")
1053
    Long amountCharged;
1054

1055
    /**
1056
     * The total amount received by the receiver source. {@code amount_received = amount_returned +
1057
     * amount_charged} should be true for consumed sources unless customers deposit excess funds.
1058
     * The amount received is expressed in the source's currency.
1059
     */
1060
    @SerializedName("amount_received")
1061
    Long amountReceived;
1062

1063
    /**
1064
     * The total amount that was returned to the customer. The amount returned is expressed in the
1065
     * source's currency.
1066
     */
1067
    @SerializedName("amount_returned")
1068
    Long amountReturned;
1069

1070
    /** Type of refund attribute method, one of {@code email}, {@code manual}, or {@code none}. */
1071
    @SerializedName("refund_attributes_method")
1072
    String refundAttributesMethod;
1073

1074
    /**
1075
     * Type of refund attribute status, one of {@code missing}, {@code requested}, or {@code
1076
     * available}.
1077
     */
1078
    @SerializedName("refund_attributes_status")
1079
    String refundAttributesStatus;
1080
  }
1081

1082
  @Getter
1083
  @Setter
1084
  @EqualsAndHashCode(callSuper = false)
1085
  public static class Redirect extends StripeObject {
×
1086
    /**
1087
     * The failure reason for the redirect, either {@code user_abort} (the customer aborted or
1088
     * dropped out of the redirect flow), {@code declined} (the authentication failed or the
1089
     * transaction was declined), or {@code processing_error} (the redirect failed due to a
1090
     * technical error). Present only if the redirect status is {@code failed}.
1091
     */
1092
    @SerializedName("failure_reason")
1093
    String failureReason;
1094

1095
    /** The URL you provide to redirect the customer to after they authenticated their payment. */
1096
    @SerializedName("return_url")
1097
    String returnUrl;
1098

1099
    /**
1100
     * The status of the redirect, either {@code pending} (ready to be used by your customer to
1101
     * authenticate the transaction), {@code succeeded} (succesful authentication, cannot be reused)
1102
     * or {@code not_required} (redirect should not be used) or {@code failed} (failed
1103
     * authentication, cannot be reused).
1104
     */
1105
    @SerializedName("status")
1106
    String status;
1107

1108
    /**
1109
     * The URL provided to you to redirect a customer to as part of a {@code redirect}
1110
     * authentication flow.
1111
     */
1112
    @SerializedName("url")
1113
    String url;
1114
  }
1115

1116
  @Getter
1117
  @Setter
1118
  @EqualsAndHashCode(callSuper = false)
1119
  public static class SepaCreditTransfer extends StripeObject {
×
1120
    @SerializedName("bank_name")
1121
    String bankName;
1122

1123
    @SerializedName("bic")
1124
    String bic;
1125

1126
    @SerializedName("iban")
1127
    String iban;
1128

1129
    @SerializedName("refund_account_holder_address_city")
1130
    String refundAccountHolderAddressCity;
1131

1132
    @SerializedName("refund_account_holder_address_country")
1133
    String refundAccountHolderAddressCountry;
1134

1135
    @SerializedName("refund_account_holder_address_line1")
1136
    String refundAccountHolderAddressLine1;
1137

1138
    @SerializedName("refund_account_holder_address_line2")
1139
    String refundAccountHolderAddressLine2;
1140

1141
    @SerializedName("refund_account_holder_address_postal_code")
1142
    String refundAccountHolderAddressPostalCode;
1143

1144
    @SerializedName("refund_account_holder_address_state")
1145
    String refundAccountHolderAddressState;
1146

1147
    @SerializedName("refund_account_holder_name")
1148
    String refundAccountHolderName;
1149

1150
    @SerializedName("refund_iban")
1151
    String refundIban;
1152
  }
1153

1154
  @Getter
1155
  @Setter
1156
  @EqualsAndHashCode(callSuper = false)
1157
  public static class SepaDebit extends StripeObject {
1✔
1158
    @SerializedName("bank_code")
1159
    String bankCode;
1160

1161
    @SerializedName("branch_code")
1162
    String branchCode;
1163

1164
    @SerializedName("country")
1165
    String country;
1166

1167
    @SerializedName("fingerprint")
1168
    String fingerprint;
1169

1170
    @SerializedName("last4")
1171
    String last4;
1172

1173
    @SerializedName("mandate_reference")
1174
    String mandateReference;
1175

1176
    @SerializedName("mandate_url")
1177
    String mandateUrl;
1178
  }
1179

1180
  @Getter
1181
  @Setter
1182
  @EqualsAndHashCode(callSuper = false)
1183
  public static class Sofort extends StripeObject {
×
1184
    @SerializedName("bank_code")
1185
    String bankCode;
1186

1187
    @SerializedName("bank_name")
1188
    String bankName;
1189

1190
    @SerializedName("bic")
1191
    String bic;
1192

1193
    @SerializedName("country")
1194
    String country;
1195

1196
    @SerializedName("iban_last4")
1197
    String ibanLast4;
1198

1199
    @SerializedName("preferred_language")
1200
    String preferredLanguage;
1201

1202
    @SerializedName("statement_descriptor")
1203
    String statementDescriptor;
1204
  }
1205

1206
  @Getter
1207
  @Setter
1208
  @EqualsAndHashCode(callSuper = false)
1209
  public static class SourceOrder extends StripeObject {
×
1210
    /**
1211
     * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1,
1212
     * Japanese Yen being a zero-decimal currency) representing the total amount for the order.
1213
     */
1214
    @SerializedName("amount")
1215
    Long amount;
1216

1217
    /**
1218
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1219
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1220
     * currency</a>.
1221
     */
1222
    @SerializedName("currency")
1223
    String currency;
1224

1225
    /** The email address of the customer placing the order. */
1226
    @SerializedName("email")
1227
    String email;
1228

1229
    /** List of items constituting the order. */
1230
    @SerializedName("items")
1231
    List<Source.SourceOrder.Item> items;
1232

1233
    @SerializedName("shipping")
1234
    ShippingDetails shipping;
1235

1236
    @Getter
1237
    @Setter
1238
    @EqualsAndHashCode(callSuper = false)
1239
    public static class Item extends StripeObject {
×
1240
      /** The amount (price) for this order item. */
1241
      @SerializedName("amount")
1242
      Long amount;
1243

1244
      /** This currency of this order item. Required when {@code amount} is present. */
1245
      @SerializedName("currency")
1246
      String currency;
1247

1248
      /** Human-readable description for this order item. */
1249
      @SerializedName("description")
1250
      String description;
1251

1252
      /**
1253
       * The ID of the associated object for this line item. Expandable if not null (e.g.,
1254
       * expandable to a SKU).
1255
       */
1256
      @SerializedName("parent")
1257
      String parent;
1258

1259
      /**
1260
       * The quantity of this order item. When type is {@code sku}, this is the number of instances
1261
       * of the SKU to be ordered.
1262
       */
1263
      @SerializedName("quantity")
1264
      Long quantity;
1265

1266
      /** The type of this order item. Must be {@code sku}, {@code tax}, or {@code shipping}. */
1267
      @SerializedName("type")
1268
      String type;
1269
    }
1270
  }
1271

1272
  @Getter
1273
  @Setter
1274
  @EqualsAndHashCode(callSuper = false)
1275
  public static class ThreeDSecure extends StripeObject {
×
1276
    @SerializedName("address_line1_check")
1277
    String addressLine1Check;
1278

1279
    @SerializedName("address_zip_check")
1280
    String addressZipCheck;
1281

1282
    @SerializedName("authenticated")
1283
    Boolean authenticated;
1284

1285
    @SerializedName("brand")
1286
    String brand;
1287

1288
    @SerializedName("card")
1289
    String card;
1290

1291
    @SerializedName("country")
1292
    String country;
1293

1294
    @SerializedName("customer")
1295
    String customer;
1296

1297
    @SerializedName("cvc_check")
1298
    String cvcCheck;
1299

1300
    @SerializedName("description")
1301
    String description;
1302

1303
    @SerializedName("dynamic_last4")
1304
    String dynamicLast4;
1305

1306
    @SerializedName("exp_month")
1307
    Long expMonth;
1308

1309
    @SerializedName("exp_year")
1310
    Long expYear;
1311

1312
    @SerializedName("fingerprint")
1313
    String fingerprint;
1314

1315
    @SerializedName("funding")
1316
    String funding;
1317

1318
    @SerializedName("iin")
1319
    String iin;
1320

1321
    @SerializedName("issuer")
1322
    String issuer;
1323

1324
    @SerializedName("last4")
1325
    String last4;
1326

1327
    @SerializedName("name")
1328
    String name;
1329

1330
    @SerializedName("three_d_secure")
1331
    String threeDSecure;
1332

1333
    @SerializedName("tokenization_method")
1334
    String tokenizationMethod;
1335
  }
1336

1337
  @Getter
1338
  @Setter
1339
  @EqualsAndHashCode(callSuper = false)
1340
  public static class Wechat extends StripeObject {
×
1341
    @SerializedName("prepay_id")
1342
    String prepayId;
1343

1344
    @SerializedName("qr_code_url")
1345
    String qrCodeUrl;
1346

1347
    @SerializedName("statement_descriptor")
1348
    String statementDescriptor;
1349
  }
1350

1351
  @Override
1352
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1353
    super.setResponseGetter(responseGetter);
1✔
1354
    trySetResponseGetter(achCreditTransfer, responseGetter);
1✔
1355
    trySetResponseGetter(achDebit, responseGetter);
1✔
1356
    trySetResponseGetter(acssDebit, responseGetter);
1✔
1357
    trySetResponseGetter(alipay, responseGetter);
1✔
1358
    trySetResponseGetter(auBecsDebit, responseGetter);
1✔
1359
    trySetResponseGetter(bancontact, responseGetter);
1✔
1360
    trySetResponseGetter(card, responseGetter);
1✔
1361
    trySetResponseGetter(cardPresent, responseGetter);
1✔
1362
    trySetResponseGetter(codeVerification, responseGetter);
1✔
1363
    trySetResponseGetter(eps, responseGetter);
1✔
1364
    trySetResponseGetter(giropay, responseGetter);
1✔
1365
    trySetResponseGetter(ideal, responseGetter);
1✔
1366
    trySetResponseGetter(klarna, responseGetter);
1✔
1367
    trySetResponseGetter(multibanco, responseGetter);
1✔
1368
    trySetResponseGetter(owner, responseGetter);
1✔
1369
    trySetResponseGetter(p24, responseGetter);
1✔
1370
    trySetResponseGetter(paypal, responseGetter);
1✔
1371
    trySetResponseGetter(receiver, responseGetter);
1✔
1372
    trySetResponseGetter(redirect, responseGetter);
1✔
1373
    trySetResponseGetter(sepaCreditTransfer, responseGetter);
1✔
1374
    trySetResponseGetter(sepaDebit, responseGetter);
1✔
1375
    trySetResponseGetter(sofort, responseGetter);
1✔
1376
    trySetResponseGetter(sourceOrder, responseGetter);
1✔
1377
    trySetResponseGetter(threeDSecure, responseGetter);
1✔
1378
    trySetResponseGetter(wechat, responseGetter);
1✔
1379
  }
1✔
1380
}
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