• 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

13.92
/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.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 ReaderProcessPaymentIntentParams extends ApiRequestParams {
14
  /** Specifies which fields in the response should be expanded. */
15
  @SerializedName("expand")
16
  List<String> expand;
17

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

27
  /** <strong>Required.</strong> PaymentIntent ID */
28
  @SerializedName("payment_intent")
29
  String paymentIntent;
30

31
  /** Configuration overrides. */
32
  @SerializedName("process_config")
33
  ProcessConfig processConfig;
34

35
  private ReaderProcessPaymentIntentParams(
36
      List<String> expand,
37
      Map<String, Object> extraParams,
38
      String paymentIntent,
39
      ProcessConfig processConfig) {
1✔
40
    this.expand = expand;
1✔
41
    this.extraParams = extraParams;
1✔
42
    this.paymentIntent = paymentIntent;
1✔
43
    this.processConfig = processConfig;
1✔
44
  }
1✔
45

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

50
  public static class Builder {
1✔
51
    private List<String> expand;
52

53
    private Map<String, Object> extraParams;
54

55
    private String paymentIntent;
56

57
    private ProcessConfig processConfig;
58

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

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

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

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

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

117
    /** <strong>Required.</strong> PaymentIntent ID */
118
    public Builder setPaymentIntent(String paymentIntent) {
119
      this.paymentIntent = paymentIntent;
1✔
120
      return this;
1✔
121
    }
122

123
    /** Configuration overrides. */
124
    public Builder setProcessConfig(ReaderProcessPaymentIntentParams.ProcessConfig processConfig) {
125
      this.processConfig = processConfig;
×
126
      return this;
×
127
    }
128
  }
129

130
  @Getter
131
  public static class ProcessConfig {
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 ProcessConfig(
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 ReaderProcessPaymentIntentParams.ProcessConfig build() {
191
        return new ReaderProcessPaymentIntentParams.ProcessConfig(
×
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
          ReaderProcessPaymentIntentParams.ProcessConfig.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
       * ReaderProcessPaymentIntentParams.ProcessConfig#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 ReaderProcessPaymentIntentParams.ProcessConfig#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(ReaderProcessPaymentIntentParams.ProcessConfig.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 ReaderProcessPaymentIntentParams.ProcessConfig.Tipping build() {
291
          return new ReaderProcessPaymentIntentParams.ProcessConfig.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 ReaderProcessPaymentIntentParams.ProcessConfig.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 ReaderProcessPaymentIntentParams.ProcessConfig.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