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

stripe / stripe-java / #16517

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

push

github

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

Update generated code for beta

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

91 existing lines in 27 files now uncovered.

18753 of 147196 relevant lines covered (12.74%)

0.13 hits per line

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

52.17
/src/main/java/com/stripe/model/issuing/Card.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.issuing;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.Address;
7
import com.stripe.model.ExpandableField;
8
import com.stripe.model.HasId;
9
import com.stripe.model.MetadataStore;
10
import com.stripe.model.StripeObject;
11
import com.stripe.net.ApiRequest;
12
import com.stripe.net.ApiRequestParams;
13
import com.stripe.net.ApiResource;
14
import com.stripe.net.BaseAddress;
15
import com.stripe.net.RequestOptions;
16
import com.stripe.net.StripeResponseGetter;
17
import com.stripe.param.issuing.CardCreateParams;
18
import com.stripe.param.issuing.CardDeliverCardParams;
19
import com.stripe.param.issuing.CardFailCardParams;
20
import com.stripe.param.issuing.CardListParams;
21
import com.stripe.param.issuing.CardRetrieveParams;
22
import com.stripe.param.issuing.CardReturnCardParams;
23
import com.stripe.param.issuing.CardShipCardParams;
24
import com.stripe.param.issuing.CardSubmitCardParams;
25
import com.stripe.param.issuing.CardUpdateParams;
26
import java.util.List;
27
import java.util.Map;
28
import lombok.EqualsAndHashCode;
29
import lombok.Getter;
30
import lombok.Setter;
31

32
/**
33
 * You can <a href="https://stripe.com/docs/issuing/cards">create physical or virtual cards</a> that
34
 * are issued to cardholders.
35
 */
36
@Getter
37
@Setter
38
@EqualsAndHashCode(callSuper = false)
39
public class Card extends ApiResource implements HasId, MetadataStore<Card> {
1✔
40
  /** The brand of the card. */
41
  @SerializedName("brand")
42
  String brand;
43

44
  /**
45
   * The reason why the card was canceled.
46
   *
47
   * <p>One of {@code design_rejected}, {@code lost}, or {@code stolen}.
48
   */
49
  @SerializedName("cancellation_reason")
50
  String cancellationReason;
51

52
  /**
53
   * An Issuing {@code Cardholder} object represents an individual or business entity who is <a
54
   * href="https://stripe.com/docs/issuing">issued</a> cards.
55
   *
56
   * <p>Related guide: <a href="https://stripe.com/docs/issuing/cards#create-cardholder">How to
57
   * create a cardholder</a>
58
   */
59
  @SerializedName("cardholder")
60
  Cardholder cardholder;
61

62
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
63
  @SerializedName("created")
64
  Long created;
65

66
  /**
67
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
68
   * in lowercase. Supported currencies are {@code usd} in the US, {@code eur} in the EU, and {@code
69
   * gbp} in the UK.
70
   */
71
  @SerializedName("currency")
72
  String currency;
73

74
  /**
75
   * The card's CVC. For security reasons, this is only available for virtual cards, and will be
76
   * omitted unless you explicitly request it with <a
77
   * href="https://stripe.com/docs/api/expanding_objects">the {@code expand} parameter</a>.
78
   * Additionally, it's only available via the <a
79
   * href="https://stripe.com/docs/api/issuing/cards/retrieve">&quot;Retrieve a card&quot;
80
   * endpoint</a>, not via &quot;List all cards&quot; or any other endpoint.
81
   */
82
  @SerializedName("cvc")
83
  String cvc;
84

85
  /** The expiration month of the card. */
86
  @SerializedName("exp_month")
87
  Long expMonth;
88

89
  /** The expiration year of the card. */
90
  @SerializedName("exp_year")
91
  Long expYear;
92

93
  /** The financial account this card is attached to. */
94
  @SerializedName("financial_account")
95
  String financialAccount;
96

97
  /** Unique identifier for the object. */
98
  @Getter(onMethod_ = {@Override})
99
  @SerializedName("id")
100
  String id;
101

102
  /** The last 4 digits of the card number. */
103
  @SerializedName("last4")
104
  String last4;
105

106
  /**
107
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
108
   * object exists in test mode.
109
   */
110
  @SerializedName("livemode")
111
  Boolean livemode;
112

113
  /**
114
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
115
   * to an object. This can be useful for storing additional information about the object in a
116
   * structured format.
117
   */
118
  @Getter(onMethod_ = {@Override})
119
  @SerializedName("metadata")
120
  Map<String, String> metadata;
121

122
  /**
123
   * The full unredacted card number. For security reasons, this is only available for virtual
124
   * cards, and will be omitted unless you explicitly request it with <a
125
   * href="https://stripe.com/docs/api/expanding_objects">the {@code expand} parameter</a>.
126
   * Additionally, it's only available via the <a
127
   * href="https://stripe.com/docs/api/issuing/cards/retrieve">&quot;Retrieve a card&quot;
128
   * endpoint</a>, not via &quot;List all cards&quot; or any other endpoint.
129
   */
130
  @SerializedName("number")
131
  String number;
132

133
  /**
134
   * String representing the object's type. Objects of the same type share the same value.
135
   *
136
   * <p>Equal to {@code issuing.card}.
137
   */
138
  @SerializedName("object")
139
  String object;
140

141
  /** The personalization design object belonging to this card. */
142
  @SerializedName("personalization_design")
143
  @Getter(lombok.AccessLevel.NONE)
144
  @Setter(lombok.AccessLevel.NONE)
145
  ExpandableField<PersonalizationDesign> personalizationDesign;
146

147
  /** The latest card that replaces this card, if any. */
148
  @SerializedName("replaced_by")
149
  @Getter(lombok.AccessLevel.NONE)
150
  @Setter(lombok.AccessLevel.NONE)
151
  ExpandableField<Card> replacedBy;
152

153
  /** The card this card replaces, if any. */
154
  @SerializedName("replacement_for")
155
  @Getter(lombok.AccessLevel.NONE)
156
  @Setter(lombok.AccessLevel.NONE)
157
  ExpandableField<Card> replacementFor;
158

159
  /**
160
   * The reason why the previous card needed to be replaced.
161
   *
162
   * <p>One of {@code damaged}, {@code expired}, {@code lost}, or {@code stolen}.
163
   */
164
  @SerializedName("replacement_reason")
165
  String replacementReason;
166

167
  /** Where and how the card will be shipped. */
168
  @SerializedName("shipping")
169
  Shipping shipping;
170

171
  @SerializedName("spending_controls")
172
  SpendingControls spendingControls;
173

174
  /**
175
   * Whether authorizations can be approved on this card. May be blocked from activating cards
176
   * depending on past-due Cardholder requirements. Defaults to {@code inactive}.
177
   *
178
   * <p>One of {@code active}, {@code canceled}, or {@code inactive}.
179
   */
180
  @SerializedName("status")
181
  String status;
182

183
  /**
184
   * The type of the card.
185
   *
186
   * <p>One of {@code physical}, or {@code virtual}.
187
   */
188
  @SerializedName("type")
189
  String type;
190

191
  /** Information relating to digital wallets (like Apple Pay and Google Pay). */
192
  @SerializedName("wallets")
193
  Wallets wallets;
194

195
  /** Get ID of expandable {@code personalizationDesign} object. */
196
  public String getPersonalizationDesign() {
197
    return (this.personalizationDesign != null) ? this.personalizationDesign.getId() : null;
×
198
  }
199

200
  public void setPersonalizationDesign(String id) {
201
    this.personalizationDesign = ApiResource.setExpandableFieldId(id, this.personalizationDesign);
×
202
  }
×
203

204
  /** Get expanded {@code personalizationDesign}. */
205
  public PersonalizationDesign getPersonalizationDesignObject() {
206
    return (this.personalizationDesign != null) ? this.personalizationDesign.getExpanded() : null;
×
207
  }
208

209
  public void setPersonalizationDesignObject(PersonalizationDesign expandableObject) {
210
    this.personalizationDesign =
×
211
        new ExpandableField<PersonalizationDesign>(expandableObject.getId(), expandableObject);
×
212
  }
×
213

214
  /** Get ID of expandable {@code replacedBy} object. */
215
  public String getReplacedBy() {
216
    return (this.replacedBy != null) ? this.replacedBy.getId() : null;
×
217
  }
218

219
  public void setReplacedBy(String id) {
220
    this.replacedBy = ApiResource.setExpandableFieldId(id, this.replacedBy);
×
221
  }
×
222

223
  /** Get expanded {@code replacedBy}. */
224
  public Card getReplacedByObject() {
225
    return (this.replacedBy != null) ? this.replacedBy.getExpanded() : null;
×
226
  }
227

228
  public void setReplacedByObject(Card expandableObject) {
229
    this.replacedBy = new ExpandableField<Card>(expandableObject.getId(), expandableObject);
×
230
  }
×
231

232
  /** Get ID of expandable {@code replacementFor} object. */
233
  public String getReplacementFor() {
234
    return (this.replacementFor != null) ? this.replacementFor.getId() : null;
×
235
  }
236

237
  public void setReplacementFor(String id) {
238
    this.replacementFor = ApiResource.setExpandableFieldId(id, this.replacementFor);
×
239
  }
×
240

241
  /** Get expanded {@code replacementFor}. */
242
  public Card getReplacementForObject() {
243
    return (this.replacementFor != null) ? this.replacementFor.getExpanded() : null;
×
244
  }
245

246
  public void setReplacementForObject(Card expandableObject) {
247
    this.replacementFor = new ExpandableField<Card>(expandableObject.getId(), expandableObject);
×
248
  }
×
249

250
  /** Creates an Issuing {@code Card} object. */
251
  public static Card create(Map<String, Object> params) throws StripeException {
252
    return create(params, (RequestOptions) null);
1✔
253
  }
254

255
  /** Creates an Issuing {@code Card} object. */
256
  public static Card create(Map<String, Object> params, RequestOptions options)
257
      throws StripeException {
258
    String path = "/v1/issuing/cards";
1✔
259
    ApiRequest request =
1✔
260
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
261
    return getGlobalResponseGetter().request(request, Card.class);
1✔
262
  }
263

264
  /** Creates an Issuing {@code Card} object. */
265
  public static Card create(CardCreateParams params) throws StripeException {
266
    return create(params, (RequestOptions) null);
1✔
267
  }
268

269
  /** Creates an Issuing {@code Card} object. */
270
  public static Card create(CardCreateParams params, RequestOptions options)
271
      throws StripeException {
272
    String path = "/v1/issuing/cards";
1✔
273
    ApiResource.checkNullTypedParams(path, params);
1✔
274
    ApiRequest request =
1✔
275
        new ApiRequest(
276
            BaseAddress.API,
277
            ApiResource.RequestMethod.POST,
278
            path,
279
            ApiRequestParams.paramsToMap(params),
1✔
280
            options);
281
    return getGlobalResponseGetter().request(request, Card.class);
1✔
282
  }
283

284
  /**
285
   * Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
286
   * creation date, with the most recently created object appearing first.
287
   */
288
  public static CardCollection list(Map<String, Object> params) throws StripeException {
289
    return list(params, (RequestOptions) null);
1✔
290
  }
291

292
  /**
293
   * Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
294
   * creation date, with the most recently created object appearing first.
295
   */
296
  public static CardCollection list(Map<String, Object> params, RequestOptions options)
297
      throws StripeException {
298
    String path = "/v1/issuing/cards";
1✔
299
    ApiRequest request =
1✔
300
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
301
    return getGlobalResponseGetter().request(request, CardCollection.class);
1✔
302
  }
303

304
  /**
305
   * Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
306
   * creation date, with the most recently created object appearing first.
307
   */
308
  public static CardCollection list(CardListParams params) throws StripeException {
309
    return list(params, (RequestOptions) null);
1✔
310
  }
311

312
  /**
313
   * Returns a list of Issuing {@code Card} objects. The objects are sorted in descending order by
314
   * creation date, with the most recently created object appearing first.
315
   */
316
  public static CardCollection list(CardListParams params, RequestOptions options)
317
      throws StripeException {
318
    String path = "/v1/issuing/cards";
1✔
319
    ApiResource.checkNullTypedParams(path, params);
1✔
320
    ApiRequest request =
1✔
321
        new ApiRequest(
322
            BaseAddress.API,
323
            ApiResource.RequestMethod.GET,
324
            path,
325
            ApiRequestParams.paramsToMap(params),
1✔
326
            options);
327
    return getGlobalResponseGetter().request(request, CardCollection.class);
1✔
328
  }
329

330
  /** Retrieves an Issuing {@code Card} object. */
331
  public static Card retrieve(String card) throws StripeException {
332
    return retrieve(card, (Map<String, Object>) null, (RequestOptions) null);
1✔
333
  }
334

335
  /** Retrieves an Issuing {@code Card} object. */
336
  public static Card retrieve(String card, RequestOptions options) throws StripeException {
337
    return retrieve(card, (Map<String, Object>) null, options);
×
338
  }
339

340
  /** Retrieves an Issuing {@code Card} object. */
341
  public static Card retrieve(String card, Map<String, Object> params, RequestOptions options)
342
      throws StripeException {
343
    String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(card));
1✔
344
    ApiRequest request =
1✔
345
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
346
    return getGlobalResponseGetter().request(request, Card.class);
1✔
347
  }
348

349
  /** Retrieves an Issuing {@code Card} object. */
350
  public static Card retrieve(String card, CardRetrieveParams params, RequestOptions options)
351
      throws StripeException {
352
    String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(card));
×
353
    ApiResource.checkNullTypedParams(path, params);
×
354
    ApiRequest request =
×
355
        new ApiRequest(
356
            BaseAddress.API,
357
            ApiResource.RequestMethod.GET,
358
            path,
359
            ApiRequestParams.paramsToMap(params),
×
360
            options);
361
    return getGlobalResponseGetter().request(request, Card.class);
×
362
  }
363

364
  /**
365
   * Updates the specified Issuing {@code Card} object by setting the values of the parameters
366
   * passed. Any parameters not provided will be left unchanged.
367
   */
368
  @Override
369
  public Card update(Map<String, Object> params) throws StripeException {
370
    return update(params, (RequestOptions) null);
1✔
371
  }
372

373
  /**
374
   * Updates the specified Issuing {@code Card} object by setting the values of the parameters
375
   * passed. Any parameters not provided will be left unchanged.
376
   */
377
  @Override
378
  public Card update(Map<String, Object> params, RequestOptions options) throws StripeException {
379
    String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(this.getId()));
1✔
380
    ApiRequest request =
1✔
381
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
382
    return getResponseGetter().request(request, Card.class);
1✔
383
  }
384

385
  /**
386
   * Updates the specified Issuing {@code Card} object by setting the values of the parameters
387
   * passed. Any parameters not provided will be left unchanged.
388
   */
389
  public Card update(CardUpdateParams params) throws StripeException {
390
    return update(params, (RequestOptions) null);
1✔
391
  }
392

393
  /**
394
   * Updates the specified Issuing {@code Card} object by setting the values of the parameters
395
   * passed. Any parameters not provided will be left unchanged.
396
   */
397
  public Card update(CardUpdateParams params, RequestOptions options) throws StripeException {
398
    String path = String.format("/v1/issuing/cards/%s", ApiResource.urlEncodeId(this.getId()));
1✔
399
    ApiResource.checkNullTypedParams(path, params);
1✔
400
    ApiRequest request =
1✔
401
        new ApiRequest(
402
            BaseAddress.API,
403
            ApiResource.RequestMethod.POST,
404
            path,
405
            ApiRequestParams.paramsToMap(params),
1✔
406
            options);
407
    return getResponseGetter().request(request, Card.class);
1✔
408
  }
409

410
  @Getter
411
  @Setter
412
  @EqualsAndHashCode(callSuper = false)
413
  public static class Shipping extends StripeObject {
×
414
    @SerializedName("address")
415
    Address address;
416

417
    /** Address validation details for the shipment. */
418
    @SerializedName("address_validation")
419
    AddressValidation addressValidation;
420

421
    /**
422
     * The delivery company that shipped a card.
423
     *
424
     * <p>One of {@code dhl}, {@code fedex}, {@code royal_mail}, or {@code usps}.
425
     */
426
    @SerializedName("carrier")
427
    String carrier;
428

429
    /** Additional information that may be required for clearing customs. */
430
    @SerializedName("customs")
431
    Customs customs;
432

433
    /** A unix timestamp representing a best estimate of when the card will be delivered. */
434
    @SerializedName("eta")
435
    Long eta;
436

437
    /** Recipient name. */
438
    @SerializedName("name")
439
    String name;
440

441
    /**
442
     * The phone number of the receiver of the shipment. Our courier partners will use this number
443
     * to contact you in the event of card delivery issues. For individual shipments to the EU/UK,
444
     * if this field is empty, we will provide them with the phone number provided when the
445
     * cardholder was initially created.
446
     */
447
    @SerializedName("phone_number")
448
    String phoneNumber;
449

450
    /**
451
     * Whether a signature is required for card delivery. This feature is only supported for US
452
     * users. Standard shipping service does not support signature on delivery. The default value
453
     * for standard shipping service is false and for express and priority services is true.
454
     */
455
    @SerializedName("require_signature")
456
    Boolean requireSignature;
457

458
    /**
459
     * Shipment service, such as {@code standard} or {@code express}.
460
     *
461
     * <p>One of {@code express}, {@code priority}, or {@code standard}.
462
     */
463
    @SerializedName("service")
464
    String service;
465

466
    /**
467
     * The delivery status of the card.
468
     *
469
     * <p>One of {@code canceled}, {@code delivered}, {@code failure}, {@code pending}, {@code
470
     * returned}, {@code shipped}, or {@code submitted}.
471
     */
472
    @SerializedName("status")
473
    String status;
474

475
    /** A tracking number for a card shipment. */
476
    @SerializedName("tracking_number")
477
    String trackingNumber;
478

479
    /**
480
     * A link to the shipping carrier's site where you can view detailed information about a card
481
     * shipment.
482
     */
483
    @SerializedName("tracking_url")
484
    String trackingUrl;
485

486
    /**
487
     * Packaging options.
488
     *
489
     * <p>One of {@code bulk}, or {@code individual}.
490
     */
491
    @SerializedName("type")
492
    String type;
493

494
    @Getter
495
    @Setter
496
    @EqualsAndHashCode(callSuper = false)
497
    public static class AddressValidation extends StripeObject {
×
498
      /**
499
       * The address validation capabilities to use.
500
       *
501
       * <p>One of {@code disabled}, {@code normalization_only}, or {@code
502
       * validation_and_normalization}.
503
       */
504
      @SerializedName("mode")
505
      String mode;
506

507
      /** The normalized shipping address. */
508
      @SerializedName("normalized_address")
509
      Address normalizedAddress;
510

511
      /**
512
       * The validation result for the shipping address.
513
       *
514
       * <p>One of {@code indeterminate}, {@code likely_deliverable}, or {@code
515
       * likely_undeliverable}.
516
       */
517
      @SerializedName("result")
518
      String result;
519
    }
520

521
    @Getter
522
    @Setter
523
    @EqualsAndHashCode(callSuper = false)
524
    public static class Customs extends StripeObject {
×
525
      /**
526
       * A registration number used for customs in Europe. See <a
527
       * href="https://www.gov.uk/eori">https://www.gov.uk/eori</a> for the UK and <a
528
       * href="https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en">https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en</a>
529
       * for the EU.
530
       */
531
      @SerializedName("eori_number")
532
      String eoriNumber;
533
    }
534
  }
535

536
  @Getter
537
  @Setter
538
  @EqualsAndHashCode(callSuper = false)
539
  public static class SpendingControls extends StripeObject {
1✔
540
    /**
541
     * Array of strings containing <a
542
     * href="https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category">categories</a>
543
     * of authorizations to allow. All other categories will be blocked. Cannot be set with {@code
544
     * blocked_categories}.
545
     */
546
    @SerializedName("allowed_categories")
547
    List<String> allowedCategories;
548

549
    /**
550
     * Array of strings containing representing countries from which authorizations will be allowed.
551
     * Authorizations from merchants in all other countries will be declined. Country codes should
552
     * be ISO 3166 alpha-2 country codes (e.g. {@code US}). Cannot be set with {@code
553
     * blocked_merchant_countries}. Provide an empty value to unset this control.
554
     */
555
    @SerializedName("allowed_merchant_countries")
556
    List<String> allowedMerchantCountries;
557

558
    /**
559
     * Array of strings containing <a
560
     * href="https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category">categories</a>
561
     * of authorizations to decline. All other categories will be allowed. Cannot be set with {@code
562
     * allowed_categories}.
563
     */
564
    @SerializedName("blocked_categories")
565
    List<String> blockedCategories;
566

567
    /**
568
     * Array of strings containing representing countries from which authorizations will be
569
     * declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. {@code US}). Cannot be
570
     * set with {@code allowed_merchant_countries}. Provide an empty value to unset this control.
571
     */
572
    @SerializedName("blocked_merchant_countries")
573
    List<String> blockedMerchantCountries;
574

575
    /**
576
     * Limit spending with amount-based rules that apply across any cards this card replaced (i.e.,
577
     * its {@code replacement_for} card and <em>that</em> card's {@code replacement_for} card, up
578
     * the chain).
579
     */
580
    @SerializedName("spending_limits")
581
    List<Card.SpendingControls.SpendingLimit> spendingLimits;
582

583
    /**
584
     * Currency of the amounts within {@code spending_limits}. Always the same as the currency of
585
     * the card.
586
     */
587
    @SerializedName("spending_limits_currency")
588
    String spendingLimitsCurrency;
589

590
    @Getter
591
    @Setter
592
    @EqualsAndHashCode(callSuper = false)
593
    public static class SpendingLimit extends StripeObject {
×
594
      /**
595
       * Maximum amount allowed to spend per interval. This amount is in the card's currency and in
596
       * the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
597
       */
598
      @SerializedName("amount")
599
      Long amount;
600

601
      /**
602
       * Array of strings containing <a
603
       * href="https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category">categories</a>
604
       * this limit applies to. Omitting this field will apply the limit to all categories.
605
       */
606
      @SerializedName("categories")
607
      List<String> categories;
608

609
      /**
610
       * Interval (or event) to which the amount applies.
611
       *
612
       * <p>One of {@code all_time}, {@code daily}, {@code monthly}, {@code per_authorization},
613
       * {@code weekly}, or {@code yearly}.
614
       */
615
      @SerializedName("interval")
616
      String interval;
617
    }
618
  }
619

620
  @Getter
621
  @Setter
622
  @EqualsAndHashCode(callSuper = false)
623
  public static class Wallets extends StripeObject {
1✔
624
    @SerializedName("apple_pay")
625
    ApplePay applePay;
626

627
    @SerializedName("google_pay")
628
    GooglePay googlePay;
629

630
    /** Unique identifier for a card used with digital wallets. */
631
    @SerializedName("primary_account_identifier")
632
    String primaryAccountIdentifier;
633

634
    @Getter
635
    @Setter
636
    @EqualsAndHashCode(callSuper = false)
637
    public static class ApplePay extends StripeObject {
1✔
638
      /** Apple Pay Eligibility. */
639
      @SerializedName("eligible")
640
      Boolean eligible;
641

642
      /**
643
       * Reason the card is ineligible for Apple Pay
644
       *
645
       * <p>One of {@code missing_agreement}, {@code missing_cardholder_contact}, or {@code
646
       * unsupported_region}.
647
       */
648
      @SerializedName("ineligible_reason")
649
      String ineligibleReason;
650
    }
651

652
    @Getter
653
    @Setter
654
    @EqualsAndHashCode(callSuper = false)
655
    public static class GooglePay extends StripeObject {
1✔
656
      /** Google Pay Eligibility. */
657
      @SerializedName("eligible")
658
      Boolean eligible;
659

660
      /**
661
       * Reason the card is ineligible for Google Pay
662
       *
663
       * <p>One of {@code missing_agreement}, {@code missing_cardholder_contact}, or {@code
664
       * unsupported_region}.
665
       */
666
      @SerializedName("ineligible_reason")
667
      String ineligibleReason;
668
    }
669
  }
670

671
  public TestHelpers getTestHelpers() {
672
    return new TestHelpers(this);
1✔
673
  }
674

675
  public static class TestHelpers {
676
    private final Card resource;
677

678
    private TestHelpers(Card resource) {
1✔
679
      this.resource = resource;
1✔
680
    }
1✔
681

682
    /**
683
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
684
     * delivered}.
685
     */
686
    public Card deliverCard() throws StripeException {
687
      return deliverCard((Map<String, Object>) null, (RequestOptions) null);
×
688
    }
689

690
    /**
691
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
692
     * delivered}.
693
     */
694
    public Card deliverCard(RequestOptions options) throws StripeException {
695
      return deliverCard((Map<String, Object>) null, options);
×
696
    }
697

698
    /**
699
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
700
     * delivered}.
701
     */
702
    public Card deliverCard(Map<String, Object> params) throws StripeException {
703
      return deliverCard(params, (RequestOptions) null);
×
704
    }
705

706
    /**
707
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
708
     * delivered}.
709
     */
710
    public Card deliverCard(Map<String, Object> params, RequestOptions options)
711
        throws StripeException {
712
      String path =
×
713
          String.format(
×
714
              "/v1/test_helpers/issuing/cards/%s/shipping/deliver",
715
              ApiResource.urlEncodeId(this.resource.getId()));
×
716
      ApiRequest request =
×
717
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
718
      return resource.getResponseGetter().request(request, Card.class);
×
719
    }
720

721
    /**
722
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
723
     * delivered}.
724
     */
725
    public Card deliverCard(CardDeliverCardParams params) throws StripeException {
726
      return deliverCard(params, (RequestOptions) null);
1✔
727
    }
728

729
    /**
730
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
731
     * delivered}.
732
     */
733
    public Card deliverCard(CardDeliverCardParams params, RequestOptions options)
734
        throws StripeException {
735
      String path =
1✔
736
          String.format(
1✔
737
              "/v1/test_helpers/issuing/cards/%s/shipping/deliver",
738
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
739
      ApiResource.checkNullTypedParams(path, params);
1✔
740
      ApiRequest request =
1✔
741
          new ApiRequest(
742
              BaseAddress.API,
743
              ApiResource.RequestMethod.POST,
744
              path,
745
              ApiRequestParams.paramsToMap(params),
1✔
746
              options);
747
      return resource.getResponseGetter().request(request, Card.class);
1✔
748
    }
749

750
    /**
751
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
752
     */
753
    public Card failCard() throws StripeException {
754
      return failCard((Map<String, Object>) null, (RequestOptions) null);
×
755
    }
756

757
    /**
758
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
759
     */
760
    public Card failCard(RequestOptions options) throws StripeException {
761
      return failCard((Map<String, Object>) null, options);
×
762
    }
763

764
    /**
765
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
766
     */
767
    public Card failCard(Map<String, Object> params) throws StripeException {
768
      return failCard(params, (RequestOptions) null);
×
769
    }
770

771
    /**
772
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
773
     */
774
    public Card failCard(Map<String, Object> params, RequestOptions options)
775
        throws StripeException {
776
      String path =
×
777
          String.format(
×
778
              "/v1/test_helpers/issuing/cards/%s/shipping/fail",
779
              ApiResource.urlEncodeId(this.resource.getId()));
×
780
      ApiRequest request =
×
781
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
782
      return resource.getResponseGetter().request(request, Card.class);
×
783
    }
784

785
    /**
786
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
787
     */
788
    public Card failCard(CardFailCardParams params) throws StripeException {
789
      return failCard(params, (RequestOptions) null);
1✔
790
    }
791

792
    /**
793
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code failure}.
794
     */
795
    public Card failCard(CardFailCardParams params, RequestOptions options) throws StripeException {
796
      String path =
1✔
797
          String.format(
1✔
798
              "/v1/test_helpers/issuing/cards/%s/shipping/fail",
799
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
800
      ApiResource.checkNullTypedParams(path, params);
1✔
801
      ApiRequest request =
1✔
802
          new ApiRequest(
803
              BaseAddress.API,
804
              ApiResource.RequestMethod.POST,
805
              path,
806
              ApiRequestParams.paramsToMap(params),
1✔
807
              options);
808
      return resource.getResponseGetter().request(request, Card.class);
1✔
809
    }
810

811
    /**
812
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
813
     */
814
    public Card returnCard() throws StripeException {
815
      return returnCard((Map<String, Object>) null, (RequestOptions) null);
×
816
    }
817

818
    /**
819
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
820
     */
821
    public Card returnCard(RequestOptions options) throws StripeException {
822
      return returnCard((Map<String, Object>) null, options);
×
823
    }
824

825
    /**
826
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
827
     */
828
    public Card returnCard(Map<String, Object> params) throws StripeException {
829
      return returnCard(params, (RequestOptions) null);
×
830
    }
831

832
    /**
833
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
834
     */
835
    public Card returnCard(Map<String, Object> params, RequestOptions options)
836
        throws StripeException {
837
      String path =
×
838
          String.format(
×
839
              "/v1/test_helpers/issuing/cards/%s/shipping/return",
840
              ApiResource.urlEncodeId(this.resource.getId()));
×
841
      ApiRequest request =
×
842
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
843
      return resource.getResponseGetter().request(request, Card.class);
×
844
    }
845

846
    /**
847
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
848
     */
849
    public Card returnCard(CardReturnCardParams params) throws StripeException {
850
      return returnCard(params, (RequestOptions) null);
1✔
851
    }
852

853
    /**
854
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code returned}.
855
     */
856
    public Card returnCard(CardReturnCardParams params, RequestOptions options)
857
        throws StripeException {
858
      String path =
1✔
859
          String.format(
1✔
860
              "/v1/test_helpers/issuing/cards/%s/shipping/return",
861
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
862
      ApiResource.checkNullTypedParams(path, params);
1✔
863
      ApiRequest request =
1✔
864
          new ApiRequest(
865
              BaseAddress.API,
866
              ApiResource.RequestMethod.POST,
867
              path,
868
              ApiRequestParams.paramsToMap(params),
1✔
869
              options);
870
      return resource.getResponseGetter().request(request, Card.class);
1✔
871
    }
872

873
    /**
874
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
875
     */
876
    public Card shipCard() throws StripeException {
877
      return shipCard((Map<String, Object>) null, (RequestOptions) null);
×
878
    }
879

880
    /**
881
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
882
     */
883
    public Card shipCard(RequestOptions options) throws StripeException {
884
      return shipCard((Map<String, Object>) null, options);
×
885
    }
886

887
    /**
888
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
889
     */
890
    public Card shipCard(Map<String, Object> params) throws StripeException {
891
      return shipCard(params, (RequestOptions) null);
×
892
    }
893

894
    /**
895
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
896
     */
897
    public Card shipCard(Map<String, Object> params, RequestOptions options)
898
        throws StripeException {
899
      String path =
×
900
          String.format(
×
901
              "/v1/test_helpers/issuing/cards/%s/shipping/ship",
902
              ApiResource.urlEncodeId(this.resource.getId()));
×
903
      ApiRequest request =
×
904
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
905
      return resource.getResponseGetter().request(request, Card.class);
×
906
    }
907

908
    /**
909
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
910
     */
911
    public Card shipCard(CardShipCardParams params) throws StripeException {
912
      return shipCard(params, (RequestOptions) null);
1✔
913
    }
914

915
    /**
916
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code shipped}.
917
     */
918
    public Card shipCard(CardShipCardParams params, RequestOptions options) throws StripeException {
919
      String path =
1✔
920
          String.format(
1✔
921
              "/v1/test_helpers/issuing/cards/%s/shipping/ship",
922
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
923
      ApiResource.checkNullTypedParams(path, params);
1✔
924
      ApiRequest request =
1✔
925
          new ApiRequest(
926
              BaseAddress.API,
927
              ApiResource.RequestMethod.POST,
928
              path,
929
              ApiRequestParams.paramsToMap(params),
1✔
930
              options);
931
      return resource.getResponseGetter().request(request, Card.class);
1✔
932
    }
933

934
    /**
935
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
936
     * submitted}. This method is only available with Stripe Version ‘2024-09-30.acacia’ or above.
937
     */
938
    public Card submitCard() throws StripeException {
NEW
939
      return submitCard((Map<String, Object>) null, (RequestOptions) null);
×
940
    }
941

942
    /**
943
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
944
     * submitted}. This method is only available with Stripe Version ‘2024-09-30.acacia’ or above.
945
     */
946
    public Card submitCard(RequestOptions options) throws StripeException {
NEW
947
      return submitCard((Map<String, Object>) null, options);
×
948
    }
949

950
    /**
951
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
952
     * submitted}. This method is only available with Stripe Version ‘2024-09-30.acacia’ or above.
953
     */
954
    public Card submitCard(Map<String, Object> params) throws StripeException {
NEW
955
      return submitCard(params, (RequestOptions) null);
×
956
    }
957

958
    /**
959
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
960
     * submitted}. This method is only available with Stripe Version ‘2024-09-30.acacia’ or above.
961
     */
962
    public Card submitCard(Map<String, Object> params, RequestOptions options)
963
        throws StripeException {
NEW
964
      String path =
×
NEW
965
          String.format(
×
966
              "/v1/test_helpers/issuing/cards/%s/shipping/submit",
NEW
967
              ApiResource.urlEncodeId(this.resource.getId()));
×
NEW
968
      ApiRequest request =
×
969
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
NEW
970
      return resource.getResponseGetter().request(request, Card.class);
×
971
    }
972

973
    /**
974
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
975
     * submitted}. This method is only available with Stripe Version ‘2024-09-30.acacia’ or above.
976
     */
977
    public Card submitCard(CardSubmitCardParams params) throws StripeException {
NEW
978
      return submitCard(params, (RequestOptions) null);
×
979
    }
980

981
    /**
982
     * Updates the shipping status of the specified Issuing {@code Card} object to {@code
983
     * submitted}. This method is only available with Stripe Version ‘2024-09-30.acacia’ or above.
984
     */
985
    public Card submitCard(CardSubmitCardParams params, RequestOptions options)
986
        throws StripeException {
NEW
987
      String path =
×
NEW
988
          String.format(
×
989
              "/v1/test_helpers/issuing/cards/%s/shipping/submit",
NEW
990
              ApiResource.urlEncodeId(this.resource.getId()));
×
NEW
991
      ApiResource.checkNullTypedParams(path, params);
×
NEW
992
      ApiRequest request =
×
993
          new ApiRequest(
994
              BaseAddress.API,
995
              ApiResource.RequestMethod.POST,
996
              path,
NEW
997
              ApiRequestParams.paramsToMap(params),
×
998
              options);
NEW
999
      return resource.getResponseGetter().request(request, Card.class);
×
1000
    }
1001
  }
1002

1003
  @Override
1004
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1005
    super.setResponseGetter(responseGetter);
1✔
1006
    trySetResponseGetter(cardholder, responseGetter);
1✔
1007
    trySetResponseGetter(personalizationDesign, responseGetter);
1✔
1008
    trySetResponseGetter(replacedBy, responseGetter);
1✔
1009
    trySetResponseGetter(replacementFor, responseGetter);
1✔
1010
    trySetResponseGetter(shipping, responseGetter);
1✔
1011
    trySetResponseGetter(spendingControls, responseGetter);
1✔
1012
    trySetResponseGetter(wallets, responseGetter);
1✔
1013
  }
1✔
1014
}
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