• 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

0.0
/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java
1
// File generated from our OpenAPI spec
2
package com.stripe.param.terminal;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.net.ApiRequestParams;
6
import java.util.ArrayList;
7
import java.util.HashMap;
8
import java.util.List;
9
import java.util.Map;
10
import lombok.Getter;
11

12
@Getter
13
public class ReaderCollectPaymentMethodParams extends ApiRequestParams {
14
  /** Configuration overrides. */
15
  @SerializedName("collect_config")
16
  CollectConfig collectConfig;
17

18
  /** Specifies which fields in the response should be expanded. */
19
  @SerializedName("expand")
20
  List<String> expand;
21

22
  /**
23
   * Map of extra parameters for custom features not available in this client library. The content
24
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
25
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
26
   * param object. Effectively, this map is flattened to its parent instance.
27
   */
28
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
29
  Map<String, Object> extraParams;
30

31
  /** <strong>Required.</strong> PaymentIntent ID */
32
  @SerializedName("payment_intent")
33
  String paymentIntent;
34

35
  private ReaderCollectPaymentMethodParams(
36
      CollectConfig collectConfig,
37
      List<String> expand,
38
      Map<String, Object> extraParams,
39
      String paymentIntent) {
×
40
    this.collectConfig = collectConfig;
×
41
    this.expand = expand;
×
42
    this.extraParams = extraParams;
×
43
    this.paymentIntent = paymentIntent;
×
44
  }
×
45

46
  public static Builder builder() {
47
    return new Builder();
×
48
  }
49

50
  public static class Builder {
×
51
    private CollectConfig collectConfig;
52

53
    private List<String> expand;
54

55
    private Map<String, Object> extraParams;
56

57
    private String paymentIntent;
58

59
    /** Finalize and obtain parameter instance from this builder. */
60
    public ReaderCollectPaymentMethodParams build() {
61
      return new ReaderCollectPaymentMethodParams(
×
62
          this.collectConfig, this.expand, this.extraParams, this.paymentIntent);
63
    }
64

65
    /** Configuration overrides. */
66
    public Builder setCollectConfig(ReaderCollectPaymentMethodParams.CollectConfig collectConfig) {
67
      this.collectConfig = collectConfig;
×
68
      return this;
×
69
    }
70

71
    /**
72
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
73
     * subsequent calls adds additional elements to the original list. See {@link
74
     * ReaderCollectPaymentMethodParams#expand} for the field documentation.
75
     */
76
    public Builder addExpand(String element) {
77
      if (this.expand == null) {
×
78
        this.expand = new ArrayList<>();
×
79
      }
80
      this.expand.add(element);
×
81
      return this;
×
82
    }
83

84
    /**
85
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
86
     * subsequent calls adds additional elements to the original list. See {@link
87
     * ReaderCollectPaymentMethodParams#expand} for the field documentation.
88
     */
89
    public Builder addAllExpand(List<String> elements) {
90
      if (this.expand == null) {
×
91
        this.expand = new ArrayList<>();
×
92
      }
93
      this.expand.addAll(elements);
×
94
      return this;
×
95
    }
96

97
    /**
98
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
99
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
100
     * ReaderCollectPaymentMethodParams#extraParams} for the field documentation.
101
     */
102
    public Builder putExtraParam(String key, Object value) {
103
      if (this.extraParams == null) {
×
104
        this.extraParams = new HashMap<>();
×
105
      }
106
      this.extraParams.put(key, value);
×
107
      return this;
×
108
    }
109

110
    /**
111
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
112
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
113
     * See {@link ReaderCollectPaymentMethodParams#extraParams} for the field documentation.
114
     */
115
    public Builder putAllExtraParam(Map<String, Object> map) {
116
      if (this.extraParams == null) {
×
117
        this.extraParams = new HashMap<>();
×
118
      }
119
      this.extraParams.putAll(map);
×
120
      return this;
×
121
    }
122

123
    /** <strong>Required.</strong> PaymentIntent ID */
124
    public Builder setPaymentIntent(String paymentIntent) {
125
      this.paymentIntent = paymentIntent;
×
126
      return this;
×
127
    }
128
  }
129

130
  @Getter
131
  public static class CollectConfig {
132
    /**
133
     * This field indicates whether this payment method can be shown again to its customer in a
134
     * checkout flow. Stripe products such as Checkout and Elements use this field to determine
135
     * whether a payment method can be shown as a saved payment method in a checkout flow.
136
     */
137
    @SerializedName("allow_redisplay")
138
    AllowRedisplay allowRedisplay;
139

140
    /** Enables cancel button on transaction screens. */
141
    @SerializedName("enable_customer_cancellation")
142
    Boolean enableCustomerCancellation;
143

144
    /**
145
     * Map of extra parameters for custom features not available in this client library. The content
146
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
147
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
148
     * param object. Effectively, this map is flattened to its parent instance.
149
     */
150
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
151
    Map<String, Object> extraParams;
152

153
    /** Override showing a tipping selection screen on this transaction. */
154
    @SerializedName("skip_tipping")
155
    Boolean skipTipping;
156

157
    /** Tipping configuration for this transaction. */
158
    @SerializedName("tipping")
159
    Tipping tipping;
160

161
    private CollectConfig(
162
        AllowRedisplay allowRedisplay,
163
        Boolean enableCustomerCancellation,
164
        Map<String, Object> extraParams,
165
        Boolean skipTipping,
166
        Tipping tipping) {
×
NEW
167
      this.allowRedisplay = allowRedisplay;
×
168
      this.enableCustomerCancellation = enableCustomerCancellation;
×
169
      this.extraParams = extraParams;
×
170
      this.skipTipping = skipTipping;
×
171
      this.tipping = tipping;
×
172
    }
×
173

174
    public static Builder builder() {
175
      return new Builder();
×
176
    }
177

178
    public static class Builder {
×
179
      private AllowRedisplay allowRedisplay;
180

181
      private Boolean enableCustomerCancellation;
182

183
      private Map<String, Object> extraParams;
184

185
      private Boolean skipTipping;
186

187
      private Tipping tipping;
188

189
      /** Finalize and obtain parameter instance from this builder. */
190
      public ReaderCollectPaymentMethodParams.CollectConfig build() {
191
        return new ReaderCollectPaymentMethodParams.CollectConfig(
×
192
            this.allowRedisplay,
193
            this.enableCustomerCancellation,
194
            this.extraParams,
195
            this.skipTipping,
196
            this.tipping);
197
      }
198

199
      /**
200
       * This field indicates whether this payment method can be shown again to its customer in a
201
       * checkout flow. Stripe products such as Checkout and Elements use this field to determine
202
       * whether a payment method can be shown as a saved payment method in a checkout flow.
203
       */
204
      public Builder setAllowRedisplay(
205
          ReaderCollectPaymentMethodParams.CollectConfig.AllowRedisplay allowRedisplay) {
NEW
206
        this.allowRedisplay = allowRedisplay;
×
NEW
207
        return this;
×
208
      }
209

210
      /** Enables cancel button on transaction screens. */
211
      public Builder setEnableCustomerCancellation(Boolean enableCustomerCancellation) {
212
        this.enableCustomerCancellation = enableCustomerCancellation;
×
213
        return this;
×
214
      }
215

216
      /**
217
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
218
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
219
       * ReaderCollectPaymentMethodParams.CollectConfig#extraParams} for the field documentation.
220
       */
221
      public Builder putExtraParam(String key, Object value) {
222
        if (this.extraParams == null) {
×
223
          this.extraParams = new HashMap<>();
×
224
        }
225
        this.extraParams.put(key, value);
×
226
        return this;
×
227
      }
228

229
      /**
230
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
231
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
232
       * See {@link ReaderCollectPaymentMethodParams.CollectConfig#extraParams} for the field
233
       * documentation.
234
       */
235
      public Builder putAllExtraParam(Map<String, Object> map) {
236
        if (this.extraParams == null) {
×
237
          this.extraParams = new HashMap<>();
×
238
        }
239
        this.extraParams.putAll(map);
×
240
        return this;
×
241
      }
242

243
      /** Override showing a tipping selection screen on this transaction. */
244
      public Builder setSkipTipping(Boolean skipTipping) {
245
        this.skipTipping = skipTipping;
×
246
        return this;
×
247
      }
248

249
      /** Tipping configuration for this transaction. */
250
      public Builder setTipping(ReaderCollectPaymentMethodParams.CollectConfig.Tipping tipping) {
251
        this.tipping = tipping;
×
252
        return this;
×
253
      }
254
    }
255

256
    @Getter
257
    public static class Tipping {
258
      /**
259
       * Amount used to calculate tip suggestions on tipping selection screen for this transaction.
260
       * Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent
261
       * $1.00 or 100 to represent ¥100, a zero-decimal currency).
262
       */
263
      @SerializedName("amount_eligible")
264
      Long amountEligible;
265

266
      /**
267
       * Map of extra parameters for custom features not available in this client library. The
268
       * content in this map is not serialized under this field's {@code @SerializedName} value.
269
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
270
       * name in this param object. Effectively, this map is flattened to its parent instance.
271
       */
272
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
273
      Map<String, Object> extraParams;
274

275
      private Tipping(Long amountEligible, Map<String, Object> extraParams) {
×
276
        this.amountEligible = amountEligible;
×
277
        this.extraParams = extraParams;
×
278
      }
×
279

280
      public static Builder builder() {
281
        return new Builder();
×
282
      }
283

284
      public static class Builder {
×
285
        private Long amountEligible;
286

287
        private Map<String, Object> extraParams;
288

289
        /** Finalize and obtain parameter instance from this builder. */
290
        public ReaderCollectPaymentMethodParams.CollectConfig.Tipping build() {
291
          return new ReaderCollectPaymentMethodParams.CollectConfig.Tipping(
×
292
              this.amountEligible, this.extraParams);
293
        }
294

295
        /**
296
         * Amount used to calculate tip suggestions on tipping selection screen for this
297
         * transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to
298
         * represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
299
         */
300
        public Builder setAmountEligible(Long amountEligible) {
301
          this.amountEligible = amountEligible;
×
302
          return this;
×
303
        }
304

305
        /**
306
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
307
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
308
         * map. See {@link ReaderCollectPaymentMethodParams.CollectConfig.Tipping#extraParams} for
309
         * the field documentation.
310
         */
311
        public Builder putExtraParam(String key, Object value) {
312
          if (this.extraParams == null) {
×
313
            this.extraParams = new HashMap<>();
×
314
          }
315
          this.extraParams.put(key, value);
×
316
          return this;
×
317
        }
318

319
        /**
320
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
321
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
322
         * map. See {@link ReaderCollectPaymentMethodParams.CollectConfig.Tipping#extraParams} for
323
         * the field documentation.
324
         */
325
        public Builder putAllExtraParam(Map<String, Object> map) {
326
          if (this.extraParams == null) {
×
327
            this.extraParams = new HashMap<>();
×
328
          }
329
          this.extraParams.putAll(map);
×
330
          return this;
×
331
        }
332
      }
333
    }
334

NEW
335
    public enum AllowRedisplay implements ApiRequestParams.EnumParam {
×
NEW
336
      @SerializedName("always")
×
337
      ALWAYS("always"),
338

NEW
339
      @SerializedName("limited")
×
340
      LIMITED("limited"),
341

NEW
342
      @SerializedName("unspecified")
×
343
      UNSPECIFIED("unspecified");
344

345
      @Getter(onMethod_ = {@Override})
346
      private final String value;
347

NEW
348
      AllowRedisplay(String value) {
×
NEW
349
        this.value = value;
×
NEW
350
      }
×
351
    }
352
  }
353
}
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