• 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

44.94
/src/main/java/com/stripe/service/terminal/ReaderService.java
1
// File generated from our OpenAPI spec
2
package com.stripe.service.terminal;
3

4
import com.google.gson.reflect.TypeToken;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.StripeCollection;
7
import com.stripe.model.terminal.Reader;
8
import com.stripe.net.ApiRequest;
9
import com.stripe.net.ApiRequestParams;
10
import com.stripe.net.ApiResource;
11
import com.stripe.net.ApiService;
12
import com.stripe.net.BaseAddress;
13
import com.stripe.net.RequestOptions;
14
import com.stripe.net.StripeResponseGetter;
15
import com.stripe.param.terminal.ReaderCancelActionParams;
16
import com.stripe.param.terminal.ReaderCollectInputsParams;
17
import com.stripe.param.terminal.ReaderCollectPaymentMethodParams;
18
import com.stripe.param.terminal.ReaderConfirmPaymentIntentParams;
19
import com.stripe.param.terminal.ReaderCreateParams;
20
import com.stripe.param.terminal.ReaderListParams;
21
import com.stripe.param.terminal.ReaderProcessPaymentIntentParams;
22
import com.stripe.param.terminal.ReaderProcessSetupIntentParams;
23
import com.stripe.param.terminal.ReaderRefundPaymentParams;
24
import com.stripe.param.terminal.ReaderRetrieveParams;
25
import com.stripe.param.terminal.ReaderSetReaderDisplayParams;
26
import com.stripe.param.terminal.ReaderUpdateParams;
27

28
public final class ReaderService extends ApiService {
29
  public ReaderService(StripeResponseGetter responseGetter) {
30
    super(responseGetter);
1✔
31
  }
1✔
32

33
  /** Deletes a {@code Reader} object. */
34
  public Reader delete(String reader) throws StripeException {
35
    return delete(reader, (RequestOptions) null);
1✔
36
  }
37
  /** Deletes a {@code Reader} object. */
38
  public Reader delete(String reader, RequestOptions options) throws StripeException {
39
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader));
1✔
40
    ApiRequest request =
1✔
41
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, null, options);
42
    return this.request(request, Reader.class);
1✔
43
  }
44
  /** Retrieves a {@code Reader} object. */
45
  public Reader retrieve(String reader, ReaderRetrieveParams params) throws StripeException {
46
    return retrieve(reader, params, (RequestOptions) null);
1✔
47
  }
48
  /** Retrieves a {@code Reader} object. */
49
  public Reader retrieve(String reader, RequestOptions options) throws StripeException {
50
    return retrieve(reader, (ReaderRetrieveParams) null, options);
×
51
  }
52
  /** Retrieves a {@code Reader} object. */
53
  public Reader retrieve(String reader) throws StripeException {
54
    return retrieve(reader, (ReaderRetrieveParams) null, (RequestOptions) null);
1✔
55
  }
56
  /** Retrieves a {@code Reader} object. */
57
  public Reader retrieve(String reader, ReaderRetrieveParams params, RequestOptions options)
58
      throws StripeException {
59
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader));
1✔
60
    ApiRequest request =
1✔
61
        new ApiRequest(
62
            BaseAddress.API,
63
            ApiResource.RequestMethod.GET,
64
            path,
65
            ApiRequestParams.paramsToMap(params),
1✔
66
            options);
67
    return this.request(request, Reader.class);
1✔
68
  }
69
  /**
70
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
71
   * not provided will be left unchanged.
72
   */
73
  public Reader update(String reader, ReaderUpdateParams params) throws StripeException {
74
    return update(reader, params, (RequestOptions) null);
1✔
75
  }
76
  /**
77
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
78
   * not provided will be left unchanged.
79
   */
80
  public Reader update(String reader, RequestOptions options) throws StripeException {
81
    return update(reader, (ReaderUpdateParams) null, options);
×
82
  }
83
  /**
84
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
85
   * not provided will be left unchanged.
86
   */
87
  public Reader update(String reader) throws StripeException {
88
    return update(reader, (ReaderUpdateParams) null, (RequestOptions) null);
×
89
  }
90
  /**
91
   * Updates a {@code Reader} object by setting the values of the parameters passed. Any parameters
92
   * not provided will be left unchanged.
93
   */
94
  public Reader update(String reader, ReaderUpdateParams params, RequestOptions options)
95
      throws StripeException {
96
    String path = String.format("/v1/terminal/readers/%s", ApiResource.urlEncodeId(reader));
1✔
97
    ApiRequest request =
1✔
98
        new ApiRequest(
99
            BaseAddress.API,
100
            ApiResource.RequestMethod.POST,
101
            path,
102
            ApiRequestParams.paramsToMap(params),
1✔
103
            options);
104
    return this.request(request, Reader.class);
1✔
105
  }
106
  /** Returns a list of {@code Reader} objects. */
107
  public StripeCollection<Reader> list(ReaderListParams params) throws StripeException {
108
    return list(params, (RequestOptions) null);
1✔
109
  }
110
  /** Returns a list of {@code Reader} objects. */
111
  public StripeCollection<Reader> list(RequestOptions options) throws StripeException {
112
    return list((ReaderListParams) null, options);
×
113
  }
114
  /** Returns a list of {@code Reader} objects. */
115
  public StripeCollection<Reader> list() throws StripeException {
116
    return list((ReaderListParams) null, (RequestOptions) null);
×
117
  }
118
  /** Returns a list of {@code Reader} objects. */
119
  public StripeCollection<Reader> list(ReaderListParams params, RequestOptions options)
120
      throws StripeException {
121
    String path = "/v1/terminal/readers";
1✔
122
    ApiRequest request =
1✔
123
        new ApiRequest(
124
            BaseAddress.API,
125
            ApiResource.RequestMethod.GET,
126
            path,
127
            ApiRequestParams.paramsToMap(params),
1✔
128
            options);
129
    return this.request(request, new TypeToken<StripeCollection<Reader>>() {}.getType());
1✔
130
  }
131
  /** Creates a new {@code Reader} object. */
132
  public Reader create(ReaderCreateParams params) throws StripeException {
133
    return create(params, (RequestOptions) null);
1✔
134
  }
135
  /** Creates a new {@code Reader} object. */
136
  public Reader create(ReaderCreateParams params, RequestOptions options) throws StripeException {
137
    String path = "/v1/terminal/readers";
1✔
138
    ApiRequest request =
1✔
139
        new ApiRequest(
140
            BaseAddress.API,
141
            ApiResource.RequestMethod.POST,
142
            path,
143
            ApiRequestParams.paramsToMap(params),
1✔
144
            options);
145
    return this.request(request, Reader.class);
1✔
146
  }
147
  /** Cancels the current reader action. */
148
  public Reader cancelAction(String reader, ReaderCancelActionParams params)
149
      throws StripeException {
150
    return cancelAction(reader, params, (RequestOptions) null);
1✔
151
  }
152
  /** Cancels the current reader action. */
153
  public Reader cancelAction(String reader, RequestOptions options) throws StripeException {
154
    return cancelAction(reader, (ReaderCancelActionParams) null, options);
×
155
  }
156
  /** Cancels the current reader action. */
157
  public Reader cancelAction(String reader) throws StripeException {
158
    return cancelAction(reader, (ReaderCancelActionParams) null, (RequestOptions) null);
×
159
  }
160
  /** Cancels the current reader action. */
161
  public Reader cancelAction(String reader, ReaderCancelActionParams params, RequestOptions options)
162
      throws StripeException {
163
    String path =
1✔
164
        String.format("/v1/terminal/readers/%s/cancel_action", ApiResource.urlEncodeId(reader));
1✔
165
    ApiRequest request =
1✔
166
        new ApiRequest(
167
            BaseAddress.API,
168
            ApiResource.RequestMethod.POST,
169
            path,
170
            ApiRequestParams.paramsToMap(params),
1✔
171
            options);
172
    return this.request(request, Reader.class);
1✔
173
  }
174
  /** Initiates an input collection flow on a Reader. */
175
  public Reader collectInputs(String reader, ReaderCollectInputsParams params)
176
      throws StripeException {
177
    return collectInputs(reader, params, (RequestOptions) null);
×
178
  }
179
  /** Initiates an input collection flow on a Reader. */
180
  public Reader collectInputs(
181
      String reader, ReaderCollectInputsParams params, RequestOptions options)
182
      throws StripeException {
183
    String path =
×
184
        String.format("/v1/terminal/readers/%s/collect_inputs", ApiResource.urlEncodeId(reader));
×
185
    ApiRequest request =
×
186
        new ApiRequest(
187
            BaseAddress.API,
188
            ApiResource.RequestMethod.POST,
189
            path,
190
            ApiRequestParams.paramsToMap(params),
×
191
            options);
192
    return this.request(request, Reader.class);
×
193
  }
194
  /**
195
   * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before
196
   * manual confirmation.
197
   */
198
  public Reader collectPaymentMethod(String reader, ReaderCollectPaymentMethodParams params)
199
      throws StripeException {
200
    return collectPaymentMethod(reader, params, (RequestOptions) null);
×
201
  }
202
  /**
203
   * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before
204
   * manual confirmation.
205
   */
206
  public Reader collectPaymentMethod(
207
      String reader, ReaderCollectPaymentMethodParams params, RequestOptions options)
208
      throws StripeException {
209
    String path =
×
210
        String.format(
×
211
            "/v1/terminal/readers/%s/collect_payment_method", ApiResource.urlEncodeId(reader));
×
212
    ApiRequest request =
×
213
        new ApiRequest(
214
            BaseAddress.API,
215
            ApiResource.RequestMethod.POST,
216
            path,
217
            ApiRequestParams.paramsToMap(params),
×
218
            options);
219
    return this.request(request, Reader.class);
×
220
  }
221
  /** Finalizes a payment on a Reader. */
222
  public Reader confirmPaymentIntent(String reader, ReaderConfirmPaymentIntentParams params)
223
      throws StripeException {
224
    return confirmPaymentIntent(reader, params, (RequestOptions) null);
×
225
  }
226
  /** Finalizes a payment on a Reader. */
227
  public Reader confirmPaymentIntent(
228
      String reader, ReaderConfirmPaymentIntentParams params, RequestOptions options)
229
      throws StripeException {
230
    String path =
×
231
        String.format(
×
232
            "/v1/terminal/readers/%s/confirm_payment_intent", ApiResource.urlEncodeId(reader));
×
233
    ApiRequest request =
×
234
        new ApiRequest(
235
            BaseAddress.API,
236
            ApiResource.RequestMethod.POST,
237
            path,
238
            ApiRequestParams.paramsToMap(params),
×
239
            options);
240
    return this.request(request, Reader.class);
×
241
  }
242
  /** Initiates a payment flow on a Reader. */
243
  public Reader processPaymentIntent(String reader, ReaderProcessPaymentIntentParams params)
244
      throws StripeException {
245
    return processPaymentIntent(reader, params, (RequestOptions) null);
1✔
246
  }
247
  /** Initiates a payment flow on a Reader. */
248
  public Reader processPaymentIntent(
249
      String reader, ReaderProcessPaymentIntentParams params, RequestOptions options)
250
      throws StripeException {
251
    String path =
1✔
252
        String.format(
1✔
253
            "/v1/terminal/readers/%s/process_payment_intent", ApiResource.urlEncodeId(reader));
1✔
254
    ApiRequest request =
1✔
255
        new ApiRequest(
256
            BaseAddress.API,
257
            ApiResource.RequestMethod.POST,
258
            path,
259
            ApiRequestParams.paramsToMap(params),
1✔
260
            options);
261
    return this.request(request, Reader.class);
1✔
262
  }
263
  /** Initiates a setup intent flow on a Reader. */
264
  public Reader processSetupIntent(String reader, ReaderProcessSetupIntentParams params)
265
      throws StripeException {
UNCOV
266
    return processSetupIntent(reader, params, (RequestOptions) null);
×
267
  }
268
  /** Initiates a setup intent flow on a Reader. */
269
  public Reader processSetupIntent(
270
      String reader, ReaderProcessSetupIntentParams params, RequestOptions options)
271
      throws StripeException {
UNCOV
272
    String path =
×
UNCOV
273
        String.format(
×
UNCOV
274
            "/v1/terminal/readers/%s/process_setup_intent", ApiResource.urlEncodeId(reader));
×
UNCOV
275
    ApiRequest request =
×
276
        new ApiRequest(
277
            BaseAddress.API,
278
            ApiResource.RequestMethod.POST,
279
            path,
UNCOV
280
            ApiRequestParams.paramsToMap(params),
×
281
            options);
UNCOV
282
    return this.request(request, Reader.class);
×
283
  }
284
  /** Initiates a refund on a Reader. */
285
  public Reader refundPayment(String reader, ReaderRefundPaymentParams params)
286
      throws StripeException {
287
    return refundPayment(reader, params, (RequestOptions) null);
×
288
  }
289
  /** Initiates a refund on a Reader. */
290
  public Reader refundPayment(String reader, RequestOptions options) throws StripeException {
291
    return refundPayment(reader, (ReaderRefundPaymentParams) null, options);
×
292
  }
293
  /** Initiates a refund on a Reader. */
294
  public Reader refundPayment(String reader) throws StripeException {
295
    return refundPayment(reader, (ReaderRefundPaymentParams) null, (RequestOptions) null);
×
296
  }
297
  /** Initiates a refund on a Reader. */
298
  public Reader refundPayment(
299
      String reader, ReaderRefundPaymentParams params, RequestOptions options)
300
      throws StripeException {
301
    String path =
×
302
        String.format("/v1/terminal/readers/%s/refund_payment", ApiResource.urlEncodeId(reader));
×
303
    ApiRequest request =
×
304
        new ApiRequest(
305
            BaseAddress.API,
306
            ApiResource.RequestMethod.POST,
307
            path,
308
            ApiRequestParams.paramsToMap(params),
×
309
            options);
310
    return this.request(request, Reader.class);
×
311
  }
312
  /** Sets reader display to show cart details. */
313
  public Reader setReaderDisplay(String reader, ReaderSetReaderDisplayParams params)
314
      throws StripeException {
315
    return setReaderDisplay(reader, params, (RequestOptions) null);
×
316
  }
317
  /** Sets reader display to show cart details. */
318
  public Reader setReaderDisplay(
319
      String reader, ReaderSetReaderDisplayParams params, RequestOptions options)
320
      throws StripeException {
321
    String path =
×
322
        String.format(
×
323
            "/v1/terminal/readers/%s/set_reader_display", ApiResource.urlEncodeId(reader));
×
324
    ApiRequest request =
×
325
        new ApiRequest(
326
            BaseAddress.API,
327
            ApiResource.RequestMethod.POST,
328
            path,
329
            ApiRequestParams.paramsToMap(params),
×
330
            options);
331
    return this.request(request, Reader.class);
×
332
  }
333
}
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