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

stripe / stripe-java / #16624

07 Nov 2024 10:04PM UTC coverage: 12.419% (-0.1%) from 12.519%
#16624

push

github

web-flow
Merge pull request #1917 from stripe/latest-codegen-beta

Update generated code for beta

17 of 1341 new or added lines in 57 files covered. (1.27%)

33 existing lines in 29 files now uncovered.

18855 of 151828 relevant lines covered (12.42%)

0.12 hits per line

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

0.0
/src/main/java/com/stripe/model/PaymentAttemptRecord.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.net.StripeResponseGetter;
12
import com.stripe.param.PaymentAttemptRecordListParams;
13
import com.stripe.param.PaymentAttemptRecordRetrieveParams;
14
import java.util.Map;
15
import lombok.EqualsAndHashCode;
16
import lombok.Getter;
17
import lombok.Setter;
18

19
/**
20
 * A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe.
21
 * Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment
22
 * method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment
23
 * Record can have guaranteed funds.
24
 */
25
@Getter
26
@Setter
27
@EqualsAndHashCode(callSuper = false)
NEW
28
public class PaymentAttemptRecord extends ApiResource implements HasId {
×
29
  /** A representation of an amount of money, consisting of an amount and a currency. */
30
  @SerializedName("amount_canceled")
31
  AmountCanceled amountCanceled;
32

33
  /** A representation of an amount of money, consisting of an amount and a currency. */
34
  @SerializedName("amount_failed")
35
  AmountFailed amountFailed;
36

37
  /** A representation of an amount of money, consisting of an amount and a currency. */
38
  @SerializedName("amount_guaranteed")
39
  AmountGuaranteed amountGuaranteed;
40

41
  /** A representation of an amount of money, consisting of an amount and a currency. */
42
  @SerializedName("amount_requested")
43
  AmountRequested amountRequested;
44

45
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
46
  @SerializedName("created")
47
  Long created;
48

49
  /** Customer information for this payment. */
50
  @SerializedName("customer_details")
51
  CustomerDetails customerDetails;
52

53
  /**
54
   * Indicates whether the customer was present in your checkout flow during this payment.
55
   *
56
   * <p>One of {@code off_session}, or {@code on_session}.
57
   */
58
  @SerializedName("customer_presence")
59
  String customerPresence;
60

61
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
62
  @SerializedName("description")
63
  String description;
64

65
  /** Unique identifier for the object. */
66
  @Getter(onMethod_ = {@Override})
67
  @SerializedName("id")
68
  String id;
69

70
  /**
71
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
72
   * object exists in test mode.
73
   */
74
  @SerializedName("livemode")
75
  Boolean livemode;
76

77
  /**
78
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
79
   * to an object. This can be useful for storing additional information about the object in a
80
   * structured format.
81
   */
82
  @SerializedName("metadata")
83
  Map<String, String> metadata;
84

85
  /**
86
   * String representing the object's type. Objects of the same type share the same value.
87
   *
88
   * <p>Equal to {@code payment_attempt_record}.
89
   */
90
  @SerializedName("object")
91
  String object;
92

93
  /** Information about the Payment Method debited for this payment. */
94
  @SerializedName("payment_method_details")
95
  PaymentMethodDetails paymentMethodDetails;
96

97
  /** ID of the Payment Record this Payment Attempt Record belongs to. */
98
  @SerializedName("payment_record")
99
  String paymentRecord;
100

101
  /**
102
   * An opaque string for manual reconciliation of this payment, for example a check number or a
103
   * payment processor ID.
104
   */
105
  @SerializedName("payment_reference")
106
  String paymentReference;
107

108
  /** Shipping information for this payment. */
109
  @SerializedName("shipping_details")
110
  ShippingDetails shippingDetails;
111

112
  /** List all the Payment Attempt Records attached to the specified Payment Record. */
113
  public static PaymentAttemptRecordCollection list(Map<String, Object> params)
114
      throws StripeException {
NEW
115
    return list(params, (RequestOptions) null);
×
116
  }
117

118
  /** List all the Payment Attempt Records attached to the specified Payment Record. */
119
  public static PaymentAttemptRecordCollection list(
120
      Map<String, Object> params, RequestOptions options) throws StripeException {
NEW
121
    String path = "/v1/payment_attempt_records";
×
NEW
122
    ApiRequest request =
×
123
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
NEW
124
    return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.class);
×
125
  }
126

127
  /** List all the Payment Attempt Records attached to the specified Payment Record. */
128
  public static PaymentAttemptRecordCollection list(PaymentAttemptRecordListParams params)
129
      throws StripeException {
NEW
130
    return list(params, (RequestOptions) null);
×
131
  }
132

133
  /** List all the Payment Attempt Records attached to the specified Payment Record. */
134
  public static PaymentAttemptRecordCollection list(
135
      PaymentAttemptRecordListParams params, RequestOptions options) throws StripeException {
NEW
136
    String path = "/v1/payment_attempt_records";
×
NEW
137
    ApiResource.checkNullTypedParams(path, params);
×
NEW
138
    ApiRequest request =
×
139
        new ApiRequest(
140
            BaseAddress.API,
141
            ApiResource.RequestMethod.GET,
142
            path,
NEW
143
            ApiRequestParams.paramsToMap(params),
×
144
            options);
NEW
145
    return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.class);
×
146
  }
147

148
  /** Retrieves a Payment Attempt Record with the given ID. */
149
  public static PaymentAttemptRecord retrieve(String id) throws StripeException {
NEW
150
    return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
×
151
  }
152

153
  /** Retrieves a Payment Attempt Record with the given ID. */
154
  public static PaymentAttemptRecord retrieve(String id, RequestOptions options)
155
      throws StripeException {
NEW
156
    return retrieve(id, (Map<String, Object>) null, options);
×
157
  }
158

159
  /** Retrieves a Payment Attempt Record with the given ID. */
160
  public static PaymentAttemptRecord retrieve(
161
      String id, Map<String, Object> params, RequestOptions options) throws StripeException {
NEW
162
    String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id));
×
NEW
163
    ApiRequest request =
×
164
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
NEW
165
    return getGlobalResponseGetter().request(request, PaymentAttemptRecord.class);
×
166
  }
167

168
  /** Retrieves a Payment Attempt Record with the given ID. */
169
  public static PaymentAttemptRecord retrieve(
170
      String id, PaymentAttemptRecordRetrieveParams params, RequestOptions options)
171
      throws StripeException {
NEW
172
    String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id));
×
NEW
173
    ApiResource.checkNullTypedParams(path, params);
×
NEW
174
    ApiRequest request =
×
175
        new ApiRequest(
176
            BaseAddress.API,
177
            ApiResource.RequestMethod.GET,
178
            path,
NEW
179
            ApiRequestParams.paramsToMap(params),
×
180
            options);
NEW
181
    return getGlobalResponseGetter().request(request, PaymentAttemptRecord.class);
×
182
  }
183

184
  /** A representation of an amount of money, consisting of an amount and a currency. */
185
  @Getter
186
  @Setter
187
  @EqualsAndHashCode(callSuper = false)
NEW
188
  public static class AmountCanceled extends StripeObject {
×
189
    /**
190
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
191
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
192
     * currency</a>.
193
     */
194
    @SerializedName("currency")
195
    String currency;
196

197
    /**
198
     * A positive integer representing the amount in the <a
199
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> e.g., 100
200
     * cents for $1.00 or 100 for ¥100, a zero-decimal currency).
201
     */
202
    @SerializedName("value")
203
    Long value;
204
  }
205

206
  /** A representation of an amount of money, consisting of an amount and a currency. */
207
  @Getter
208
  @Setter
209
  @EqualsAndHashCode(callSuper = false)
NEW
210
  public static class AmountFailed extends StripeObject {
×
211
    /**
212
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
213
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
214
     * currency</a>.
215
     */
216
    @SerializedName("currency")
217
    String currency;
218

219
    /**
220
     * A positive integer representing the amount in the <a
221
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> e.g., 100
222
     * cents for $1.00 or 100 for ¥100, a zero-decimal currency).
223
     */
224
    @SerializedName("value")
225
    Long value;
226
  }
227

228
  /** A representation of an amount of money, consisting of an amount and a currency. */
229
  @Getter
230
  @Setter
231
  @EqualsAndHashCode(callSuper = false)
NEW
232
  public static class AmountGuaranteed extends StripeObject {
×
233
    /**
234
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
235
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
236
     * currency</a>.
237
     */
238
    @SerializedName("currency")
239
    String currency;
240

241
    /**
242
     * A positive integer representing the amount in the <a
243
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> e.g., 100
244
     * cents for $1.00 or 100 for ¥100, a zero-decimal currency).
245
     */
246
    @SerializedName("value")
247
    Long value;
248
  }
249

250
  /** A representation of an amount of money, consisting of an amount and a currency. */
251
  @Getter
252
  @Setter
253
  @EqualsAndHashCode(callSuper = false)
NEW
254
  public static class AmountRequested extends StripeObject {
×
255
    /**
256
     * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
257
     * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
258
     * currency</a>.
259
     */
260
    @SerializedName("currency")
261
    String currency;
262

263
    /**
264
     * A positive integer representing the amount in the <a
265
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> e.g., 100
266
     * cents for $1.00 or 100 for ¥100, a zero-decimal currency).
267
     */
268
    @SerializedName("value")
269
    Long value;
270
  }
271

272
  /** Information about the customer for this payment. */
273
  @Getter
274
  @Setter
275
  @EqualsAndHashCode(callSuper = false)
NEW
276
  public static class CustomerDetails extends StripeObject {
×
277
    /** ID of the Stripe Customer associated with this payment. */
278
    @SerializedName("customer")
279
    String customer;
280

281
    /** The customer's email address. */
282
    @SerializedName("email")
283
    String email;
284

285
    /** The customer's name. */
286
    @SerializedName("name")
287
    String name;
288

289
    /** The customer's phone number. */
290
    @SerializedName("phone")
291
    String phone;
292
  }
293

294
  /** Details about the Payment Method used in this payment attempt. */
295
  @Getter
296
  @Setter
297
  @EqualsAndHashCode(callSuper = false)
NEW
298
  public static class PaymentMethodDetails extends StripeObject {
×
299
    /** The billing details associated with the method of payment. */
300
    @SerializedName("billing_details")
301
    BillingDetails billingDetails;
302

303
    /** Information about the custom (user-defined) payment method used to make this payment. */
304
    @SerializedName("custom")
305
    Custom custom;
306

307
    /** ID of the Stripe PaymentMethod used to make this payment. */
308
    @SerializedName("payment_method")
309
    String paymentMethod;
310

311
    /**
312
     * The type of Payment Method used for this payment attempt.
313
     *
314
     * <p>Equal to {@code custom}.
315
     */
316
    @SerializedName("type")
317
    String type;
318

319
    /** Billing details used by the customer for this payment. */
320
    @Getter
321
    @Setter
322
    @EqualsAndHashCode(callSuper = false)
NEW
323
    public static class BillingDetails extends StripeObject {
×
324
      /** A representation of a physical address. */
325
      @SerializedName("address")
326
      Address address;
327

328
      /** The billing email associated with the method of payment. */
329
      @SerializedName("email")
330
      String email;
331

332
      /** The billing name associated with the method of payment. */
333
      @SerializedName("name")
334
      String name;
335

336
      /** The billing phone number associated with the method of payment. */
337
      @SerializedName("phone")
338
      String phone;
339

340
      /** A representation of a physical address. */
341
      @Getter
342
      @Setter
343
      @EqualsAndHashCode(callSuper = false)
NEW
344
      public static class Address extends StripeObject {
×
345
        /** City, district, suburb, town, or village. */
346
        @SerializedName("city")
347
        String city;
348

349
        /**
350
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
351
         * 3166-1 alpha-2</a>).
352
         */
353
        @SerializedName("country")
354
        String country;
355

356
        /** Address line 1 (e.g., street, PO Box, or company name). */
357
        @SerializedName("line1")
358
        String line1;
359

360
        /** Address line 2 (e.g., apartment, suite, unit, or building). */
361
        @SerializedName("line2")
362
        String line2;
363

364
        /** ZIP or postal code. */
365
        @SerializedName("postal_code")
366
        String postalCode;
367

368
        /** State, county, province, or region. */
369
        @SerializedName("state")
370
        String state;
371
      }
372
    }
373

374
    /**
375
     * Custom Payment Methods represent Payment Method types not modeled directly in the Stripe API.
376
     * This resource consists of details about the custom payment method used for this payment
377
     * attempt.
378
     */
379
    @Getter
380
    @Setter
381
    @EqualsAndHashCode(callSuper = false)
NEW
382
    public static class Custom extends StripeObject {
×
383
      /**
384
       * Display name for the custom (user-defined) payment method type used to make this payment.
385
       */
386
      @SerializedName("display_name")
387
      String displayName;
388

389
      /** The custom payment method type associated with this payment. */
390
      @SerializedName("type")
391
      String type;
392
    }
393
  }
394

395
  /** The customer's shipping information associated with this payment. */
396
  @Getter
397
  @Setter
398
  @EqualsAndHashCode(callSuper = false)
NEW
399
  public static class ShippingDetails extends StripeObject {
×
400
    /** A representation of a physical address. */
401
    @SerializedName("address")
402
    Address address;
403

404
    /** The shipping recipient's name. */
405
    @SerializedName("name")
406
    String name;
407

408
    /** The shipping recipient's phone number. */
409
    @SerializedName("phone")
410
    String phone;
411

412
    /** A representation of a physical address. */
413
    @Getter
414
    @Setter
415
    @EqualsAndHashCode(callSuper = false)
NEW
416
    public static class Address extends StripeObject {
×
417
      /** City, district, suburb, town, or village. */
418
      @SerializedName("city")
419
      String city;
420

421
      /**
422
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
423
       * 3166-1 alpha-2</a>).
424
       */
425
      @SerializedName("country")
426
      String country;
427

428
      /** Address line 1 (e.g., street, PO Box, or company name). */
429
      @SerializedName("line1")
430
      String line1;
431

432
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
433
      @SerializedName("line2")
434
      String line2;
435

436
      /** ZIP or postal code. */
437
      @SerializedName("postal_code")
438
      String postalCode;
439

440
      /** State, county, province, or region. */
441
      @SerializedName("state")
442
      String state;
443
    }
444
  }
445

446
  @Override
447
  public void setResponseGetter(StripeResponseGetter responseGetter) {
NEW
448
    super.setResponseGetter(responseGetter);
×
NEW
449
    trySetResponseGetter(amountCanceled, responseGetter);
×
NEW
450
    trySetResponseGetter(amountFailed, responseGetter);
×
NEW
451
    trySetResponseGetter(amountGuaranteed, responseGetter);
×
NEW
452
    trySetResponseGetter(amountRequested, responseGetter);
×
NEW
453
    trySetResponseGetter(customerDetails, responseGetter);
×
NEW
454
    trySetResponseGetter(paymentMethodDetails, responseGetter);
×
NEW
455
    trySetResponseGetter(shippingDetails, responseGetter);
×
NEW
456
  }
×
457
}
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