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

stripe / stripe-java / #16623

07 Nov 2024 09:07PM UTC coverage: 12.419% (-0.1%) from 12.519%
#16623

Pull #1917

github

web-flow
Merge 8bc976fd2 into 23267db11
Pull Request #1917: 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/InvoicePayment.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.net.ApiResource;
6
import lombok.EqualsAndHashCode;
7
import lombok.Getter;
8
import lombok.Setter;
9

10
/** The invoice payment object. */
11
@Getter
12
@Setter
13
@EqualsAndHashCode(callSuper = false)
14
public class InvoicePayment extends StripeObject implements HasId {
×
15
  /**
16
   * Excess payment that was received for this invoice and credited to the customer’s {@code
17
   * invoice_credit_balance}. This field is null until the payment is {@code paid}. Overpayment can
18
   * happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds.
19
   * To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more.
20
   */
21
  @SerializedName("amount_overpaid")
22
  Long amountOverpaid;
23

24
  /**
25
   * Amount that was actually paid for this invoice, in cents (or local equivalent). This field is
26
   * null until the payment is {@code paid}. This amount can be less than the {@code
27
   * amount_requested} if the PaymentIntent’s {@code amount_received} is not sufficient to pay all
28
   * of the invoices that it is attached to.
29
   */
30
  @SerializedName("amount_paid")
31
  Long amountPaid;
32

33
  /** Amount intended to be paid toward this invoice, in cents (or local equivalent). */
34
  @SerializedName("amount_requested")
35
  Long amountRequested;
36

37
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
38
  @SerializedName("created")
39
  Long created;
40

41
  /**
42
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
43
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
44
   */
45
  @SerializedName("currency")
46
  String currency;
47

48
  /** Unique identifier for the object. */
49
  @Getter(onMethod_ = {@Override})
50
  @SerializedName("id")
51
  String id;
52

53
  /** The invoice that was paid. */
54
  @SerializedName("invoice")
55
  @Getter(lombok.AccessLevel.NONE)
56
  @Setter(lombok.AccessLevel.NONE)
57
  ExpandableField<Invoice> invoice;
58

59
  /**
60
   * Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps
61
   * it synchronized with the invoice’s {@code amount_remaining}. The PaymentIntent associated with
62
   * the default payment can’t be edited or canceled directly.
63
   */
64
  @SerializedName("is_default")
65
  Boolean isDefault;
66

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

74
  /**
75
   * String representing the object's type. Objects of the same type share the same value.
76
   *
77
   * <p>Equal to {@code invoice_payment}.
78
   */
79
  @SerializedName("object")
80
  String object;
81

82
  @SerializedName("payment")
83
  Payment payment;
84

85
  /** The status of the payment, one of {@code open}, {@code paid}, or {@code canceled}. */
86
  @SerializedName("status")
87
  String status;
88

89
  @SerializedName("status_transitions")
90
  StatusTransitions statusTransitions;
91

92
  /** Get ID of expandable {@code invoice} object. */
93
  public String getInvoice() {
94
    return (this.invoice != null) ? this.invoice.getId() : null;
×
95
  }
96

97
  public void setInvoice(String id) {
98
    this.invoice = ApiResource.setExpandableFieldId(id, this.invoice);
×
99
  }
×
100

101
  /** Get expanded {@code invoice}. */
102
  public Invoice getInvoiceObject() {
103
    return (this.invoice != null) ? this.invoice.getExpanded() : null;
×
104
  }
105

106
  public void setInvoiceObject(Invoice expandableObject) {
107
    this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
×
108
  }
×
109

110
  /**
111
   * For more details about Payment, please refer to the <a href="https://docs.stripe.com/api">API
112
   * Reference.</a>
113
   */
114
  @Getter
115
  @Setter
116
  @EqualsAndHashCode(callSuper = false)
117
  public static class Payment extends StripeObject {
×
118
    /** ID of the successful charge for this payment when {@code type} is {@code charge}. */
119
    @SerializedName("charge")
120
    @Getter(lombok.AccessLevel.NONE)
121
    @Setter(lombok.AccessLevel.NONE)
122
    ExpandableField<Charge> charge;
123

124
    /**
125
     * ID of the PaymentIntent associated with this payment when {@code type} is {@code
126
     * payment_intent}. Note: This property is only populated for invoices finalized on or after
127
     * March 15th, 2019.
128
     */
129
    @SerializedName("payment_intent")
130
    @Getter(lombok.AccessLevel.NONE)
131
    @Setter(lombok.AccessLevel.NONE)
132
    ExpandableField<PaymentIntent> paymentIntent;
133

134
    /**
135
     * ID of the PaymentRecord associated with this payment when {@code type} is {@code
136
     * payment_record}.
137
     */
138
    @SerializedName("payment_record")
139
    @Getter(lombok.AccessLevel.NONE)
140
    @Setter(lombok.AccessLevel.NONE)
141
    ExpandableField<PaymentRecord> paymentRecord;
142

143
    /**
144
     * Type of payment object associated with this invoice payment.
145
     *
146
     * <p>One of {@code charge}, {@code out_of_band_payment}, {@code payment_intent}, or {@code
147
     * payment_record}.
148
     */
149
    @SerializedName("type")
150
    String type;
151

152
    /** Get ID of expandable {@code charge} object. */
153
    public String getCharge() {
154
      return (this.charge != null) ? this.charge.getId() : null;
×
155
    }
156

157
    public void setCharge(String id) {
158
      this.charge = ApiResource.setExpandableFieldId(id, this.charge);
×
159
    }
×
160

161
    /** Get expanded {@code charge}. */
162
    public Charge getChargeObject() {
163
      return (this.charge != null) ? this.charge.getExpanded() : null;
×
164
    }
165

166
    public void setChargeObject(Charge expandableObject) {
167
      this.charge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
×
168
    }
×
169

170
    /** Get ID of expandable {@code paymentIntent} object. */
171
    public String getPaymentIntent() {
172
      return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
173
    }
174

175
    public void setPaymentIntent(String id) {
176
      this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
177
    }
×
178

179
    /** Get expanded {@code paymentIntent}. */
180
    public PaymentIntent getPaymentIntentObject() {
181
      return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
182
    }
183

184
    public void setPaymentIntentObject(PaymentIntent expandableObject) {
185
      this.paymentIntent =
×
186
          new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
187
    }
×
188

189
    /** Get ID of expandable {@code paymentRecord} object. */
190
    public String getPaymentRecord() {
NEW
191
      return (this.paymentRecord != null) ? this.paymentRecord.getId() : null;
×
192
    }
193

194
    public void setPaymentRecord(String id) {
NEW
195
      this.paymentRecord = ApiResource.setExpandableFieldId(id, this.paymentRecord);
×
NEW
196
    }
×
197

198
    /** Get expanded {@code paymentRecord}. */
199
    public PaymentRecord getPaymentRecordObject() {
NEW
200
      return (this.paymentRecord != null) ? this.paymentRecord.getExpanded() : null;
×
201
    }
202

203
    public void setPaymentRecordObject(PaymentRecord expandableObject) {
NEW
204
      this.paymentRecord =
×
NEW
205
          new ExpandableField<PaymentRecord>(expandableObject.getId(), expandableObject);
×
UNCOV
206
    }
×
207
  }
208

209
  /**
210
   * For more details about StatusTransitions, please refer to the <a
211
   * href="https://docs.stripe.com/api">API Reference.</a>
212
   */
213
  @Getter
214
  @Setter
215
  @EqualsAndHashCode(callSuper = false)
216
  public static class StatusTransitions extends StripeObject {
×
217
    /** The time that the payment was canceled. */
218
    @SerializedName("canceled_at")
219
    Long canceledAt;
220

221
    /** The time that the payment succeeded. */
222
    @SerializedName("paid_at")
223
    Long paidAt;
224
  }
225
}
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

© 2025 Coveralls, Inc