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

stripe / stripe-java / #16493

03 Oct 2024 07:15PM UTC coverage: 12.942% (+0.08%) from 12.864%
#16493

push

github

web-flow
Merge Stripe-java v27.0.0 to beta branch (#1888)

409 of 1651 new or added lines in 88 files covered. (24.77%)

31 existing lines in 7 files now uncovered.

18773 of 145050 relevant lines covered (12.94%)

0.13 hits per line

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

25.94
/src/main/java/com/stripe/model/terminal/Reader.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.terminal;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.Charge;
7
import com.stripe.model.ExpandableField;
8
import com.stripe.model.HasId;
9
import com.stripe.model.MetadataStore;
10
import com.stripe.model.PaymentIntent;
11
import com.stripe.model.PaymentMethod;
12
import com.stripe.model.Refund;
13
import com.stripe.model.SetupIntent;
14
import com.stripe.model.StripeObject;
15
import com.stripe.net.ApiRequest;
16
import com.stripe.net.ApiRequestParams;
17
import com.stripe.net.ApiResource;
18
import com.stripe.net.BaseAddress;
19
import com.stripe.net.RequestOptions;
20
import com.stripe.net.StripeResponseGetter;
21
import com.stripe.param.terminal.ReaderCancelActionParams;
22
import com.stripe.param.terminal.ReaderCollectInputsParams;
23
import com.stripe.param.terminal.ReaderCollectPaymentMethodParams;
24
import com.stripe.param.terminal.ReaderConfirmPaymentIntentParams;
25
import com.stripe.param.terminal.ReaderCreateParams;
26
import com.stripe.param.terminal.ReaderListParams;
27
import com.stripe.param.terminal.ReaderPresentPaymentMethodParams;
28
import com.stripe.param.terminal.ReaderProcessPaymentIntentParams;
29
import com.stripe.param.terminal.ReaderProcessSetupIntentParams;
30
import com.stripe.param.terminal.ReaderRefundPaymentParams;
31
import com.stripe.param.terminal.ReaderRetrieveParams;
32
import com.stripe.param.terminal.ReaderSetReaderDisplayParams;
33
import com.stripe.param.terminal.ReaderUpdateParams;
34
import java.util.List;
35
import java.util.Map;
36
import lombok.EqualsAndHashCode;
37
import lombok.Getter;
38
import lombok.Setter;
39

40
/**
41
 * A Reader represents a physical device for accepting payment details.
42
 *
43
 * <p>Related guide: <a href="https://stripe.com/docs/terminal/payments/connect-reader">Connecting
44
 * to a reader</a>
45
 */
46
@Getter
47
@Setter
48
@EqualsAndHashCode(callSuper = false)
49
public class Reader extends ApiResource implements HasId, MetadataStore<Reader> {
1✔
50
  /** The most recent action performed by the reader. */
51
  @SerializedName("action")
52
  Action action;
53

54
  /** Always true for a deleted object. */
55
  @SerializedName("deleted")
56
  Boolean deleted;
57

58
  /** The current software version of the reader. */
59
  @SerializedName("device_sw_version")
60
  String deviceSwVersion;
61

62
  /**
63
   * Type of reader, one of {@code bbpos_wisepad3}, {@code stripe_m2}, {@code stripe_s700}, {@code
64
   * bbpos_chipper2x}, {@code bbpos_wisepos_e}, {@code verifone_P400}, {@code simulated_wisepos_e},
65
   * or {@code mobile_phone_reader}.
66
   */
67
  @SerializedName("device_type")
68
  String deviceType;
69

70
  /** Unique identifier for the object. */
71
  @Getter(onMethod_ = {@Override})
72
  @SerializedName("id")
73
  String id;
74

75
  /** The local IP address of the reader. */
76
  @SerializedName("ip_address")
77
  String ipAddress;
78

79
  /** Custom label given to the reader for easier identification. */
80
  @SerializedName("label")
81
  String label;
82

83
  /**
84
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
85
   * object exists in test mode.
86
   */
87
  @SerializedName("livemode")
88
  Boolean livemode;
89

90
  /** The location identifier of the reader. */
91
  @SerializedName("location")
92
  @Getter(lombok.AccessLevel.NONE)
93
  @Setter(lombok.AccessLevel.NONE)
94
  ExpandableField<Location> location;
95

96
  /**
97
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
98
   * to an object. This can be useful for storing additional information about the object in a
99
   * structured format.
100
   */
101
  @Getter(onMethod_ = {@Override})
102
  @SerializedName("metadata")
103
  Map<String, String> metadata;
104

105
  /**
106
   * String representing the object's type. Objects of the same type share the same value.
107
   *
108
   * <p>Equal to {@code terminal.reader}.
109
   */
110
  @SerializedName("object")
111
  String object;
112

113
  /** Serial number of the reader. */
114
  @SerializedName("serial_number")
115
  String serialNumber;
116

117
  /**
118
   * The networking status of the reader. We do not recommend using this field in flows that may
119
   * block taking payments.
120
   *
121
   * <p>One of {@code offline}, or {@code online}.
122
   */
123
  @SerializedName("status")
124
  String status;
125

126
  /** Get ID of expandable {@code location} object. */
127
  public String getLocation() {
128
    return (this.location != null) ? this.location.getId() : null;
×
129
  }
130

131
  public void setLocation(String id) {
132
    this.location = ApiResource.setExpandableFieldId(id, this.location);
×
133
  }
×
134

135
  /** Get expanded {@code location}. */
136
  public Location getLocationObject() {
137
    return (this.location != null) ? this.location.getExpanded() : null;
×
138
  }
139

140
  public void setLocationObject(Location expandableObject) {
141
    this.location = new ExpandableField<Location>(expandableObject.getId(), expandableObject);
×
142
  }
×
143

144
  /** Cancels the current reader action. */
145
  public Reader cancelAction() throws StripeException {
146
    return cancelAction((Map<String, Object>) null, (RequestOptions) null);
×
147
  }
148

149
  /** Cancels the current reader action. */
150
  public Reader cancelAction(RequestOptions options) throws StripeException {
151
    return cancelAction((Map<String, Object>) null, options);
×
152
  }
153

154
  /** Cancels the current reader action. */
155
  public Reader cancelAction(Map<String, Object> params) throws StripeException {
156
    return cancelAction(params, (RequestOptions) null);
×
157
  }
158

159
  /** Cancels the current reader action. */
160
  public Reader cancelAction(Map<String, Object> params, RequestOptions options)
161
      throws StripeException {
162
    String path =
×
163
        String.format(
×
164
            "/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(this.getId()));
×
165
    ApiRequest request =
×
166
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
167
    return getResponseGetter().request(request, Reader.class);
×
168
  }
169

170
  /** Cancels the current reader action. */
171
  public Reader cancelAction(ReaderCancelActionParams params) throws StripeException {
172
    return cancelAction(params, (RequestOptions) null);
1✔
173
  }
174

175
  /** Cancels the current reader action. */
176
  public Reader cancelAction(ReaderCancelActionParams params, RequestOptions options)
177
      throws StripeException {
178
    String path =
1✔
179
        String.format(
1✔
180
            "/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(this.getId()));
1✔
181
    ApiResource.checkNullTypedParams(path, params);
1✔
182
    ApiRequest request =
1✔
183
        new ApiRequest(
184
            BaseAddress.API,
185
            ApiResource.RequestMethod.POST,
186
            path,
187
            ApiRequestParams.paramsToMap(params),
1✔
188
            options);
189
    return getResponseGetter().request(request, Reader.class);
1✔
190
  }
191

192
  /** Initiates an input collection flow on a Reader. */
193
  public Reader collectInputs(Map<String, Object> params) throws StripeException {
194
    return collectInputs(params, (RequestOptions) null);
×
195
  }
196

197
  /** Initiates an input collection flow on a Reader. */
198
  public Reader collectInputs(Map<String, Object> params, RequestOptions options)
199
      throws StripeException {
200
    String path =
×
201
        String.format(
×
202
            "/v1/terminal/readers/%s/collect_inputs", ApiResource.urlEncodeId(this.getId()));
×
203
    ApiRequest request =
×
204
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
205
    return getResponseGetter().request(request, Reader.class);
×
206
  }
207

208
  /** Initiates an input collection flow on a Reader. */
209
  public Reader collectInputs(ReaderCollectInputsParams params) throws StripeException {
210
    return collectInputs(params, (RequestOptions) null);
×
211
  }
212

213
  /** Initiates an input collection flow on a Reader. */
214
  public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions options)
215
      throws StripeException {
216
    String path =
×
217
        String.format(
×
218
            "/v1/terminal/readers/%s/collect_inputs", ApiResource.urlEncodeId(this.getId()));
×
219
    ApiResource.checkNullTypedParams(path, params);
×
220
    ApiRequest request =
×
221
        new ApiRequest(
222
            BaseAddress.API,
223
            ApiResource.RequestMethod.POST,
224
            path,
225
            ApiRequestParams.paramsToMap(params),
×
226
            options);
227
    return getResponseGetter().request(request, Reader.class);
×
228
  }
229

230
  /**
231
   * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before
232
   * manual confirmation.
233
   */
234
  public Reader collectPaymentMethod(Map<String, Object> params) throws StripeException {
235
    return collectPaymentMethod(params, (RequestOptions) null);
×
236
  }
237

238
  /**
239
   * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before
240
   * manual confirmation.
241
   */
242
  public Reader collectPaymentMethod(Map<String, Object> params, RequestOptions options)
243
      throws StripeException {
244
    String path =
×
245
        String.format(
×
246
            "/v1/terminal/readers/%s/collect_payment_method",
247
            ApiResource.urlEncodeId(this.getId()));
×
248
    ApiRequest request =
×
249
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
250
    return getResponseGetter().request(request, Reader.class);
×
251
  }
252

253
  /**
254
   * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before
255
   * manual confirmation.
256
   */
257
  public Reader collectPaymentMethod(ReaderCollectPaymentMethodParams params)
258
      throws StripeException {
259
    return collectPaymentMethod(params, (RequestOptions) null);
×
260
  }
261

262
  /**
263
   * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before
264
   * manual confirmation.
265
   */
266
  public Reader collectPaymentMethod(
267
      ReaderCollectPaymentMethodParams params, RequestOptions options) throws StripeException {
268
    String path =
×
269
        String.format(
×
270
            "/v1/terminal/readers/%s/collect_payment_method",
271
            ApiResource.urlEncodeId(this.getId()));
×
272
    ApiResource.checkNullTypedParams(path, params);
×
273
    ApiRequest request =
×
274
        new ApiRequest(
275
            BaseAddress.API,
276
            ApiResource.RequestMethod.POST,
277
            path,
278
            ApiRequestParams.paramsToMap(params),
×
279
            options);
280
    return getResponseGetter().request(request, Reader.class);
×
281
  }
282

283
  /** Finalizes a payment on a Reader. */
284
  public Reader confirmPaymentIntent(Map<String, Object> params) throws StripeException {
285
    return confirmPaymentIntent(params, (RequestOptions) null);
×
286
  }
287

288
  /** Finalizes a payment on a Reader. */
289
  public Reader confirmPaymentIntent(Map<String, Object> params, RequestOptions options)
290
      throws StripeException {
291
    String path =
×
292
        String.format(
×
293
            "/v1/terminal/readers/%s/confirm_payment_intent",
294
            ApiResource.urlEncodeId(this.getId()));
×
295
    ApiRequest request =
×
296
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
297
    return getResponseGetter().request(request, Reader.class);
×
298
  }
299

300
  /** Finalizes a payment on a Reader. */
301
  public Reader confirmPaymentIntent(ReaderConfirmPaymentIntentParams params)
302
      throws StripeException {
303
    return confirmPaymentIntent(params, (RequestOptions) null);
×
304
  }
305

306
  /** Finalizes a payment on a Reader. */
307
  public Reader confirmPaymentIntent(
308
      ReaderConfirmPaymentIntentParams params, RequestOptions options) throws StripeException {
309
    String path =
×
310
        String.format(
×
311
            "/v1/terminal/readers/%s/confirm_payment_intent",
312
            ApiResource.urlEncodeId(this.getId()));
×
313
    ApiResource.checkNullTypedParams(path, params);
×
314
    ApiRequest request =
×
315
        new ApiRequest(
316
            BaseAddress.API,
317
            ApiResource.RequestMethod.POST,
318
            path,
319
            ApiRequestParams.paramsToMap(params),
×
320
            options);
321
    return getResponseGetter().request(request, Reader.class);
×
322
  }
323

324
  /** Creates a new {@code Reader} object. */
325
  public static Reader create(Map<String, Object> params) throws StripeException {
326
    return create(params, (RequestOptions) null);
1✔
327
  }
328

329
  /** Creates a new {@code Reader} object. */
330
  public static Reader create(Map<String, Object> params, RequestOptions options)
331
      throws StripeException {
332
    String path = "/v1/terminal/readers";
1✔
333
    ApiRequest request =
1✔
334
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
335
    return getGlobalResponseGetter().request(request, Reader.class);
1✔
336
  }
337

338
  /** Creates a new {@code Reader} object. */
339
  public static Reader create(ReaderCreateParams params) throws StripeException {
340
    return create(params, (RequestOptions) null);
1✔
341
  }
342

343
  /** Creates a new {@code Reader} object. */
344
  public static Reader create(ReaderCreateParams params, RequestOptions options)
345
      throws StripeException {
346
    String path = "/v1/terminal/readers";
1✔
347
    ApiResource.checkNullTypedParams(path, params);
1✔
348
    ApiRequest request =
1✔
349
        new ApiRequest(
350
            BaseAddress.API,
351
            ApiResource.RequestMethod.POST,
352
            path,
353
            ApiRequestParams.paramsToMap(params),
1✔
354
            options);
355
    return getGlobalResponseGetter().request(request, Reader.class);
1✔
356
  }
357

358
  /** Deletes a {@code Reader} object. */
359
  public Reader delete() throws StripeException {
360
    return delete((Map<String, Object>) null, (RequestOptions) null);
1✔
361
  }
362

363
  /** Deletes a {@code Reader} object. */
364
  public Reader delete(RequestOptions options) throws StripeException {
365
    return delete((Map<String, Object>) null, options);
×
366
  }
367

368
  /** Deletes a {@code Reader} object. */
369
  public Reader delete(Map<String, Object> params) throws StripeException {
370
    return delete(params, (RequestOptions) null);
×
371
  }
372

373
  /** Deletes a {@code Reader} object. */
374
  public Reader delete(Map<String, Object> params, RequestOptions options) throws StripeException {
375
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()));
1✔
376
    ApiRequest request =
1✔
377
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options);
378
    return getResponseGetter().request(request, Reader.class);
1✔
379
  }
380

381
  /** Returns a list of {@code Reader} objects. */
382
  public static ReaderCollection list(Map<String, Object> params) throws StripeException {
383
    return list(params, (RequestOptions) null);
1✔
384
  }
385

386
  /** Returns a list of {@code Reader} objects. */
387
  public static ReaderCollection list(Map<String, Object> params, RequestOptions options)
388
      throws StripeException {
389
    String path = "/v1/terminal/readers";
1✔
390
    ApiRequest request =
1✔
391
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
392
    return getGlobalResponseGetter().request(request, ReaderCollection.class);
1✔
393
  }
394

395
  /** Returns a list of {@code Reader} objects. */
396
  public static ReaderCollection list(ReaderListParams params) throws StripeException {
397
    return list(params, (RequestOptions) null);
1✔
398
  }
399

400
  /** Returns a list of {@code Reader} objects. */
401
  public static ReaderCollection list(ReaderListParams params, RequestOptions options)
402
      throws StripeException {
403
    String path = "/v1/terminal/readers";
1✔
404
    ApiResource.checkNullTypedParams(path, params);
1✔
405
    ApiRequest request =
1✔
406
        new ApiRequest(
407
            BaseAddress.API,
408
            ApiResource.RequestMethod.GET,
409
            path,
410
            ApiRequestParams.paramsToMap(params),
1✔
411
            options);
412
    return getGlobalResponseGetter().request(request, ReaderCollection.class);
1✔
413
  }
414

415
  /** Initiates a payment flow on a Reader. */
416
  public Reader processPaymentIntent(Map<String, Object> params) throws StripeException {
417
    return processPaymentIntent(params, (RequestOptions) null);
×
418
  }
419

420
  /** Initiates a payment flow on a Reader. */
421
  public Reader processPaymentIntent(Map<String, Object> params, RequestOptions options)
422
      throws StripeException {
423
    String path =
×
424
        String.format(
×
425
            "/v1/terminal/readers/%s/process_payment_intent",
426
            ApiResource.urlEncodeId(this.getId()));
×
427
    ApiRequest request =
×
428
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
429
    return getResponseGetter().request(request, Reader.class);
×
430
  }
431

432
  /** Initiates a payment flow on a Reader. */
433
  public Reader processPaymentIntent(ReaderProcessPaymentIntentParams params)
434
      throws StripeException {
435
    return processPaymentIntent(params, (RequestOptions) null);
1✔
436
  }
437

438
  /** Initiates a payment flow on a Reader. */
439
  public Reader processPaymentIntent(
440
      ReaderProcessPaymentIntentParams params, RequestOptions options) throws StripeException {
441
    String path =
1✔
442
        String.format(
1✔
443
            "/v1/terminal/readers/%s/process_payment_intent",
444
            ApiResource.urlEncodeId(this.getId()));
1✔
445
    ApiResource.checkNullTypedParams(path, params);
1✔
446
    ApiRequest request =
1✔
447
        new ApiRequest(
448
            BaseAddress.API,
449
            ApiResource.RequestMethod.POST,
450
            path,
451
            ApiRequestParams.paramsToMap(params),
1✔
452
            options);
453
    return getResponseGetter().request(request, Reader.class);
1✔
454
  }
455

456
  /** Initiates a setup intent flow on a Reader. */
457
  public Reader processSetupIntent(Map<String, Object> params) throws StripeException {
458
    return processSetupIntent(params, (RequestOptions) null);
×
459
  }
460

461
  /** Initiates a setup intent flow on a Reader. */
462
  public Reader processSetupIntent(Map<String, Object> params, RequestOptions options)
463
      throws StripeException {
464
    String path =
×
465
        String.format(
×
466
            "/v1/terminal/readers/%s/process_setup_intent", ApiResource.urlEncodeId(this.getId()));
×
467
    ApiRequest request =
×
468
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
469
    return getResponseGetter().request(request, Reader.class);
×
470
  }
471

472
  /** Initiates a setup intent flow on a Reader. */
473
  public Reader processSetupIntent(ReaderProcessSetupIntentParams params) throws StripeException {
UNCOV
474
    return processSetupIntent(params, (RequestOptions) null);
×
475
  }
476

477
  /** Initiates a setup intent flow on a Reader. */
478
  public Reader processSetupIntent(ReaderProcessSetupIntentParams params, RequestOptions options)
479
      throws StripeException {
UNCOV
480
    String path =
×
UNCOV
481
        String.format(
×
UNCOV
482
            "/v1/terminal/readers/%s/process_setup_intent", ApiResource.urlEncodeId(this.getId()));
×
UNCOV
483
    ApiResource.checkNullTypedParams(path, params);
×
UNCOV
484
    ApiRequest request =
×
485
        new ApiRequest(
486
            BaseAddress.API,
487
            ApiResource.RequestMethod.POST,
488
            path,
UNCOV
489
            ApiRequestParams.paramsToMap(params),
×
490
            options);
UNCOV
491
    return getResponseGetter().request(request, Reader.class);
×
492
  }
493

494
  /** Initiates a refund on a Reader. */
495
  public Reader refundPayment() throws StripeException {
496
    return refundPayment((Map<String, Object>) null, (RequestOptions) null);
×
497
  }
498

499
  /** Initiates a refund on a Reader. */
500
  public Reader refundPayment(RequestOptions options) throws StripeException {
501
    return refundPayment((Map<String, Object>) null, options);
×
502
  }
503

504
  /** Initiates a refund on a Reader. */
505
  public Reader refundPayment(Map<String, Object> params) throws StripeException {
506
    return refundPayment(params, (RequestOptions) null);
×
507
  }
508

509
  /** Initiates a refund on a Reader. */
510
  public Reader refundPayment(Map<String, Object> params, RequestOptions options)
511
      throws StripeException {
512
    String path =
×
513
        String.format(
×
514
            "/v1/terminal/readers/%s/refund_payment", ApiResource.urlEncodeId(this.getId()));
×
515
    ApiRequest request =
×
516
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
517
    return getResponseGetter().request(request, Reader.class);
×
518
  }
519

520
  /** Initiates a refund on a Reader. */
521
  public Reader refundPayment(ReaderRefundPaymentParams params) throws StripeException {
522
    return refundPayment(params, (RequestOptions) null);
×
523
  }
524

525
  /** Initiates a refund on a Reader. */
526
  public Reader refundPayment(ReaderRefundPaymentParams params, RequestOptions options)
527
      throws StripeException {
528
    String path =
×
529
        String.format(
×
530
            "/v1/terminal/readers/%s/refund_payment", ApiResource.urlEncodeId(this.getId()));
×
531
    ApiResource.checkNullTypedParams(path, params);
×
532
    ApiRequest request =
×
533
        new ApiRequest(
534
            BaseAddress.API,
535
            ApiResource.RequestMethod.POST,
536
            path,
537
            ApiRequestParams.paramsToMap(params),
×
538
            options);
539
    return getResponseGetter().request(request, Reader.class);
×
540
  }
541

542
  /** Retrieves a {@code Reader} object. */
543
  public static Reader retrieve(String reader) throws StripeException {
544
    return retrieve(reader, (Map<String, Object>) null, (RequestOptions) null);
1✔
545
  }
546

547
  /** Retrieves a {@code Reader} object. */
548
  public static Reader retrieve(String reader, RequestOptions options) throws StripeException {
549
    return retrieve(reader, (Map<String, Object>) null, options);
×
550
  }
551

552
  /** Retrieves a {@code Reader} object. */
553
  public static Reader retrieve(String reader, Map<String, Object> params, RequestOptions options)
554
      throws StripeException {
555
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader));
1✔
556
    ApiRequest request =
1✔
557
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
558
    return getGlobalResponseGetter().request(request, Reader.class);
1✔
559
  }
560

561
  /** Retrieves a {@code Reader} object. */
562
  public static Reader retrieve(String reader, ReaderRetrieveParams params, RequestOptions options)
563
      throws StripeException {
564
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader));
×
565
    ApiResource.checkNullTypedParams(path, params);
×
566
    ApiRequest request =
×
567
        new ApiRequest(
568
            BaseAddress.API,
569
            ApiResource.RequestMethod.GET,
570
            path,
571
            ApiRequestParams.paramsToMap(params),
×
572
            options);
573
    return getGlobalResponseGetter().request(request, Reader.class);
×
574
  }
575

576
  /** Sets reader display to show cart details. */
577
  public Reader setReaderDisplay(Map<String, Object> params) throws StripeException {
578
    return setReaderDisplay(params, (RequestOptions) null);
×
579
  }
580

581
  /** Sets reader display to show cart details. */
582
  public Reader setReaderDisplay(Map<String, Object> params, RequestOptions options)
583
      throws StripeException {
584
    String path =
×
585
        String.format(
×
586
            "/v1/terminal/readers/%s/set_reader_display", ApiResource.urlEncodeId(this.getId()));
×
587
    ApiRequest request =
×
588
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
589
    return getResponseGetter().request(request, Reader.class);
×
590
  }
591

592
  /** Sets reader display to show cart details. */
593
  public Reader setReaderDisplay(ReaderSetReaderDisplayParams params) throws StripeException {
594
    return setReaderDisplay(params, (RequestOptions) null);
×
595
  }
596

597
  /** Sets reader display to show cart details. */
598
  public Reader setReaderDisplay(ReaderSetReaderDisplayParams params, RequestOptions options)
599
      throws StripeException {
600
    String path =
×
601
        String.format(
×
602
            "/v1/terminal/readers/%s/set_reader_display", ApiResource.urlEncodeId(this.getId()));
×
603
    ApiResource.checkNullTypedParams(path, params);
×
604
    ApiRequest request =
×
605
        new ApiRequest(
606
            BaseAddress.API,
607
            ApiResource.RequestMethod.POST,
608
            path,
609
            ApiRequestParams.paramsToMap(params),
×
610
            options);
611
    return getResponseGetter().request(request, Reader.class);
×
612
  }
613

614
  /**
615
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
616
   * not provided will be left unchanged.
617
   */
618
  @Override
619
  public Reader update(Map<String, Object> params) throws StripeException {
620
    return update(params, (RequestOptions) null);
1✔
621
  }
622

623
  /**
624
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
625
   * not provided will be left unchanged.
626
   */
627
  @Override
628
  public Reader update(Map<String, Object> params, RequestOptions options) throws StripeException {
629
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()));
1✔
630
    ApiRequest request =
1✔
631
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
632
    return getResponseGetter().request(request, Reader.class);
1✔
633
  }
634

635
  /**
636
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
637
   * not provided will be left unchanged.
638
   */
639
  public Reader update(ReaderUpdateParams params) throws StripeException {
640
    return update(params, (RequestOptions) null);
1✔
641
  }
642

643
  /**
644
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
645
   * not provided will be left unchanged.
646
   */
647
  public Reader update(ReaderUpdateParams params, RequestOptions options) throws StripeException {
648
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(this.getId()));
1✔
649
    ApiResource.checkNullTypedParams(path, params);
1✔
650
    ApiRequest request =
1✔
651
        new ApiRequest(
652
            BaseAddress.API,
653
            ApiResource.RequestMethod.POST,
654
            path,
655
            ApiRequestParams.paramsToMap(params),
1✔
656
            options);
657
    return getResponseGetter().request(request, Reader.class);
1✔
658
  }
659

660
  /** Represents an action performed by the reader. */
661
  @Getter
662
  @Setter
663
  @EqualsAndHashCode(callSuper = false)
664
  public static class Action extends StripeObject {
×
665
    /** Represents a reader action to collect customer inputs. */
666
    @SerializedName("collect_inputs")
667
    CollectInputs collectInputs;
668

669
    /** Represents a reader action to collect a payment method. */
670
    @SerializedName("collect_payment_method")
671
    CollectPaymentMethod collectPaymentMethod;
672

673
    /** Represents a reader action to confirm a payment. */
674
    @SerializedName("confirm_payment_intent")
675
    ConfirmPaymentIntent confirmPaymentIntent;
676

677
    /** Failure code, only set if status is {@code failed}. */
678
    @SerializedName("failure_code")
679
    String failureCode;
680

681
    /** Detailed failure message, only set if status is {@code failed}. */
682
    @SerializedName("failure_message")
683
    String failureMessage;
684

685
    /** Represents a reader action to process a payment intent. */
686
    @SerializedName("process_payment_intent")
687
    ProcessPaymentIntent processPaymentIntent;
688

689
    /** Represents a reader action to process a setup intent. */
690
    @SerializedName("process_setup_intent")
691
    ProcessSetupIntent processSetupIntent;
692

693
    /** Represents a reader action to refund a payment. */
694
    @SerializedName("refund_payment")
695
    RefundPayment refundPayment;
696

697
    /** Represents a reader action to set the reader display. */
698
    @SerializedName("set_reader_display")
699
    SetReaderDisplay setReaderDisplay;
700

701
    /**
702
     * Status of the action performed by the reader.
703
     *
704
     * <p>One of {@code failed}, {@code in_progress}, or {@code succeeded}.
705
     */
706
    @SerializedName("status")
707
    String status;
708

709
    /**
710
     * Type of action performed by the reader.
711
     *
712
     * <p>One of {@code collect_inputs}, {@code collect_payment_method}, {@code
713
     * confirm_payment_intent}, {@code process_payment_intent}, {@code process_setup_intent}, {@code
714
     * refund_payment}, or {@code set_reader_display}.
715
     */
716
    @SerializedName("type")
717
    String type;
718

719
    /** Represents a reader action to collect customer inputs. */
720
    @Getter
721
    @Setter
722
    @EqualsAndHashCode(callSuper = false)
723
    public static class CollectInputs extends StripeObject {
×
724
      /** List of inputs to be collected. */
725
      @SerializedName("inputs")
726
      List<Reader.Action.CollectInputs.Input> inputs;
727

728
      /**
729
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
730
       * attach to an object. This can be useful for storing additional information about the object
731
       * in a structured format.
732
       */
733
      @SerializedName("metadata")
734
      Map<String, String> metadata;
735

736
      /** Represents an input to be collected using the reader. */
737
      @Getter
738
      @Setter
739
      @EqualsAndHashCode(callSuper = false)
740
      public static class Input extends StripeObject {
×
741
        /** Default text of input being collected. */
742
        @SerializedName("custom_text")
743
        CustomText customText;
744

745
        /** Information about a email being collected using a reader. */
746
        @SerializedName("email")
747
        Email email;
748

749
        /** Information about a number being collected using a reader. */
750
        @SerializedName("numeric")
751
        Numeric numeric;
752

753
        /** Information about a phone number being collected using a reader. */
754
        @SerializedName("phone")
755
        Phone phone;
756

757
        /** Indicate that this input is required, disabling the skip button. */
758
        @SerializedName("required")
759
        Boolean required;
760

761
        /** Information about a selection being collected using a reader. */
762
        @SerializedName("selection")
763
        Selection selection;
764

765
        /** Information about a signature being collected using a reader. */
766
        @SerializedName("signature")
767
        Signature signature;
768

769
        /** Indicate that this input was skipped by the user. */
770
        @SerializedName("skipped")
771
        Boolean skipped;
772

773
        /** Information about text being collected using a reader. */
774
        @SerializedName("text")
775
        Text text;
776

777
        /** List of toggles being collected. Values are present if collection is complete. */
778
        @SerializedName("toggles")
779
        List<Reader.Action.CollectInputs.Input.Toggle> toggles;
780

781
        /**
782
         * Type of input being collected.
783
         *
784
         * <p>One of {@code email}, {@code numeric}, {@code phone}, {@code selection}, {@code
785
         * signature}, or {@code text}.
786
         */
787
        @SerializedName("type")
788
        String type;
789

790
        /** Represents custom text to be displayed when collecting the input using a reader. */
791
        @Getter
792
        @Setter
793
        @EqualsAndHashCode(callSuper = false)
794
        public static class CustomText extends StripeObject {
×
795
          /** Customize the default description for this input. */
796
          @SerializedName("description")
797
          String description;
798

799
          /** Customize the default label for this input's skip button. */
800
          @SerializedName("skip_button")
801
          String skipButton;
802

803
          /** Customize the default label for this input's submit button. */
804
          @SerializedName("submit_button")
805
          String submitButton;
806

807
          /** Customize the default title for this input. */
808
          @SerializedName("title")
809
          String title;
810
        }
811

812
        /** Information about a email being collected using a reader. */
813
        @Getter
814
        @Setter
815
        @EqualsAndHashCode(callSuper = false)
816
        public static class Email extends StripeObject {
×
817
          /** The collected email address. */
818
          @SerializedName("value")
819
          String value;
820
        }
821

822
        /** Information about a number being collected using a reader. */
823
        @Getter
824
        @Setter
825
        @EqualsAndHashCode(callSuper = false)
826
        public static class Numeric extends StripeObject {
×
827
          /** The collected number. */
828
          @SerializedName("value")
829
          String value;
830
        }
831

832
        /** Information about a phone number being collected using a reader. */
833
        @Getter
834
        @Setter
835
        @EqualsAndHashCode(callSuper = false)
836
        public static class Phone extends StripeObject {
×
837
          /** The collected phone number. */
838
          @SerializedName("value")
839
          String value;
840
        }
841

842
        /** Information about a selection being collected using a reader. */
843
        @Getter
844
        @Setter
845
        @EqualsAndHashCode(callSuper = false)
846
        public static class Selection extends StripeObject {
×
847
          /** List of possible choices to be selected. */
848
          @SerializedName("choices")
849
          List<Reader.Action.CollectInputs.Input.Selection.Choice> choices;
850

851
          /** The value of the selected choice. */
852
          @SerializedName("value")
853
          String value;
854

855
          /** Choice to be selected on a Reader. */
856
          @Getter
857
          @Setter
858
          @EqualsAndHashCode(callSuper = false)
859
          public static class Choice extends StripeObject {
×
860
            /**
861
             * The button style for the choice
862
             *
863
             * <p>One of {@code primary}, or {@code secondary}.
864
             */
865
            @SerializedName("style")
866
            String style;
867

868
            /** A value to be selected. */
869
            @SerializedName("value")
870
            String value;
871
          }
872
        }
873

874
        /** Information about a signature being collected using a reader. */
875
        @Getter
876
        @Setter
877
        @EqualsAndHashCode(callSuper = false)
878
        public static class Signature extends StripeObject {
×
879
          /** The File ID of a collected signature image. */
880
          @SerializedName("value")
881
          String value;
882
        }
883

884
        /** Information about text being collected using a reader. */
885
        @Getter
886
        @Setter
887
        @EqualsAndHashCode(callSuper = false)
888
        public static class Text extends StripeObject {
×
889
          /** The collected text value. */
890
          @SerializedName("value")
891
          String value;
892
        }
893

894
        /** Information about an input's toggle. */
895
        @Getter
896
        @Setter
897
        @EqualsAndHashCode(callSuper = false)
898
        public static class Toggle extends StripeObject {
×
899
          /**
900
           * The toggle's default value
901
           *
902
           * <p>One of {@code disabled}, or {@code enabled}.
903
           */
904
          @SerializedName("default_value")
905
          String defaultValue;
906

907
          /** The toggle's description text. */
908
          @SerializedName("description")
909
          String description;
910

911
          /** The toggle's title text. */
912
          @SerializedName("title")
913
          String title;
914

915
          /**
916
           * The toggle's collected value
917
           *
918
           * <p>One of {@code disabled}, or {@code enabled}.
919
           */
920
          @SerializedName("value")
921
          String value;
922
        }
923
      }
924
    }
925

926
    /** Represents a reader action to collect a payment method. */
927
    @Getter
928
    @Setter
929
    @EqualsAndHashCode(callSuper = false)
930
    public static class CollectPaymentMethod extends StripeObject {
×
931
      /** Represents a per-transaction override of a reader configuration. */
932
      @SerializedName("collect_config")
933
      CollectConfig collectConfig;
934

935
      /** Most recent PaymentIntent processed by the reader. */
936
      @SerializedName("payment_intent")
937
      @Getter(lombok.AccessLevel.NONE)
938
      @Setter(lombok.AccessLevel.NONE)
939
      ExpandableField<PaymentIntent> paymentIntent;
940

941
      /**
942
       * PaymentMethod objects represent your customer's payment instruments. You can use them with
943
       * <a href="https://stripe.com/docs/payments/payment-intents">PaymentIntents</a> to collect
944
       * payments or save them to Customer objects to store instrument details for future payments.
945
       *
946
       * <p>Related guides: <a href="https://stripe.com/docs/payments/payment-methods">Payment
947
       * Methods</a> and <a href="https://stripe.com/docs/payments/more-payment-scenarios">More
948
       * Payment Scenarios</a>.
949
       */
950
      @SerializedName("payment_method")
951
      PaymentMethod paymentMethod;
952

953
      @SerializedName("stripe_account")
954
      String stripeAccount;
955

956
      /** Get ID of expandable {@code paymentIntent} object. */
957
      public String getPaymentIntent() {
958
        return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
959
      }
960

961
      public void setPaymentIntent(String id) {
962
        this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
963
      }
×
964

965
      /** Get expanded {@code paymentIntent}. */
966
      public PaymentIntent getPaymentIntentObject() {
967
        return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
968
      }
969

970
      public void setPaymentIntentObject(PaymentIntent expandableObject) {
971
        this.paymentIntent =
×
972
            new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
973
      }
×
974

975
      /** Represents a per-transaction override of a reader configuration. */
976
      @Getter
977
      @Setter
978
      @EqualsAndHashCode(callSuper = false)
979
      public static class CollectConfig extends StripeObject {
×
980
        /** Enable customer initiated cancellation when processing this payment. */
981
        @SerializedName("enable_customer_cancellation")
982
        Boolean enableCustomerCancellation;
983

984
        /** Override showing a tipping selection screen on this transaction. */
985
        @SerializedName("skip_tipping")
986
        Boolean skipTipping;
987

988
        /** Represents a per-transaction tipping configuration. */
989
        @SerializedName("tipping")
990
        Tipping tipping;
991

992
        /** Represents a per-transaction tipping configuration. */
993
        @Getter
994
        @Setter
995
        @EqualsAndHashCode(callSuper = false)
996
        public static class Tipping extends StripeObject {
×
997
          /**
998
           * Amount used to calculate tip suggestions on tipping selection screen for this
999
           * transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents
1000
           * to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
1001
           */
1002
          @SerializedName("amount_eligible")
1003
          Long amountEligible;
1004
        }
1005
      }
1006
    }
1007

1008
    /** Represents a reader action to confirm a payment. */
1009
    @Getter
1010
    @Setter
1011
    @EqualsAndHashCode(callSuper = false)
1012
    public static class ConfirmPaymentIntent extends StripeObject {
×
1013
      /** Most recent PaymentIntent processed by the reader. */
1014
      @SerializedName("payment_intent")
1015
      @Getter(lombok.AccessLevel.NONE)
1016
      @Setter(lombok.AccessLevel.NONE)
1017
      ExpandableField<PaymentIntent> paymentIntent;
1018

1019
      @SerializedName("stripe_account")
1020
      String stripeAccount;
1021

1022
      /** Get ID of expandable {@code paymentIntent} object. */
1023
      public String getPaymentIntent() {
1024
        return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
1025
      }
1026

1027
      public void setPaymentIntent(String id) {
1028
        this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
1029
      }
×
1030

1031
      /** Get expanded {@code paymentIntent}. */
1032
      public PaymentIntent getPaymentIntentObject() {
1033
        return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
1034
      }
1035

1036
      public void setPaymentIntentObject(PaymentIntent expandableObject) {
1037
        this.paymentIntent =
×
1038
            new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
1039
      }
×
1040
    }
1041

1042
    /** Represents a reader action to process a payment intent. */
1043
    @Getter
1044
    @Setter
1045
    @EqualsAndHashCode(callSuper = false)
1046
    public static class ProcessPaymentIntent extends StripeObject {
×
1047
      /** Most recent PaymentIntent processed by the reader. */
1048
      @SerializedName("payment_intent")
1049
      @Getter(lombok.AccessLevel.NONE)
1050
      @Setter(lombok.AccessLevel.NONE)
1051
      ExpandableField<PaymentIntent> paymentIntent;
1052

1053
      /** Represents a per-transaction override of a reader configuration. */
1054
      @SerializedName("process_config")
1055
      ProcessConfig processConfig;
1056

1057
      @SerializedName("stripe_account")
1058
      String stripeAccount;
1059

1060
      /** Get ID of expandable {@code paymentIntent} object. */
1061
      public String getPaymentIntent() {
1062
        return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
1063
      }
1064

1065
      public void setPaymentIntent(String id) {
1066
        this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
1067
      }
×
1068

1069
      /** Get expanded {@code paymentIntent}. */
1070
      public PaymentIntent getPaymentIntentObject() {
1071
        return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
1072
      }
1073

1074
      public void setPaymentIntentObject(PaymentIntent expandableObject) {
1075
        this.paymentIntent =
×
1076
            new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
1077
      }
×
1078

1079
      /** Represents a per-transaction override of a reader configuration. */
1080
      @Getter
1081
      @Setter
1082
      @EqualsAndHashCode(callSuper = false)
1083
      public static class ProcessConfig extends StripeObject {
×
1084
        /** Enable customer initiated cancellation when processing this payment. */
1085
        @SerializedName("enable_customer_cancellation")
1086
        Boolean enableCustomerCancellation;
1087

1088
        /** Override showing a tipping selection screen on this transaction. */
1089
        @SerializedName("skip_tipping")
1090
        Boolean skipTipping;
1091

1092
        /** Represents a per-transaction tipping configuration. */
1093
        @SerializedName("tipping")
1094
        Tipping tipping;
1095

1096
        /** Represents a per-transaction tipping configuration. */
1097
        @Getter
1098
        @Setter
1099
        @EqualsAndHashCode(callSuper = false)
1100
        public static class Tipping extends StripeObject {
×
1101
          /**
1102
           * Amount used to calculate tip suggestions on tipping selection screen for this
1103
           * transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents
1104
           * to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
1105
           */
1106
          @SerializedName("amount_eligible")
1107
          Long amountEligible;
1108
        }
1109
      }
1110
    }
1111

1112
    /** Represents a reader action to process a setup intent. */
1113
    @Getter
1114
    @Setter
1115
    @EqualsAndHashCode(callSuper = false)
1116
    public static class ProcessSetupIntent extends StripeObject {
×
1117
      /**
1118
       * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be
1119
       * attached to a Customer for future transactions. Only present if it was possible to generate
1120
       * a card PaymentMethod.
1121
       */
1122
      @SerializedName("generated_card")
1123
      String generatedCard;
1124

1125
      /** Represents a per-setup override of a reader configuration. */
1126
      @SerializedName("process_config")
1127
      ProcessConfig processConfig;
1128

1129
      /** Most recent SetupIntent processed by the reader. */
1130
      @SerializedName("setup_intent")
1131
      @Getter(lombok.AccessLevel.NONE)
1132
      @Setter(lombok.AccessLevel.NONE)
1133
      ExpandableField<SetupIntent> setupIntent;
1134

1135
      /** Get ID of expandable {@code setupIntent} object. */
1136
      public String getSetupIntent() {
1137
        return (this.setupIntent != null) ? this.setupIntent.getId() : null;
×
1138
      }
1139

1140
      public void setSetupIntent(String id) {
1141
        this.setupIntent = ApiResource.setExpandableFieldId(id, this.setupIntent);
×
1142
      }
×
1143

1144
      /** Get expanded {@code setupIntent}. */
1145
      public SetupIntent getSetupIntentObject() {
1146
        return (this.setupIntent != null) ? this.setupIntent.getExpanded() : null;
×
1147
      }
1148

1149
      public void setSetupIntentObject(SetupIntent expandableObject) {
1150
        this.setupIntent =
×
1151
            new ExpandableField<SetupIntent>(expandableObject.getId(), expandableObject);
×
1152
      }
×
1153

1154
      /** Represents a per-setup override of a reader configuration. */
1155
      @Getter
1156
      @Setter
1157
      @EqualsAndHashCode(callSuper = false)
1158
      public static class ProcessConfig extends StripeObject {
×
1159
        /** Enable customer initiated cancellation when processing this SetupIntent. */
1160
        @SerializedName("enable_customer_cancellation")
1161
        Boolean enableCustomerCancellation;
1162
      }
1163
    }
1164

1165
    /** Represents a reader action to refund a payment. */
1166
    @Getter
1167
    @Setter
1168
    @EqualsAndHashCode(callSuper = false)
1169
    public static class RefundPayment extends StripeObject {
×
1170
      /** The amount being refunded. */
1171
      @SerializedName("amount")
1172
      Long amount;
1173

1174
      /** Charge that is being refunded. */
1175
      @SerializedName("charge")
1176
      @Getter(lombok.AccessLevel.NONE)
1177
      @Setter(lombok.AccessLevel.NONE)
1178
      ExpandableField<Charge> charge;
1179

1180
      /**
1181
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
1182
       * attach to an object. This can be useful for storing additional information about the object
1183
       * in a structured format.
1184
       */
1185
      @SerializedName("metadata")
1186
      Map<String, String> metadata;
1187

1188
      /** Payment intent that is being refunded. */
1189
      @SerializedName("payment_intent")
1190
      @Getter(lombok.AccessLevel.NONE)
1191
      @Setter(lombok.AccessLevel.NONE)
1192
      ExpandableField<PaymentIntent> paymentIntent;
1193

1194
      /**
1195
       * The reason for the refund.
1196
       *
1197
       * <p>One of {@code duplicate}, {@code fraudulent}, or {@code requested_by_customer}.
1198
       */
1199
      @SerializedName("reason")
1200
      String reason;
1201

1202
      /** Unique identifier for the refund object. */
1203
      @SerializedName("refund")
1204
      @Getter(lombok.AccessLevel.NONE)
1205
      @Setter(lombok.AccessLevel.NONE)
1206
      ExpandableField<Refund> refund;
1207

1208
      /**
1209
       * Boolean indicating whether the application fee should be refunded when refunding this
1210
       * charge. If a full charge refund is given, the full application fee will be refunded.
1211
       * Otherwise, the application fee will be refunded in an amount proportional to the amount of
1212
       * the charge refunded. An application fee can be refunded only by the application that
1213
       * created the charge.
1214
       */
1215
      @SerializedName("refund_application_fee")
1216
      Boolean refundApplicationFee;
1217

1218
      /** Represents a per-transaction override of a reader configuration. */
1219
      @SerializedName("refund_payment_config")
1220
      RefundPaymentConfig refundPaymentConfig;
1221

1222
      /**
1223
       * Boolean indicating whether the transfer should be reversed when refunding this charge. The
1224
       * transfer will be reversed proportionally to the amount being refunded (either the entire or
1225
       * partial amount). A transfer can be reversed only by the application that created the
1226
       * charge.
1227
       */
1228
      @SerializedName("reverse_transfer")
1229
      Boolean reverseTransfer;
1230

1231
      @SerializedName("stripe_account")
1232
      String stripeAccount;
1233

1234
      /** Get ID of expandable {@code charge} object. */
1235
      public String getCharge() {
1236
        return (this.charge != null) ? this.charge.getId() : null;
×
1237
      }
1238

1239
      public void setCharge(String id) {
1240
        this.charge = ApiResource.setExpandableFieldId(id, this.charge);
×
1241
      }
×
1242

1243
      /** Get expanded {@code charge}. */
1244
      public Charge getChargeObject() {
1245
        return (this.charge != null) ? this.charge.getExpanded() : null;
×
1246
      }
1247

1248
      public void setChargeObject(Charge expandableObject) {
1249
        this.charge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
×
1250
      }
×
1251

1252
      /** Get ID of expandable {@code paymentIntent} object. */
1253
      public String getPaymentIntent() {
1254
        return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
1255
      }
1256

1257
      public void setPaymentIntent(String id) {
1258
        this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
1259
      }
×
1260

1261
      /** Get expanded {@code paymentIntent}. */
1262
      public PaymentIntent getPaymentIntentObject() {
1263
        return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
1264
      }
1265

1266
      public void setPaymentIntentObject(PaymentIntent expandableObject) {
1267
        this.paymentIntent =
×
1268
            new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
1269
      }
×
1270

1271
      /** Get ID of expandable {@code refund} object. */
1272
      public String getRefund() {
1273
        return (this.refund != null) ? this.refund.getId() : null;
×
1274
      }
1275

1276
      public void setRefund(String id) {
1277
        this.refund = ApiResource.setExpandableFieldId(id, this.refund);
×
1278
      }
×
1279

1280
      /** Get expanded {@code refund}. */
1281
      public Refund getRefundObject() {
1282
        return (this.refund != null) ? this.refund.getExpanded() : null;
×
1283
      }
1284

1285
      public void setRefundObject(Refund expandableObject) {
1286
        this.refund = new ExpandableField<Refund>(expandableObject.getId(), expandableObject);
×
1287
      }
×
1288

1289
      /** Represents a per-transaction override of a reader configuration. */
1290
      @Getter
1291
      @Setter
1292
      @EqualsAndHashCode(callSuper = false)
1293
      public static class RefundPaymentConfig extends StripeObject {
×
1294
        /** Enable customer initiated cancellation when refunding this payment. */
1295
        @SerializedName("enable_customer_cancellation")
1296
        Boolean enableCustomerCancellation;
1297
      }
1298
    }
1299

1300
    /** Represents a reader action to set the reader display. */
1301
    @Getter
1302
    @Setter
1303
    @EqualsAndHashCode(callSuper = false)
1304
    public static class SetReaderDisplay extends StripeObject {
×
1305
      /** Cart object to be displayed by the reader. */
1306
      @SerializedName("cart")
1307
      Cart cart;
1308

1309
      /**
1310
       * Type of information to be displayed by the reader.
1311
       *
1312
       * <p>Equal to {@code cart}.
1313
       */
1314
      @SerializedName("type")
1315
      String type;
1316

1317
      /** Represents a cart to be displayed on the reader. */
1318
      @Getter
1319
      @Setter
1320
      @EqualsAndHashCode(callSuper = false)
1321
      public static class Cart extends StripeObject {
×
1322
        /**
1323
         * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1324
         * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1325
         * currency</a>.
1326
         */
1327
        @SerializedName("currency")
1328
        String currency;
1329

1330
        /** List of line items in the cart. */
1331
        @SerializedName("line_items")
1332
        List<Reader.Action.SetReaderDisplay.Cart.LineItem> lineItems;
1333

1334
        /**
1335
         * Tax amount for the entire cart. A positive integer in the <a
1336
         * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
1337
         */
1338
        @SerializedName("tax")
1339
        Long tax;
1340

1341
        /**
1342
         * Total amount for the entire cart, including tax. A positive integer in the <a
1343
         * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
1344
         */
1345
        @SerializedName("total")
1346
        Long total;
1347

1348
        /** Represents a line item to be displayed on the reader. */
1349
        @Getter
1350
        @Setter
1351
        @EqualsAndHashCode(callSuper = false)
1352
        public static class LineItem extends StripeObject {
×
1353
          /**
1354
           * The amount of the line item. A positive integer in the <a
1355
           * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
1356
           */
1357
          @SerializedName("amount")
1358
          Long amount;
1359

1360
          /** Description of the line item. */
1361
          @SerializedName("description")
1362
          String description;
1363

1364
          /** The quantity of the line item. */
1365
          @SerializedName("quantity")
1366
          Long quantity;
1367
        }
1368
      }
1369
    }
1370
  }
1371

1372
  public TestHelpers getTestHelpers() {
1373
    return new TestHelpers(this);
1✔
1374
  }
1375

1376
  public static class TestHelpers {
1377
    private final Reader resource;
1378

1379
    private TestHelpers(Reader resource) {
1✔
1380
      this.resource = resource;
1✔
1381
    }
1✔
1382

1383
    /**
1384
     * Presents a payment method on a simulated reader. Can be used to simulate accepting a payment,
1385
     * saving a card or refunding a transaction.
1386
     */
1387
    public Reader presentPaymentMethod() throws StripeException {
1388
      return presentPaymentMethod((Map<String, Object>) null, (RequestOptions) null);
1✔
1389
    }
1390

1391
    /**
1392
     * Presents a payment method on a simulated reader. Can be used to simulate accepting a payment,
1393
     * saving a card or refunding a transaction.
1394
     */
1395
    public Reader presentPaymentMethod(RequestOptions options) throws StripeException {
1396
      return presentPaymentMethod((Map<String, Object>) null, options);
×
1397
    }
1398

1399
    /**
1400
     * Presents a payment method on a simulated reader. Can be used to simulate accepting a payment,
1401
     * saving a card or refunding a transaction.
1402
     */
1403
    public Reader presentPaymentMethod(Map<String, Object> params) throws StripeException {
1404
      return presentPaymentMethod(params, (RequestOptions) null);
×
1405
    }
1406

1407
    /**
1408
     * Presents a payment method on a simulated reader. Can be used to simulate accepting a payment,
1409
     * saving a card or refunding a transaction.
1410
     */
1411
    public Reader presentPaymentMethod(Map<String, Object> params, RequestOptions options)
1412
        throws StripeException {
1413
      String path =
1✔
1414
          String.format(
1✔
1415
              "/v1/test_helpers/terminal/readers/%s/present_payment_method",
1416
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
1417
      ApiRequest request =
1✔
1418
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
1419
      return resource.getResponseGetter().request(request, Reader.class);
1✔
1420
    }
1421

1422
    /**
1423
     * Presents a payment method on a simulated reader. Can be used to simulate accepting a payment,
1424
     * saving a card or refunding a transaction.
1425
     */
1426
    public Reader presentPaymentMethod(ReaderPresentPaymentMethodParams params)
1427
        throws StripeException {
1428
      return presentPaymentMethod(params, (RequestOptions) null);
×
1429
    }
1430

1431
    /**
1432
     * Presents a payment method on a simulated reader. Can be used to simulate accepting a payment,
1433
     * saving a card or refunding a transaction.
1434
     */
1435
    public Reader presentPaymentMethod(
1436
        ReaderPresentPaymentMethodParams params, RequestOptions options) throws StripeException {
1437
      String path =
×
1438
          String.format(
×
1439
              "/v1/test_helpers/terminal/readers/%s/present_payment_method",
1440
              ApiResource.urlEncodeId(this.resource.getId()));
×
1441
      ApiResource.checkNullTypedParams(path, params);
×
1442
      ApiRequest request =
×
1443
          new ApiRequest(
1444
              BaseAddress.API,
1445
              ApiResource.RequestMethod.POST,
1446
              path,
1447
              ApiRequestParams.paramsToMap(params),
×
1448
              options);
1449
      return resource.getResponseGetter().request(request, Reader.class);
×
1450
    }
1451
  }
1452

1453
  @Override
1454
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1455
    super.setResponseGetter(responseGetter);
1✔
1456
    trySetResponseGetter(action, responseGetter);
1✔
1457
    trySetResponseGetter(location, responseGetter);
1✔
1458
  }
1✔
1459
}
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