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

stripe / stripe-java / #16644

14 Nov 2024 11:58PM UTC coverage: 12.414% (-0.005%) from 12.419%
#16644

push

github

web-flow
Update generated code for beta (#1922)

* Update generated code for v1334

* Update generated code for v1335

* Update generated code for v1337

* Update generated code for v1339

* Update generated code for v1340

* Update generated code for v1343

* Update generated code for v1345

* Update generated code for v1346

* Update generated code for v1347

* Update generated code for v1348

* Update generated code for v1349

* Update generated code for v1350

* Update generated code for v1352

* Update generated code for v1353

* Update generated code for v1356

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

2 of 79 new or added lines in 17 files covered. (2.53%)

1 existing line in 1 file now uncovered.

18857 of 151907 relevant lines covered (12.41%)

0.12 hits per line

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

55.35
/src/main/java/com/stripe/model/issuing/Authorization.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.BalanceTransaction;
7
import com.stripe.model.BalanceTransactionSource;
8
import com.stripe.model.ExpandableField;
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.AuthorizationApproveParams;
18
import com.stripe.param.issuing.AuthorizationCaptureParams;
19
import com.stripe.param.issuing.AuthorizationCreateParams;
20
import com.stripe.param.issuing.AuthorizationDeclineParams;
21
import com.stripe.param.issuing.AuthorizationExpireParams;
22
import com.stripe.param.issuing.AuthorizationFinalizeAmountParams;
23
import com.stripe.param.issuing.AuthorizationIncrementParams;
24
import com.stripe.param.issuing.AuthorizationListParams;
25
import com.stripe.param.issuing.AuthorizationRespondParams;
26
import com.stripe.param.issuing.AuthorizationRetrieveParams;
27
import com.stripe.param.issuing.AuthorizationReverseParams;
28
import com.stripe.param.issuing.AuthorizationUpdateParams;
29
import java.math.BigDecimal;
30
import java.util.List;
31
import java.util.Map;
32
import lombok.EqualsAndHashCode;
33
import lombok.Getter;
34
import lombok.Setter;
35

36
/**
37
 * When an <a href="https://stripe.com/docs/issuing">issued card</a> is used to make a purchase, an
38
 * Issuing {@code Authorization} object is created. <a
39
 * href="https://stripe.com/docs/issuing/purchases/authorizations">Authorizations</a> must be
40
 * approved for the purchase to be completed successfully.
41
 *
42
 * <p>Related guide: <a href="https://stripe.com/docs/issuing/purchases/authorizations">Issued card
43
 * authorizations</a>
44
 */
45
@Getter
46
@Setter
47
@EqualsAndHashCode(callSuper = false)
48
public class Authorization extends ApiResource
1✔
49
    implements MetadataStore<Authorization>, BalanceTransactionSource {
50
  /**
51
   * The total amount that was authorized or rejected. This amount is in {@code currency} and in the
52
   * <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. {@code
53
   * amount} should be the same as {@code merchant_amount}, unless {@code currency} and {@code
54
   * merchant_currency} are different.
55
   */
56
  @SerializedName("amount")
57
  Long amount;
58

59
  /**
60
   * Detailed breakdown of amount components. These amounts are denominated in {@code currency} and
61
   * in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
62
   */
63
  @SerializedName("amount_details")
64
  AmountDetails amountDetails;
65

66
  /** Whether the authorization has been approved. */
67
  @SerializedName("approved")
68
  Boolean approved;
69

70
  /**
71
   * How the card details were provided.
72
   *
73
   * <p>One of {@code chip}, {@code contactless}, {@code keyed_in}, {@code online}, or {@code
74
   * swipe}.
75
   */
76
  @SerializedName("authorization_method")
77
  String authorizationMethod;
78

79
  /** List of balance transactions associated with this authorization. */
80
  @SerializedName("balance_transactions")
81
  List<BalanceTransaction> balanceTransactions;
82

83
  /**
84
   * You can <a href="https://stripe.com/docs/issuing">create physical or virtual cards</a> that are
85
   * issued to cardholders.
86
   */
87
  @SerializedName("card")
88
  Card card;
89

90
  /** The cardholder to whom this authorization belongs. */
91
  @SerializedName("cardholder")
92
  @Getter(lombok.AccessLevel.NONE)
93
  @Setter(lombok.AccessLevel.NONE)
94
  ExpandableField<Cardholder> cardholder;
95

96
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
97
  @SerializedName("created")
98
  Long created;
99

100
  /**
101
   * The currency of the cardholder. This currency can be different from the currency presented at
102
   * authorization and the {@code merchant_currency} field on this authorization. Three-letter <a
103
   * href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase.
104
   * Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
105
   */
106
  @SerializedName("currency")
107
  String currency;
108

109
  /** Fleet-specific information for authorizations using Fleet cards. */
110
  @SerializedName("fleet")
111
  Fleet fleet;
112

113
  /**
114
   * Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk
115
   * reasons.
116
   */
117
  @SerializedName("fraud_challenges")
118
  List<Authorization.FraudChallenge> fraudChallenges;
119

120
  /**
121
   * Information about fuel that was purchased with this transaction. Typically this information is
122
   * received from the merchant after the authorization has been approved and the fuel dispensed.
123
   */
124
  @SerializedName("fuel")
125
  Fuel fuel;
126

127
  /** Unique identifier for the object. */
128
  @Getter(onMethod_ = {@Override})
129
  @SerializedName("id")
130
  String id;
131

132
  /**
133
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
134
   * object exists in test mode.
135
   */
136
  @SerializedName("livemode")
137
  Boolean livemode;
138

139
  /**
140
   * The total amount that was authorized or rejected. This amount is in the {@code
141
   * merchant_currency} and in the <a
142
   * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. {@code
143
   * merchant_amount} should be the same as {@code amount}, unless {@code merchant_currency} and
144
   * {@code currency} are different.
145
   */
146
  @SerializedName("merchant_amount")
147
  Long merchantAmount;
148

149
  /**
150
   * The local currency that was presented to the cardholder for the authorization. This currency
151
   * can be different from the cardholder currency and the {@code currency} field on this
152
   * authorization. Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO
153
   * currency code</a>, in lowercase. Must be a <a
154
   * href="https://stripe.com/docs/currencies">supported currency</a>.
155
   */
156
  @SerializedName("merchant_currency")
157
  String merchantCurrency;
158

159
  @SerializedName("merchant_data")
160
  MerchantData merchantData;
161

162
  /**
163
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
164
   * to an object. This can be useful for storing additional information about the object in a
165
   * structured format.
166
   */
167
  @Getter(onMethod_ = {@Override})
168
  @SerializedName("metadata")
169
  Map<String, String> metadata;
170

171
  /** Details about the authorization, such as identifiers, set by the card network. */
172
  @SerializedName("network_data")
173
  NetworkData networkData;
174

175
  /**
176
   * String representing the object's type. Objects of the same type share the same value.
177
   *
178
   * <p>Equal to {@code issuing.authorization}.
179
   */
180
  @SerializedName("object")
181
  String object;
182

183
  /**
184
   * The pending authorization request. This field will only be non-null during an {@code
185
   * issuing_authorization.request} webhook.
186
   */
187
  @SerializedName("pending_request")
188
  PendingRequest pendingRequest;
189

190
  /**
191
   * History of every time a {@code pending_request} authorization was approved/declined, either by
192
   * you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the
193
   * authorization by performing an incremental authorization, you can look at this field to see the
194
   * previous requests for the authorization. This field can be helpful in determining why a given
195
   * authorization was approved/declined.
196
   */
197
  @SerializedName("request_history")
198
  List<Authorization.RequestHistory> requestHistory;
199

200
  /**
201
   * The current status of the authorization in its lifecycle.
202
   *
203
   * <p>One of {@code closed}, {@code pending}, or {@code reversed}.
204
   */
205
  @SerializedName("status")
206
  String status;
207

208
  /**
209
   * <a href="https://stripe.com/docs/api/issuing/tokens/object">Token</a> object used for this
210
   * authorization. If a network token was not used for this authorization, this field will be null.
211
   */
212
  @SerializedName("token")
213
  @Getter(lombok.AccessLevel.NONE)
214
  @Setter(lombok.AccessLevel.NONE)
215
  ExpandableField<Token> token;
216

217
  /**
218
   * List of <a href="https://stripe.com/docs/api/issuing/transactions">transactions</a> associated
219
   * with this authorization.
220
   */
221
  @SerializedName("transactions")
222
  List<Transaction> transactions;
223

224
  /**
225
   * <a href="https://stripe.com/docs/api/treasury">Treasury</a> details related to this
226
   * authorization if it was created on a <a
227
   * href="https://stripe.com/docs/api/treasury/financial_accounts">FinancialAccount</a>.
228
   */
229
  @SerializedName("treasury")
230
  Treasury treasury;
231

232
  @SerializedName("verification_data")
233
  VerificationData verificationData;
234

235
  /**
236
   * Whether the authorization bypassed fraud risk checks because the cardholder has previously
237
   * completed a fraud challenge on a similar high-risk authorization from the same merchant.
238
   */
239
  @SerializedName("verified_by_fraud_challenge")
240
  Boolean verifiedByFraudChallenge;
241

242
  /**
243
   * The digital wallet used for this transaction. One of {@code apple_pay}, {@code google_pay}, or
244
   * {@code samsung_pay}. Will populate as {@code null} when no digital wallet was utilized.
245
   */
246
  @SerializedName("wallet")
247
  String wallet;
248

249
  /** Get ID of expandable {@code cardholder} object. */
250
  public String getCardholder() {
251
    return (this.cardholder != null) ? this.cardholder.getId() : null;
1✔
252
  }
253

254
  public void setCardholder(String id) {
255
    this.cardholder = ApiResource.setExpandableFieldId(id, this.cardholder);
×
256
  }
×
257

258
  /** Get expanded {@code cardholder}. */
259
  public Cardholder getCardholderObject() {
260
    return (this.cardholder != null) ? this.cardholder.getExpanded() : null;
1✔
261
  }
262

263
  public void setCardholderObject(Cardholder expandableObject) {
264
    this.cardholder = new ExpandableField<Cardholder>(expandableObject.getId(), expandableObject);
×
265
  }
×
266

267
  /** Get ID of expandable {@code token} object. */
268
  public String getToken() {
269
    return (this.token != null) ? this.token.getId() : null;
×
270
  }
271

272
  public void setToken(String id) {
273
    this.token = ApiResource.setExpandableFieldId(id, this.token);
×
274
  }
×
275

276
  /** Get expanded {@code token}. */
277
  public Token getTokenObject() {
278
    return (this.token != null) ? this.token.getExpanded() : null;
×
279
  }
280

281
  public void setTokenObject(Token expandableObject) {
282
    this.token = new ExpandableField<Token>(expandableObject.getId(), expandableObject);
×
283
  }
×
284

285
  /**
286
   * [Deprecated] Approves a pending Issuing {@code Authorization} object. This request should be
287
   * made within the timeout window of the <a
288
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
289
   * authorization</a> flow. This method is deprecated. Instead, <a
290
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
291
   * directly to the webhook request to approve an authorization</a>.
292
   */
293
  @Deprecated
294
  public Authorization approve() throws StripeException {
295
    return approve((Map<String, Object>) null, (RequestOptions) null);
×
296
  }
297

298
  /**
299
   * [Deprecated] Approves a pending Issuing {@code Authorization} object. This request should be
300
   * made within the timeout window of the <a
301
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
302
   * authorization</a> flow. This method is deprecated. Instead, <a
303
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
304
   * directly to the webhook request to approve an authorization</a>.
305
   */
306
  @Deprecated
307
  public Authorization approve(RequestOptions options) throws StripeException {
308
    return approve((Map<String, Object>) null, options);
×
309
  }
310

311
  /**
312
   * [Deprecated] Approves a pending Issuing {@code Authorization} object. This request should be
313
   * made within the timeout window of the <a
314
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
315
   * authorization</a> flow. This method is deprecated. Instead, <a
316
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
317
   * directly to the webhook request to approve an authorization</a>.
318
   */
319
  @Deprecated
320
  public Authorization approve(Map<String, Object> params) throws StripeException {
321
    return approve(params, (RequestOptions) null);
1✔
322
  }
323

324
  /**
325
   * [Deprecated] Approves a pending Issuing {@code Authorization} object. This request should be
326
   * made within the timeout window of the <a
327
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
328
   * authorization</a> flow. This method is deprecated. Instead, <a
329
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
330
   * directly to the webhook request to approve an authorization</a>.
331
   */
332
  @Deprecated
333
  public Authorization approve(Map<String, Object> params, RequestOptions options)
334
      throws StripeException {
335
    String path =
1✔
336
        String.format(
1✔
337
            "/v1/issuing/authorizations/%s/approve", ApiResource.urlEncodeId(this.getId()));
1✔
338
    ApiRequest request =
1✔
339
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
340
    return getResponseGetter().request(request, Authorization.class);
1✔
341
  }
342

343
  /**
344
   * [Deprecated] Approves a pending Issuing {@code Authorization} object. This request should be
345
   * made within the timeout window of the <a
346
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
347
   * authorization</a> flow. This method is deprecated. Instead, <a
348
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
349
   * directly to the webhook request to approve an authorization</a>.
350
   */
351
  @Deprecated
352
  public Authorization approve(AuthorizationApproveParams params) throws StripeException {
353
    return approve(params, (RequestOptions) null);
1✔
354
  }
355

356
  /**
357
   * [Deprecated] Approves a pending Issuing {@code Authorization} object. This request should be
358
   * made within the timeout window of the <a
359
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real-time
360
   * authorization</a> flow. This method is deprecated. Instead, <a
361
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
362
   * directly to the webhook request to approve an authorization</a>.
363
   */
364
  @Deprecated
365
  public Authorization approve(AuthorizationApproveParams params, RequestOptions options)
366
      throws StripeException {
367
    String path =
1✔
368
        String.format(
1✔
369
            "/v1/issuing/authorizations/%s/approve", ApiResource.urlEncodeId(this.getId()));
1✔
370
    ApiResource.checkNullTypedParams(path, params);
1✔
371
    ApiRequest request =
1✔
372
        new ApiRequest(
373
            BaseAddress.API,
374
            ApiResource.RequestMethod.POST,
375
            path,
376
            ApiRequestParams.paramsToMap(params),
1✔
377
            options);
378
    return getResponseGetter().request(request, Authorization.class);
1✔
379
  }
380

381
  /**
382
   * [Deprecated] Declines a pending Issuing {@code Authorization} object. This request should be
383
   * made within the timeout window of the <a
384
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
385
   * authorization</a> flow. This method is deprecated. Instead, <a
386
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
387
   * directly to the webhook request to decline an authorization</a>.
388
   */
389
  @Deprecated
390
  public Authorization decline() throws StripeException {
391
    return decline((Map<String, Object>) null, (RequestOptions) null);
×
392
  }
393

394
  /**
395
   * [Deprecated] Declines a pending Issuing {@code Authorization} object. This request should be
396
   * made within the timeout window of the <a
397
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
398
   * authorization</a> flow. This method is deprecated. Instead, <a
399
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
400
   * directly to the webhook request to decline an authorization</a>.
401
   */
402
  @Deprecated
403
  public Authorization decline(RequestOptions options) throws StripeException {
404
    return decline((Map<String, Object>) null, options);
×
405
  }
406

407
  /**
408
   * [Deprecated] Declines a pending Issuing {@code Authorization} object. This request should be
409
   * made within the timeout window of the <a
410
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
411
   * authorization</a> flow. This method is deprecated. Instead, <a
412
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
413
   * directly to the webhook request to decline an authorization</a>.
414
   */
415
  @Deprecated
416
  public Authorization decline(Map<String, Object> params) throws StripeException {
417
    return decline(params, (RequestOptions) null);
1✔
418
  }
419

420
  /**
421
   * [Deprecated] Declines a pending Issuing {@code Authorization} object. This request should be
422
   * made within the timeout window of the <a
423
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
424
   * authorization</a> flow. This method is deprecated. Instead, <a
425
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
426
   * directly to the webhook request to decline an authorization</a>.
427
   */
428
  @Deprecated
429
  public Authorization decline(Map<String, Object> params, RequestOptions options)
430
      throws StripeException {
431
    String path =
1✔
432
        String.format(
1✔
433
            "/v1/issuing/authorizations/%s/decline", ApiResource.urlEncodeId(this.getId()));
1✔
434
    ApiRequest request =
1✔
435
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
436
    return getResponseGetter().request(request, Authorization.class);
1✔
437
  }
438

439
  /**
440
   * [Deprecated] Declines a pending Issuing {@code Authorization} object. This request should be
441
   * made within the timeout window of the <a
442
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
443
   * authorization</a> flow. This method is deprecated. Instead, <a
444
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
445
   * directly to the webhook request to decline an authorization</a>.
446
   */
447
  @Deprecated
448
  public Authorization decline(AuthorizationDeclineParams params) throws StripeException {
449
    return decline(params, (RequestOptions) null);
1✔
450
  }
451

452
  /**
453
   * [Deprecated] Declines a pending Issuing {@code Authorization} object. This request should be
454
   * made within the timeout window of the <a
455
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations">real time
456
   * authorization</a> flow. This method is deprecated. Instead, <a
457
   * href="https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling">respond
458
   * directly to the webhook request to decline an authorization</a>.
459
   */
460
  @Deprecated
461
  public Authorization decline(AuthorizationDeclineParams params, RequestOptions options)
462
      throws StripeException {
463
    String path =
1✔
464
        String.format(
1✔
465
            "/v1/issuing/authorizations/%s/decline", ApiResource.urlEncodeId(this.getId()));
1✔
466
    ApiResource.checkNullTypedParams(path, params);
1✔
467
    ApiRequest request =
1✔
468
        new ApiRequest(
469
            BaseAddress.API,
470
            ApiResource.RequestMethod.POST,
471
            path,
472
            ApiRequestParams.paramsToMap(params),
1✔
473
            options);
474
    return getResponseGetter().request(request, Authorization.class);
1✔
475
  }
476

477
  /**
478
   * Returns a list of Issuing {@code Authorization} objects. The objects are sorted in descending
479
   * order by creation date, with the most recently created object appearing first.
480
   */
481
  public static AuthorizationCollection list(Map<String, Object> params) throws StripeException {
482
    return list(params, (RequestOptions) null);
1✔
483
  }
484

485
  /**
486
   * Returns a list of Issuing {@code Authorization} objects. The objects are sorted in descending
487
   * order by creation date, with the most recently created object appearing first.
488
   */
489
  public static AuthorizationCollection list(Map<String, Object> params, RequestOptions options)
490
      throws StripeException {
491
    String path = "/v1/issuing/authorizations";
1✔
492
    ApiRequest request =
1✔
493
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
494
    return getGlobalResponseGetter().request(request, AuthorizationCollection.class);
1✔
495
  }
496

497
  /**
498
   * Returns a list of Issuing {@code Authorization} objects. The objects are sorted in descending
499
   * order by creation date, with the most recently created object appearing first.
500
   */
501
  public static AuthorizationCollection list(AuthorizationListParams params)
502
      throws StripeException {
503
    return list(params, (RequestOptions) null);
1✔
504
  }
505

506
  /**
507
   * Returns a list of Issuing {@code Authorization} objects. The objects are sorted in descending
508
   * order by creation date, with the most recently created object appearing first.
509
   */
510
  public static AuthorizationCollection list(AuthorizationListParams params, RequestOptions options)
511
      throws StripeException {
512
    String path = "/v1/issuing/authorizations";
1✔
513
    ApiResource.checkNullTypedParams(path, params);
1✔
514
    ApiRequest request =
1✔
515
        new ApiRequest(
516
            BaseAddress.API,
517
            ApiResource.RequestMethod.GET,
518
            path,
519
            ApiRequestParams.paramsToMap(params),
1✔
520
            options);
521
    return getGlobalResponseGetter().request(request, AuthorizationCollection.class);
1✔
522
  }
523

524
  /** Retrieves an Issuing {@code Authorization} object. */
525
  public static Authorization retrieve(String authorization) throws StripeException {
526
    return retrieve(authorization, (Map<String, Object>) null, (RequestOptions) null);
1✔
527
  }
528

529
  /** Retrieves an Issuing {@code Authorization} object. */
530
  public static Authorization retrieve(String authorization, RequestOptions options)
531
      throws StripeException {
532
    return retrieve(authorization, (Map<String, Object>) null, options);
×
533
  }
534

535
  /** Retrieves an Issuing {@code Authorization} object. */
536
  public static Authorization retrieve(
537
      String authorization, Map<String, Object> params, RequestOptions options)
538
      throws StripeException {
539
    String path =
1✔
540
        String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(authorization));
1✔
541
    ApiRequest request =
1✔
542
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
543
    return getGlobalResponseGetter().request(request, Authorization.class);
1✔
544
  }
545

546
  /** Retrieves an Issuing {@code Authorization} object. */
547
  public static Authorization retrieve(
548
      String authorization, AuthorizationRetrieveParams params, RequestOptions options)
549
      throws StripeException {
550
    String path =
×
551
        String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(authorization));
×
552
    ApiResource.checkNullTypedParams(path, params);
×
553
    ApiRequest request =
×
554
        new ApiRequest(
555
            BaseAddress.API,
556
            ApiResource.RequestMethod.GET,
557
            path,
558
            ApiRequestParams.paramsToMap(params),
×
559
            options);
560
    return getGlobalResponseGetter().request(request, Authorization.class);
×
561
  }
562

563
  /**
564
   * Updates the specified Issuing {@code Authorization} object by setting the values of the
565
   * parameters passed. Any parameters not provided will be left unchanged.
566
   */
567
  @Override
568
  public Authorization update(Map<String, Object> params) throws StripeException {
569
    return update(params, (RequestOptions) null);
1✔
570
  }
571

572
  /**
573
   * Updates the specified Issuing {@code Authorization} object by setting the values of the
574
   * parameters passed. Any parameters not provided will be left unchanged.
575
   */
576
  @Override
577
  public Authorization update(Map<String, Object> params, RequestOptions options)
578
      throws StripeException {
579
    String path =
1✔
580
        String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(this.getId()));
1✔
581
    ApiRequest request =
1✔
582
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
583
    return getResponseGetter().request(request, Authorization.class);
1✔
584
  }
585

586
  /**
587
   * Updates the specified Issuing {@code Authorization} object by setting the values of the
588
   * parameters passed. Any parameters not provided will be left unchanged.
589
   */
590
  public Authorization update(AuthorizationUpdateParams params) throws StripeException {
591
    return update(params, (RequestOptions) null);
1✔
592
  }
593

594
  /**
595
   * Updates the specified Issuing {@code Authorization} object by setting the values of the
596
   * parameters passed. Any parameters not provided will be left unchanged.
597
   */
598
  public Authorization update(AuthorizationUpdateParams params, RequestOptions options)
599
      throws StripeException {
600
    String path =
1✔
601
        String.format("/v1/issuing/authorizations/%s", ApiResource.urlEncodeId(this.getId()));
1✔
602
    ApiResource.checkNullTypedParams(path, params);
1✔
603
    ApiRequest request =
1✔
604
        new ApiRequest(
605
            BaseAddress.API,
606
            ApiResource.RequestMethod.POST,
607
            path,
608
            ApiRequestParams.paramsToMap(params),
1✔
609
            options);
610
    return getResponseGetter().request(request, Authorization.class);
1✔
611
  }
612

613
  /**
614
   * For more details about AmountDetails, please refer to the <a
615
   * href="https://docs.stripe.com/api">API Reference.</a>
616
   */
617
  @Getter
618
  @Setter
619
  @EqualsAndHashCode(callSuper = false)
620
  public static class AmountDetails extends StripeObject {
1✔
621
    /** The fee charged by the ATM for the cash withdrawal. */
622
    @SerializedName("atm_fee")
623
    Long atmFee;
624

625
    /** The amount of cash requested by the cardholder. */
626
    @SerializedName("cashback_amount")
627
    Long cashbackAmount;
628
  }
629

630
  /**
631
   * For more details about Fleet, please refer to the <a href="https://docs.stripe.com/api">API
632
   * Reference.</a>
633
   */
634
  @Getter
635
  @Setter
636
  @EqualsAndHashCode(callSuper = false)
637
  public static class Fleet extends StripeObject {
×
638
    /**
639
     * Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary
640
     * depending on the configuration of your physical fleet cards. Typical points of sale support
641
     * only numeric entry.
642
     */
643
    @SerializedName("cardholder_prompt_data")
644
    CardholderPromptData cardholderPromptData;
645

646
    /**
647
     * The type of purchase.
648
     *
649
     * <p>One of {@code fuel_and_non_fuel_purchase}, {@code fuel_purchase}, or {@code
650
     * non_fuel_purchase}.
651
     */
652
    @SerializedName("purchase_type")
653
    String purchaseType;
654

655
    /**
656
     * More information about the total amount. Typically this information is received from the
657
     * merchant after the authorization has been approved and the fuel dispensed. This information
658
     * is not guaranteed to be accurate as some merchants may provide unreliable data.
659
     */
660
    @SerializedName("reported_breakdown")
661
    ReportedBreakdown reportedBreakdown;
662

663
    /**
664
     * The type of fuel service.
665
     *
666
     * <p>One of {@code full_service}, {@code non_fuel_transaction}, or {@code self_service}.
667
     */
668
    @SerializedName("service_type")
669
    String serviceType;
670

671
    /**
672
     * For more details about CardholderPromptData, please refer to the <a
673
     * href="https://docs.stripe.com/api">API Reference.</a>
674
     */
675
    @Getter
676
    @Setter
677
    @EqualsAndHashCode(callSuper = false)
678
    public static class CardholderPromptData extends StripeObject {
×
679
      /**
680
       * [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry.
681
       * The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID.
682
       */
683
      @SerializedName("alphanumeric_id")
684
      @Deprecated
685
      String alphanumericId;
686

687
      /** Driver ID. */
688
      @SerializedName("driver_id")
689
      String driverId;
690

691
      /** Odometer reading. */
692
      @SerializedName("odometer")
693
      Long odometer;
694

695
      /**
696
       * An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is
697
       * entered by the cardholder, but the merchant or card network did not specify the prompt
698
       * type.
699
       */
700
      @SerializedName("unspecified_id")
701
      String unspecifiedId;
702

703
      /** User ID. */
704
      @SerializedName("user_id")
705
      String userId;
706

707
      /** Vehicle number. */
708
      @SerializedName("vehicle_number")
709
      String vehicleNumber;
710
    }
711

712
    /**
713
     * For more details about ReportedBreakdown, please refer to the <a
714
     * href="https://docs.stripe.com/api">API Reference.</a>
715
     */
716
    @Getter
717
    @Setter
718
    @EqualsAndHashCode(callSuper = false)
719
    public static class ReportedBreakdown extends StripeObject {
×
720
      /** Breakdown of fuel portion of the purchase. */
721
      @SerializedName("fuel")
722
      Fuel fuel;
723

724
      /** Breakdown of non-fuel portion of the purchase. */
725
      @SerializedName("non_fuel")
726
      NonFuel nonFuel;
727

728
      /** Information about tax included in this transaction. */
729
      @SerializedName("tax")
730
      Tax tax;
731

732
      /**
733
       * For more details about Fuel, please refer to the <a href="https://docs.stripe.com/api">API
734
       * Reference.</a>
735
       */
736
      @Getter
737
      @Setter
738
      @EqualsAndHashCode(callSuper = false)
739
      public static class Fuel extends StripeObject {
×
740
        /**
741
         * Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive
742
         * of taxes.
743
         */
744
        @SerializedName("gross_amount_decimal")
745
        BigDecimal grossAmountDecimal;
746
      }
747

748
      /**
749
       * For more details about NonFuel, please refer to the <a
750
       * href="https://docs.stripe.com/api">API Reference.</a>
751
       */
752
      @Getter
753
      @Setter
754
      @EqualsAndHashCode(callSuper = false)
755
      public static class NonFuel extends StripeObject {
×
756
        /**
757
         * Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes.
758
         */
759
        @SerializedName("gross_amount_decimal")
760
        BigDecimal grossAmountDecimal;
761
      }
762

763
      /**
764
       * For more details about Tax, please refer to the <a href="https://docs.stripe.com/api">API
765
       * Reference.</a>
766
       */
767
      @Getter
768
      @Setter
769
      @EqualsAndHashCode(callSuper = false)
770
      public static class Tax extends StripeObject {
×
771
        /**
772
         * Amount of state or provincial Sales Tax included in the transaction amount. {@code null}
773
         * if not reported by merchant or not subject to tax.
774
         */
775
        @SerializedName("local_amount_decimal")
776
        BigDecimal localAmountDecimal;
777

778
        /**
779
         * Amount of national Sales Tax or VAT included in the transaction amount. {@code null} if
780
         * not reported by merchant or not subject to tax.
781
         */
782
        @SerializedName("national_amount_decimal")
783
        BigDecimal nationalAmountDecimal;
784
      }
785
    }
786
  }
787

788
  /**
789
   * For more details about FraudChallenge, please refer to the <a
790
   * href="https://docs.stripe.com/api">API Reference.</a>
791
   */
792
  @Getter
793
  @Setter
794
  @EqualsAndHashCode(callSuper = false)
NEW
795
  public static class FraudChallenge extends StripeObject {
×
796
    /**
797
     * The method by which the fraud challenge was delivered to the cardholder.
798
     *
799
     * <p>Equal to {@code sms}.
800
     */
801
    @SerializedName("channel")
802
    String channel;
803

804
    /**
805
     * The status of the fraud challenge.
806
     *
807
     * <p>One of {@code expired}, {@code pending}, {@code rejected}, {@code undeliverable}, or
808
     * {@code verified}.
809
     */
810
    @SerializedName("status")
811
    String status;
812

813
    /**
814
     * If the challenge is not deliverable, the reason why.
815
     *
816
     * <p>One of {@code no_phone_number}, or {@code unsupported_phone_number}.
817
     */
818
    @SerializedName("undeliverable_reason")
819
    String undeliverableReason;
820
  }
821

822
  /**
823
   * For more details about Fuel, please refer to the <a href="https://docs.stripe.com/api">API
824
   * Reference.</a>
825
   */
826
  @Getter
827
  @Setter
828
  @EqualsAndHashCode(callSuper = false)
829
  public static class Fuel extends StripeObject {
×
830
    /**
831
     * <a href="https://www.conexxus.org/conexxus-payment-system-product-codes">Conexxus Payment
832
     * System Product Code</a> identifying the primary fuel product purchased.
833
     */
834
    @SerializedName("industry_product_code")
835
    String industryProductCode;
836

837
    /**
838
     * The quantity of {@code unit}s of fuel that was dispensed, represented as a decimal string
839
     * with at most 12 decimal places.
840
     */
841
    @SerializedName("quantity_decimal")
842
    BigDecimal quantityDecimal;
843

844
    /**
845
     * The type of fuel that was purchased.
846
     *
847
     * <p>One of {@code diesel}, {@code other}, {@code unleaded_plus}, {@code unleaded_regular}, or
848
     * {@code unleaded_super}.
849
     */
850
    @SerializedName("type")
851
    String type;
852

853
    /**
854
     * The units for {@code quantity_decimal}.
855
     *
856
     * <p>One of {@code charging_minute}, {@code imperial_gallon}, {@code kilogram}, {@code
857
     * kilowatt_hour}, {@code liter}, {@code other}, {@code pound}, or {@code us_gallon}.
858
     */
859
    @SerializedName("unit")
860
    String unit;
861

862
    /**
863
     * The cost in cents per each unit of fuel, represented as a decimal string with at most 12
864
     * decimal places.
865
     */
866
    @SerializedName("unit_cost_decimal")
867
    BigDecimal unitCostDecimal;
868
  }
869

870
  /**
871
   * For more details about MerchantData, please refer to the <a
872
   * href="https://docs.stripe.com/api">API Reference.</a>
873
   */
874
  @Getter
875
  @Setter
876
  @EqualsAndHashCode(callSuper = false)
877
  public static class MerchantData extends StripeObject {
1✔
878
    /**
879
     * A categorization of the seller's type of business. See our <a
880
     * href="https://stripe.com/docs/issuing/merchant-categories">merchant categories guide</a> for
881
     * a list of possible values.
882
     */
883
    @SerializedName("category")
884
    String category;
885

886
    /** The merchant category code for the seller’s business. */
887
    @SerializedName("category_code")
888
    String categoryCode;
889

890
    /** City where the seller is located. */
891
    @SerializedName("city")
892
    String city;
893

894
    /** Country where the seller is located. */
895
    @SerializedName("country")
896
    String country;
897

898
    /** Name of the seller. */
899
    @SerializedName("name")
900
    String name;
901

902
    /**
903
     * Identifier assigned to the seller by the card network. Different card networks may assign
904
     * different network_id fields to the same merchant.
905
     */
906
    @SerializedName("network_id")
907
    String networkId;
908

909
    /** Postal code where the seller is located. */
910
    @SerializedName("postal_code")
911
    String postalCode;
912

913
    /** State where the seller is located. */
914
    @SerializedName("state")
915
    String state;
916

917
    /** An ID assigned by the seller to the location of the sale. */
918
    @SerializedName("terminal_id")
919
    String terminalId;
920

921
    /** URL provided by the merchant on a 3DS request. */
922
    @SerializedName("url")
923
    String url;
924
  }
925

926
  /**
927
   * For more details about NetworkData, please refer to the <a
928
   * href="https://docs.stripe.com/api">API Reference.</a>
929
   */
930
  @Getter
931
  @Setter
932
  @EqualsAndHashCode(callSuper = false)
933
  public static class NetworkData extends StripeObject {
×
934
    /**
935
     * Identifier assigned to the acquirer by the card network. Sometimes this value is not provided
936
     * by the network; in this case, the value will be {@code null}.
937
     */
938
    @SerializedName("acquiring_institution_id")
939
    String acquiringInstitutionId;
940

941
    /**
942
     * The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer
943
     * {@code network_data.transaction_id} if present, unless you have special requirements.
944
     */
945
    @SerializedName("system_trace_audit_number")
946
    String systemTraceAuditNumber;
947

948
    /**
949
     * Unique identifier for the authorization assigned by the card network used to match subsequent
950
     * messages, disputes, and transactions.
951
     */
952
    @SerializedName("transaction_id")
953
    String transactionId;
954
  }
955

956
  /**
957
   * For more details about PendingRequest, please refer to the <a
958
   * href="https://docs.stripe.com/api">API Reference.</a>
959
   */
960
  @Getter
961
  @Setter
962
  @EqualsAndHashCode(callSuper = false)
963
  public static class PendingRequest extends StripeObject {
1✔
964
    /**
965
     * The additional amount Stripe will hold if the authorization is approved, in the card's <a
966
     * href="https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency">currency</a>
967
     * and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency
968
     * unit</a>.
969
     */
970
    @SerializedName("amount")
971
    Long amount;
972

973
    /**
974
     * Detailed breakdown of amount components. These amounts are denominated in {@code currency}
975
     * and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency
976
     * unit</a>.
977
     */
978
    @SerializedName("amount_details")
979
    AmountDetails amountDetails;
980

981
    /**
982
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
983
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
984
     * currency</a>.
985
     */
986
    @SerializedName("currency")
987
    String currency;
988

989
    /**
990
     * If set {@code true}, you may provide <a
991
     * href="https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount">amount</a>
992
     * to control how much to hold for the authorization.
993
     */
994
    @SerializedName("is_amount_controllable")
995
    Boolean isAmountControllable;
996

997
    /**
998
     * The amount the merchant is requesting to be authorized in the {@code merchant_currency}. The
999
     * amount is in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency
1000
     * unit</a>.
1001
     */
1002
    @SerializedName("merchant_amount")
1003
    Long merchantAmount;
1004

1005
    /** The local currency the merchant is requesting to authorize. */
1006
    @SerializedName("merchant_currency")
1007
    String merchantCurrency;
1008

1009
    /**
1010
     * The card network's estimate of the likelihood that an authorization is fraudulent. Takes on
1011
     * values between 1 and 99.
1012
     */
1013
    @SerializedName("network_risk_score")
1014
    Long networkRiskScore;
1015

1016
    /**
1017
     * For more details about AmountDetails, please refer to the <a
1018
     * href="https://docs.stripe.com/api">API Reference.</a>
1019
     */
1020
    @Getter
1021
    @Setter
1022
    @EqualsAndHashCode(callSuper = false)
1023
    public static class AmountDetails extends StripeObject {
1✔
1024
      /** The fee charged by the ATM for the cash withdrawal. */
1025
      @SerializedName("atm_fee")
1026
      Long atmFee;
1027

1028
      /** The amount of cash requested by the cardholder. */
1029
      @SerializedName("cashback_amount")
1030
      Long cashbackAmount;
1031
    }
1032
  }
1033

1034
  /**
1035
   * For more details about RequestHistory, please refer to the <a
1036
   * href="https://docs.stripe.com/api">API Reference.</a>
1037
   */
1038
  @Getter
1039
  @Setter
1040
  @EqualsAndHashCode(callSuper = false)
1041
  public static class RequestHistory extends StripeObject {
×
1042
    /**
1043
     * The {@code pending_request.amount} at the time of the request, presented in your card's
1044
     * currency and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest
1045
     * currency unit</a>. Stripe held this amount from your account to fund the authorization if the
1046
     * request was approved.
1047
     */
1048
    @SerializedName("amount")
1049
    Long amount;
1050

1051
    /**
1052
     * Detailed breakdown of amount components. These amounts are denominated in {@code currency}
1053
     * and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency
1054
     * unit</a>.
1055
     */
1056
    @SerializedName("amount_details")
1057
    AmountDetails amountDetails;
1058

1059
    /** Whether this request was approved. */
1060
    @SerializedName("approved")
1061
    Boolean approved;
1062

1063
    /**
1064
     * A code created by Stripe which is shared with the merchant to validate the authorization.
1065
     * This field will be populated if the authorization message was approved. The code typically
1066
     * starts with the letter &quot;S&quot;, followed by a six-digit number. For example,
1067
     * &quot;S498162&quot;. Please note that the code is not guaranteed to be unique across
1068
     * authorizations.
1069
     */
1070
    @SerializedName("authorization_code")
1071
    String authorizationCode;
1072

1073
    /** Time at which the object was created. Measured in seconds since the Unix epoch. */
1074
    @SerializedName("created")
1075
    Long created;
1076

1077
    /**
1078
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1079
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1080
     * currency</a>.
1081
     */
1082
    @SerializedName("currency")
1083
    String currency;
1084

1085
    /**
1086
     * The {@code pending_request.merchant_amount} at the time of the request, presented in the
1087
     * {@code merchant_currency} and in the <a
1088
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
1089
     */
1090
    @SerializedName("merchant_amount")
1091
    Long merchantAmount;
1092

1093
    /**
1094
     * The currency that was collected by the merchant and presented to the cardholder for the
1095
     * authorization. Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO
1096
     * currency code</a>, in lowercase. Must be a <a
1097
     * href="https://stripe.com/docs/currencies">supported currency</a>.
1098
     */
1099
    @SerializedName("merchant_currency")
1100
    String merchantCurrency;
1101

1102
    /**
1103
     * The card network's estimate of the likelihood that an authorization is fraudulent. Takes on
1104
     * values between 1 and 99.
1105
     */
1106
    @SerializedName("network_risk_score")
1107
    Long networkRiskScore;
1108

1109
    /**
1110
     * When an authorization is approved or declined by you or by Stripe, this field provides
1111
     * additional detail on the reason for the outcome.
1112
     *
1113
     * <p>One of {@code account_disabled}, {@code card_active}, {@code card_canceled}, {@code
1114
     * card_expired}, {@code card_inactive}, {@code cardholder_blocked}, {@code
1115
     * cardholder_inactive}, {@code cardholder_verification_required}, {@code
1116
     * insecure_authorization_method}, {@code insufficient_funds}, {@code not_allowed}, {@code
1117
     * pin_blocked}, {@code spending_controls}, {@code suspected_fraud}, {@code
1118
     * verification_failed}, {@code webhook_approved}, {@code webhook_declined}, {@code
1119
     * webhook_error}, or {@code webhook_timeout}.
1120
     */
1121
    @SerializedName("reason")
1122
    String reason;
1123

1124
    /**
1125
     * If the {@code request_history.reason} is {@code webhook_error} because the direct webhook
1126
     * response is invalid (for example, parsing errors or missing parameters), we surface a more
1127
     * detailed error message via this field.
1128
     */
1129
    @SerializedName("reason_message")
1130
    String reasonMessage;
1131

1132
    /**
1133
     * Time when the card network received an authorization request from the acquirer in UTC.
1134
     * Referred to by networks as transmission time.
1135
     */
1136
    @SerializedName("requested_at")
1137
    Long requestedAt;
1138

1139
    /**
1140
     * For more details about AmountDetails, please refer to the <a
1141
     * href="https://docs.stripe.com/api">API Reference.</a>
1142
     */
1143
    @Getter
1144
    @Setter
1145
    @EqualsAndHashCode(callSuper = false)
1146
    public static class AmountDetails extends StripeObject {
×
1147
      /** The fee charged by the ATM for the cash withdrawal. */
1148
      @SerializedName("atm_fee")
1149
      Long atmFee;
1150

1151
      /** The amount of cash requested by the cardholder. */
1152
      @SerializedName("cashback_amount")
1153
      Long cashbackAmount;
1154
    }
1155
  }
1156

1157
  /**
1158
   * For more details about Treasury, please refer to the <a href="https://docs.stripe.com/api">API
1159
   * Reference.</a>
1160
   */
1161
  @Getter
1162
  @Setter
1163
  @EqualsAndHashCode(callSuper = false)
1164
  public static class Treasury extends StripeObject {
×
1165
    /**
1166
     * The array of <a
1167
     * href="https://stripe.com/docs/api/treasury/received_credits">ReceivedCredits</a> associated
1168
     * with this authorization
1169
     */
1170
    @SerializedName("received_credits")
1171
    List<String> receivedCredits;
1172

1173
    /**
1174
     * The array of <a
1175
     * href="https://stripe.com/docs/api/treasury/received_debits">ReceivedDebits</a> associated
1176
     * with this authorization
1177
     */
1178
    @SerializedName("received_debits")
1179
    List<String> receivedDebits;
1180

1181
    /**
1182
     * The Treasury <a href="https://stripe.com/docs/api/treasury/transactions">Transaction</a>
1183
     * associated with this authorization
1184
     */
1185
    @SerializedName("transaction")
1186
    String transaction;
1187
  }
1188

1189
  /**
1190
   * For more details about VerificationData, please refer to the <a
1191
   * href="https://docs.stripe.com/api">API Reference.</a>
1192
   */
1193
  @Getter
1194
  @Setter
1195
  @EqualsAndHashCode(callSuper = false)
1196
  public static class VerificationData extends StripeObject {
1✔
1197
    /**
1198
     * Whether the cardholder provided an address first line and if it matched the cardholder’s
1199
     * {@code billing.address.line1}.
1200
     *
1201
     * <p>One of {@code match}, {@code mismatch}, or {@code not_provided}.
1202
     */
1203
    @SerializedName("address_line1_check")
1204
    String addressLine1Check;
1205

1206
    /**
1207
     * Whether the cardholder provided a postal code and if it matched the cardholder’s {@code
1208
     * billing.address.postal_code}.
1209
     *
1210
     * <p>One of {@code match}, {@code mismatch}, or {@code not_provided}.
1211
     */
1212
    @SerializedName("address_postal_code_check")
1213
    String addressPostalCodeCheck;
1214

1215
    /** The exemption applied to this authorization. */
1216
    @SerializedName("authentication_exemption")
1217
    AuthenticationExemption authenticationExemption;
1218

1219
    /**
1220
     * Whether the cardholder provided a CVC and if it matched Stripe’s record.
1221
     *
1222
     * <p>One of {@code match}, {@code mismatch}, or {@code not_provided}.
1223
     */
1224
    @SerializedName("cvc_check")
1225
    String cvcCheck;
1226

1227
    /**
1228
     * Whether the cardholder provided an expiry date and if it matched Stripe’s record.
1229
     *
1230
     * <p>One of {@code match}, {@code mismatch}, or {@code not_provided}.
1231
     */
1232
    @SerializedName("expiry_check")
1233
    String expiryCheck;
1234

1235
    /** The postal code submitted as part of the authorization used for postal code verification. */
1236
    @SerializedName("postal_code")
1237
    String postalCode;
1238

1239
    /** 3D Secure details. */
1240
    @SerializedName("three_d_secure")
1241
    ThreeDSecure threeDSecure;
1242

1243
    /**
1244
     * For more details about AuthenticationExemption, please refer to the <a
1245
     * href="https://docs.stripe.com/api">API Reference.</a>
1246
     */
1247
    @Getter
1248
    @Setter
1249
    @EqualsAndHashCode(callSuper = false)
1250
    public static class AuthenticationExemption extends StripeObject {
×
1251
      /**
1252
       * The entity that requested the exemption, either the acquiring merchant or the Issuing user.
1253
       *
1254
       * <p>One of {@code acquirer}, or {@code issuer}.
1255
       */
1256
      @SerializedName("claimed_by")
1257
      String claimedBy;
1258

1259
      /**
1260
       * The specific exemption claimed for this authorization.
1261
       *
1262
       * <p>One of {@code low_value_transaction}, {@code transaction_risk_analysis}, or {@code
1263
       * unknown}.
1264
       */
1265
      @SerializedName("type")
1266
      String type;
1267
    }
1268

1269
    /**
1270
     * For more details about ThreeDSecure, please refer to the <a
1271
     * href="https://docs.stripe.com/api">API Reference.</a>
1272
     */
1273
    @Getter
1274
    @Setter
1275
    @EqualsAndHashCode(callSuper = false)
1276
    public static class ThreeDSecure extends StripeObject {
1✔
1277
      /**
1278
       * The outcome of the 3D Secure authentication request.
1279
       *
1280
       * <p>One of {@code attempt_acknowledged}, {@code authenticated}, {@code failed}, or {@code
1281
       * required}.
1282
       */
1283
      @SerializedName("result")
1284
      String result;
1285
    }
1286
  }
1287

1288
  public TestHelpers getTestHelpers() {
1289
    return new TestHelpers(this);
1✔
1290
  }
1291

1292
  public static class TestHelpers {
1293
    private final Authorization resource;
1294

1295
    private TestHelpers(Authorization resource) {
1✔
1296
      this.resource = resource;
1✔
1297
    }
1✔
1298

1299
    /** Create a test-mode authorization. */
1300
    public static Authorization create(Map<String, Object> params) throws StripeException {
1301
      return create(params, (RequestOptions) null);
×
1302
    }
1303

1304
    /** Create a test-mode authorization. */
1305
    public static Authorization create(Map<String, Object> params, RequestOptions options)
1306
        throws StripeException {
1307
      String path = "/v1/test_helpers/issuing/authorizations";
×
1308
      ApiRequest request =
×
1309
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1310
      return getGlobalResponseGetter().request(request, Authorization.class);
×
1311
    }
1312

1313
    /** Create a test-mode authorization. */
1314
    public static Authorization create(AuthorizationCreateParams params) throws StripeException {
1315
      return create(params, (RequestOptions) null);
1✔
1316
    }
1317

1318
    /** Create a test-mode authorization. */
1319
    public static Authorization create(AuthorizationCreateParams params, RequestOptions options)
1320
        throws StripeException {
1321
      String path = "/v1/test_helpers/issuing/authorizations";
1✔
1322
      ApiResource.checkNullTypedParams(path, params);
1✔
1323
      ApiRequest request =
1✔
1324
          new ApiRequest(
1325
              BaseAddress.API,
1326
              ApiResource.RequestMethod.POST,
1327
              path,
1328
              ApiRequestParams.paramsToMap(params),
1✔
1329
              options);
1330
      return getGlobalResponseGetter().request(request, Authorization.class);
1✔
1331
    }
1332

1333
    /** Capture a test-mode authorization. */
1334
    public Authorization capture() throws StripeException {
1335
      return capture((Map<String, Object>) null, (RequestOptions) null);
×
1336
    }
1337

1338
    /** Capture a test-mode authorization. */
1339
    public Authorization capture(RequestOptions options) throws StripeException {
1340
      return capture((Map<String, Object>) null, options);
×
1341
    }
1342

1343
    /** Capture a test-mode authorization. */
1344
    public Authorization capture(Map<String, Object> params) throws StripeException {
1345
      return capture(params, (RequestOptions) null);
×
1346
    }
1347

1348
    /** Capture a test-mode authorization. */
1349
    public Authorization capture(Map<String, Object> params, RequestOptions options)
1350
        throws StripeException {
1351
      String path =
×
1352
          String.format(
×
1353
              "/v1/test_helpers/issuing/authorizations/%s/capture",
1354
              ApiResource.urlEncodeId(this.resource.getId()));
×
1355
      ApiRequest request =
×
1356
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1357
      return resource.getResponseGetter().request(request, Authorization.class);
×
1358
    }
1359

1360
    /** Capture a test-mode authorization. */
1361
    public Authorization capture(AuthorizationCaptureParams params) throws StripeException {
1362
      return capture(params, (RequestOptions) null);
1✔
1363
    }
1364

1365
    /** Capture a test-mode authorization. */
1366
    public Authorization capture(AuthorizationCaptureParams params, RequestOptions options)
1367
        throws StripeException {
1368
      String path =
1✔
1369
          String.format(
1✔
1370
              "/v1/test_helpers/issuing/authorizations/%s/capture",
1371
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
1372
      ApiResource.checkNullTypedParams(path, params);
1✔
1373
      ApiRequest request =
1✔
1374
          new ApiRequest(
1375
              BaseAddress.API,
1376
              ApiResource.RequestMethod.POST,
1377
              path,
1378
              ApiRequestParams.paramsToMap(params),
1✔
1379
              options);
1380
      return resource.getResponseGetter().request(request, Authorization.class);
1✔
1381
    }
1382

1383
    /** Expire a test-mode Authorization. */
1384
    public Authorization expire() throws StripeException {
1385
      return expire((Map<String, Object>) null, (RequestOptions) null);
×
1386
    }
1387

1388
    /** Expire a test-mode Authorization. */
1389
    public Authorization expire(RequestOptions options) throws StripeException {
1390
      return expire((Map<String, Object>) null, options);
×
1391
    }
1392

1393
    /** Expire a test-mode Authorization. */
1394
    public Authorization expire(Map<String, Object> params) throws StripeException {
1395
      return expire(params, (RequestOptions) null);
×
1396
    }
1397

1398
    /** Expire a test-mode Authorization. */
1399
    public Authorization expire(Map<String, Object> params, RequestOptions options)
1400
        throws StripeException {
1401
      String path =
×
1402
          String.format(
×
1403
              "/v1/test_helpers/issuing/authorizations/%s/expire",
1404
              ApiResource.urlEncodeId(this.resource.getId()));
×
1405
      ApiRequest request =
×
1406
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1407
      return resource.getResponseGetter().request(request, Authorization.class);
×
1408
    }
1409

1410
    /** Expire a test-mode Authorization. */
1411
    public Authorization expire(AuthorizationExpireParams params) throws StripeException {
1412
      return expire(params, (RequestOptions) null);
1✔
1413
    }
1414

1415
    /** Expire a test-mode Authorization. */
1416
    public Authorization expire(AuthorizationExpireParams params, RequestOptions options)
1417
        throws StripeException {
1418
      String path =
1✔
1419
          String.format(
1✔
1420
              "/v1/test_helpers/issuing/authorizations/%s/expire",
1421
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
1422
      ApiResource.checkNullTypedParams(path, params);
1✔
1423
      ApiRequest request =
1✔
1424
          new ApiRequest(
1425
              BaseAddress.API,
1426
              ApiResource.RequestMethod.POST,
1427
              path,
1428
              ApiRequestParams.paramsToMap(params),
1✔
1429
              options);
1430
      return resource.getResponseGetter().request(request, Authorization.class);
1✔
1431
    }
1432

1433
    /**
1434
     * Finalize the amount on an Authorization prior to capture, when the initial authorization was
1435
     * for an estimated amount.
1436
     */
1437
    public Authorization finalizeAmount(Map<String, Object> params) throws StripeException {
1438
      return finalizeAmount(params, (RequestOptions) null);
×
1439
    }
1440

1441
    /**
1442
     * Finalize the amount on an Authorization prior to capture, when the initial authorization was
1443
     * for an estimated amount.
1444
     */
1445
    public Authorization finalizeAmount(Map<String, Object> params, RequestOptions options)
1446
        throws StripeException {
1447
      String path =
×
1448
          String.format(
×
1449
              "/v1/test_helpers/issuing/authorizations/%s/finalize_amount",
1450
              ApiResource.urlEncodeId(this.resource.getId()));
×
1451
      ApiRequest request =
×
1452
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1453
      return resource.getResponseGetter().request(request, Authorization.class);
×
1454
    }
1455

1456
    /**
1457
     * Finalize the amount on an Authorization prior to capture, when the initial authorization was
1458
     * for an estimated amount.
1459
     */
1460
    public Authorization finalizeAmount(AuthorizationFinalizeAmountParams params)
1461
        throws StripeException {
1462
      return finalizeAmount(params, (RequestOptions) null);
×
1463
    }
1464

1465
    /**
1466
     * Finalize the amount on an Authorization prior to capture, when the initial authorization was
1467
     * for an estimated amount.
1468
     */
1469
    public Authorization finalizeAmount(
1470
        AuthorizationFinalizeAmountParams params, RequestOptions options) throws StripeException {
1471
      String path =
×
1472
          String.format(
×
1473
              "/v1/test_helpers/issuing/authorizations/%s/finalize_amount",
1474
              ApiResource.urlEncodeId(this.resource.getId()));
×
1475
      ApiResource.checkNullTypedParams(path, params);
×
1476
      ApiRequest request =
×
1477
          new ApiRequest(
1478
              BaseAddress.API,
1479
              ApiResource.RequestMethod.POST,
1480
              path,
1481
              ApiRequestParams.paramsToMap(params),
×
1482
              options);
1483
      return resource.getResponseGetter().request(request, Authorization.class);
×
1484
    }
1485

1486
    /**
1487
     * Respond to a fraud challenge on a testmode Issuing authorization, simulating either a
1488
     * confirmation of fraud or a correction of legitimacy.
1489
     */
1490
    public Authorization respond(Map<String, Object> params) throws StripeException {
NEW
1491
      return respond(params, (RequestOptions) null);
×
1492
    }
1493

1494
    /**
1495
     * Respond to a fraud challenge on a testmode Issuing authorization, simulating either a
1496
     * confirmation of fraud or a correction of legitimacy.
1497
     */
1498
    public Authorization respond(Map<String, Object> params, RequestOptions options)
1499
        throws StripeException {
NEW
1500
      String path =
×
NEW
1501
          String.format(
×
1502
              "/v1/test_helpers/issuing/authorizations/%s/fraud_challenges/respond",
NEW
1503
              ApiResource.urlEncodeId(this.resource.getId()));
×
NEW
1504
      ApiRequest request =
×
1505
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
NEW
1506
      return resource.getResponseGetter().request(request, Authorization.class);
×
1507
    }
1508

1509
    /**
1510
     * Respond to a fraud challenge on a testmode Issuing authorization, simulating either a
1511
     * confirmation of fraud or a correction of legitimacy.
1512
     */
1513
    public Authorization respond(AuthorizationRespondParams params) throws StripeException {
NEW
1514
      return respond(params, (RequestOptions) null);
×
1515
    }
1516

1517
    /**
1518
     * Respond to a fraud challenge on a testmode Issuing authorization, simulating either a
1519
     * confirmation of fraud or a correction of legitimacy.
1520
     */
1521
    public Authorization respond(AuthorizationRespondParams params, RequestOptions options)
1522
        throws StripeException {
NEW
1523
      String path =
×
NEW
1524
          String.format(
×
1525
              "/v1/test_helpers/issuing/authorizations/%s/fraud_challenges/respond",
NEW
1526
              ApiResource.urlEncodeId(this.resource.getId()));
×
NEW
1527
      ApiResource.checkNullTypedParams(path, params);
×
NEW
1528
      ApiRequest request =
×
1529
          new ApiRequest(
1530
              BaseAddress.API,
1531
              ApiResource.RequestMethod.POST,
1532
              path,
NEW
1533
              ApiRequestParams.paramsToMap(params),
×
1534
              options);
NEW
1535
      return resource.getResponseGetter().request(request, Authorization.class);
×
1536
    }
1537

1538
    /** Increment a test-mode Authorization. */
1539
    public Authorization increment(Map<String, Object> params) throws StripeException {
1540
      return increment(params, (RequestOptions) null);
×
1541
    }
1542

1543
    /** Increment a test-mode Authorization. */
1544
    public Authorization increment(Map<String, Object> params, RequestOptions options)
1545
        throws StripeException {
1546
      String path =
×
1547
          String.format(
×
1548
              "/v1/test_helpers/issuing/authorizations/%s/increment",
1549
              ApiResource.urlEncodeId(this.resource.getId()));
×
1550
      ApiRequest request =
×
1551
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1552
      return resource.getResponseGetter().request(request, Authorization.class);
×
1553
    }
1554

1555
    /** Increment a test-mode Authorization. */
1556
    public Authorization increment(AuthorizationIncrementParams params) throws StripeException {
1557
      return increment(params, (RequestOptions) null);
1✔
1558
    }
1559

1560
    /** Increment a test-mode Authorization. */
1561
    public Authorization increment(AuthorizationIncrementParams params, RequestOptions options)
1562
        throws StripeException {
1563
      String path =
1✔
1564
          String.format(
1✔
1565
              "/v1/test_helpers/issuing/authorizations/%s/increment",
1566
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
1567
      ApiResource.checkNullTypedParams(path, params);
1✔
1568
      ApiRequest request =
1✔
1569
          new ApiRequest(
1570
              BaseAddress.API,
1571
              ApiResource.RequestMethod.POST,
1572
              path,
1573
              ApiRequestParams.paramsToMap(params),
1✔
1574
              options);
1575
      return resource.getResponseGetter().request(request, Authorization.class);
1✔
1576
    }
1577

1578
    /** Reverse a test-mode Authorization. */
1579
    public Authorization reverse() throws StripeException {
1580
      return reverse((Map<String, Object>) null, (RequestOptions) null);
×
1581
    }
1582

1583
    /** Reverse a test-mode Authorization. */
1584
    public Authorization reverse(RequestOptions options) throws StripeException {
1585
      return reverse((Map<String, Object>) null, options);
×
1586
    }
1587

1588
    /** Reverse a test-mode Authorization. */
1589
    public Authorization reverse(Map<String, Object> params) throws StripeException {
1590
      return reverse(params, (RequestOptions) null);
×
1591
    }
1592

1593
    /** Reverse a test-mode Authorization. */
1594
    public Authorization reverse(Map<String, Object> params, RequestOptions options)
1595
        throws StripeException {
1596
      String path =
×
1597
          String.format(
×
1598
              "/v1/test_helpers/issuing/authorizations/%s/reverse",
1599
              ApiResource.urlEncodeId(this.resource.getId()));
×
1600
      ApiRequest request =
×
1601
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1602
      return resource.getResponseGetter().request(request, Authorization.class);
×
1603
    }
1604

1605
    /** Reverse a test-mode Authorization. */
1606
    public Authorization reverse(AuthorizationReverseParams params) throws StripeException {
1607
      return reverse(params, (RequestOptions) null);
1✔
1608
    }
1609

1610
    /** Reverse a test-mode Authorization. */
1611
    public Authorization reverse(AuthorizationReverseParams params, RequestOptions options)
1612
        throws StripeException {
1613
      String path =
1✔
1614
          String.format(
1✔
1615
              "/v1/test_helpers/issuing/authorizations/%s/reverse",
1616
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
1617
      ApiResource.checkNullTypedParams(path, params);
1✔
1618
      ApiRequest request =
1✔
1619
          new ApiRequest(
1620
              BaseAddress.API,
1621
              ApiResource.RequestMethod.POST,
1622
              path,
1623
              ApiRequestParams.paramsToMap(params),
1✔
1624
              options);
1625
      return resource.getResponseGetter().request(request, Authorization.class);
1✔
1626
    }
1627
  }
1628

1629
  @Override
1630
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1631
    super.setResponseGetter(responseGetter);
1✔
1632
    trySetResponseGetter(amountDetails, responseGetter);
1✔
1633
    trySetResponseGetter(card, responseGetter);
1✔
1634
    trySetResponseGetter(cardholder, responseGetter);
1✔
1635
    trySetResponseGetter(fleet, responseGetter);
1✔
1636
    trySetResponseGetter(fuel, responseGetter);
1✔
1637
    trySetResponseGetter(merchantData, responseGetter);
1✔
1638
    trySetResponseGetter(networkData, responseGetter);
1✔
1639
    trySetResponseGetter(pendingRequest, responseGetter);
1✔
1640
    trySetResponseGetter(token, responseGetter);
1✔
1641
    trySetResponseGetter(treasury, responseGetter);
1✔
1642
    trySetResponseGetter(verificationData, responseGetter);
1✔
1643
  }
1✔
1644
}
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