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

stripe / stripe-php / 6739065778

02 Nov 2023 10:48PM UTC coverage: 63.972% (-0.3%) from 64.225%
6739065778

push

github

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

Update generated code for beta

15 of 15 new or added lines in 2 files covered. (100.0%)

2429 of 3797 relevant lines covered (63.97%)

3.3 hits per line

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

64.71
/lib/Invoice.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * Invoices are statements of amounts owed by a customer, and are either
9
 * generated one-off, or generated periodically from a subscription.
10
 *
11
 * They contain <a href="https://stripe.com/docs/api#invoiceitems">invoice items</a>, and proration adjustments
12
 * that may be caused by subscription upgrades/downgrades (if necessary).
13
 *
14
 * If your invoice is configured to be billed through automatic charges,
15
 * Stripe automatically finalizes your invoice and attempts payment. Note
16
 * that finalizing the invoice,
17
 * <a href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">when automatic</a>, does
18
 * not happen immediately as the invoice is created. Stripe waits
19
 * until one hour after the last webhook was successfully sent (or the last
20
 * webhook timed out after failing). If you (and the platforms you may have
21
 * connected to) have no webhooks configured, Stripe waits one hour after
22
 * creation to finalize the invoice.
23
 *
24
 * If your invoice is configured to be billed by sending an email, then based on your
25
 * <a href="https://dashboard.stripe.com/account/billing/automatic">email settings</a>,
26
 * Stripe will email the invoice to your customer and await payment. These
27
 * emails can contain a link to a hosted page to pay the invoice.
28
 *
29
 * Stripe applies any customer credit on the account before determining the
30
 * amount due for the invoice (i.e., the amount that will be actually
31
 * charged). If the amount due for the invoice is less than Stripe's <a href="/docs/currencies#minimum-and-maximum-charge-amounts">minimum allowed charge
32
 * per currency</a>, the
33
 * invoice is automatically marked paid, and we add the amount due to the
34
 * customer's credit balance which is applied to the next invoice.
35
 *
36
 * More details on the customer's credit balance are
37
 * <a href="https://stripe.com/docs/billing/customer/balance">here</a>.
38
 *
39
 * Related guide: <a href="https://stripe.com/docs/billing/invoices/sending">Send invoices to customers</a>
40
 *
41
 * @property null|string $id Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See <a href="https://stripe.com/docs/api/invoices/upcoming">Retrieve an upcoming invoice</a> for more details.
42
 * @property string $object String representing the object's type. Objects of the same type share the same value.
43
 * @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice.
44
 * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice.
45
 * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
46
 * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the <code>amount_due</code> may be 0. If there is a positive <code>starting_balance</code> for the invoice (the customer owes money), the <code>amount_due</code> will also take that into account. The charge that gets generated for the invoice will be for the amount specified in <code>amount_due</code>.
47
 * @property int $amount_paid The amount, in cents (or local equivalent), that was paid.
48
 * @property int $amount_remaining The difference between amount_due and amount_paid, in cents (or local equivalent).
49
 * @property int $amount_shipping This is the sum of all the shipping amounts.
50
 * @property null|\Stripe\StripeObject[] $amounts_due List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
51
 * @property null|string|\Stripe\StripeObject $application ID of the Connect Application that created the invoice.
52
 * @property null|int $application_fee_amount The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
53
 * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
54
 * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the <code>invoice.created</code> webhook, for example, so you might not want to display that invoice as unpaid to your users.
55
 * @property null|bool $auto_advance Controls whether Stripe performs <a href="https://stripe.com/docs/invoicing/integration/automatic-advancement-collection">automatic collection</a> of the invoice. If <code>false</code>, the invoice's state doesn't automatically advance without an explicit action.
56
 * @property \Stripe\StripeObject $automatic_tax
57
 * @property null|string $billing_reason <p>Indicates the reason why the invoice was created.</p><p>* <code>manual</code>: Unrelated to a subscription, for example, created via the invoice editor. * <code>subscription</code>: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * <code>subscription_create</code>: A new subscription was created. * <code>subscription_cycle</code>: A subscription advanced into a new period. * <code>subscription_threshold</code>: A subscription reached a billing threshold. * <code>subscription_update</code>: A subscription was updated. * <code>upcoming</code>: Reserved for simulated invoices, per the upcoming invoice endpoint.</p>
58
 * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any.
59
 * @property string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
60
 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
61
 * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
62
 * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice.
63
 * @property null|string|\Stripe\Customer $customer The ID of the customer who will be billed.
64
 * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal <code>customer.address</code>. Once the invoice is finalized, this field will no longer be updated.
65
 * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal <code>customer.email</code>. Once the invoice is finalized, this field will no longer be updated.
66
 * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal <code>customer.name</code>. Once the invoice is finalized, this field will no longer be updated.
67
 * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal <code>customer.phone</code>. Once the invoice is finalized, this field will no longer be updated.
68
 * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal <code>customer.shipping</code>. Once the invoice is finalized, this field will no longer be updated.
69
 * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal <code>customer.tax_exempt</code>. Once the invoice is finalized, this field will no longer be updated.
70
 * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
71
 * @property null|(string|\Stripe\Margin)[] $default_margins The margins applied to the invoice. Can be overridden by line item <code>margins</code>. Use <code>expand[]=default_margins</code> to expand each margin.
72
 * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
73
 * @property null|string|\Stripe\Account|\Stripe\BankAccount|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
74
 * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
75
 * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
76
 * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
77
 * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
78
 * @property null|int $due_date The date on which payment for this invoice is due. This value will be <code>null</code> for invoices where <code>collection_method=charge_automatically</code>.
79
 * @property null|int $effective_at The date when this invoice is in effect. Same as <code>finalized_at</code> unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
80
 * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
81
 * @property null|string $footer Footer displayed on the invoice.
82
 * @property null|\Stripe\StripeObject $from_invoice Details of the invoice that was cloned. See the <a href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more details.
83
 * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
84
 * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
85
 * @property null|\Stripe\StripeObject $issuer The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
86
 * @property null|\Stripe\StripeObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
87
 * @property null|string|\Stripe\Invoice $latest_revision The ID of the most recent non-draft revision of this invoice
88
 * @property \Stripe\Collection<\Stripe\InvoiceLineItem> $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.
89
 * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
90
 * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
91
 * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be <code>null</code> for invoices where <code>collection_method=send_invoice</code>.
92
 * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.
93
 * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the <a href="https://stripe.com/docs/billing/invoices/connect">Invoices with Connect</a> documentation for details.
94
 * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.
95
 * @property bool $paid_out_of_band Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.
96
 * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent.
97
 * @property \Stripe\StripeObject $payment_settings
98
 * @property null|\Stripe\Collection<\Stripe\InvoicePayment> $payments Payments for this invoice
99
 * @property int $period_end End of the usage period during which invoice items were added to this invoice.
100
 * @property int $period_start Start of the usage period during which invoice items were added to this invoice.
101
 * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice.
102
 * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice.
103
 * @property null|string|\Stripe\Quote $quote The quote this invoice was generated from.
104
 * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice.
105
 * @property null|\Stripe\StripeObject $rendering The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
106
 * @property null|\Stripe\StripeObject $rendering_options This is a legacy field that will be removed soon. For details about <code>rendering_options</code>, refer to <code>rendering</code> instead. Options for invoice PDF rendering.
107
 * @property null|\Stripe\StripeObject $shipping_cost The details of the cost of shipping, including the ShippingRate applied on the invoice.
108
 * @property null|\Stripe\StripeObject $shipping_details Shipping details for the invoice. The Invoice PDF will use the <code>shipping_details</code> value if it is set, otherwise the PDF will render the shipping address from the customer.
109
 * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice.
110
 * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement.
111
 * @property null|string $status The status of the invoice, one of <code>draft</code>, <code>open</code>, <code>paid</code>, <code>uncollectible</code>, or <code>void</code>. <a href="https://stripe.com/docs/billing/invoices/workflow#workflow-overview">Learn more</a>
112
 * @property \Stripe\StripeObject $status_transitions
113
 * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any.
114
 * @property null|\Stripe\StripeObject $subscription_details Details about the subscription that created this invoice.
115
 * @property null|int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
116
 * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
117
 * @property null|int $subtotal_excluding_tax The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
118
 * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
119
 * @property null|string|\Stripe\TestHelpers\TestClock $test_clock ID of the test clock this invoice belongs to.
120
 * @property null|\Stripe\StripeObject $threshold_reason
121
 * @property int $total Total after discounts and taxes.
122
 * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items.
123
 * @property null|int $total_excluding_tax The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
124
 * @property null|\Stripe\StripeObject[] $total_margin_amounts The aggregate amounts calculated per margin across all line items.
125
 * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items.
126
 * @property null|\Stripe\StripeObject $transfer_data The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
127
 * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have <a href="https://stripe.com/docs/billing/webhooks#understand">been exhausted</a>. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created.
128
 */
129
class Invoice extends ApiResource
130
{
131
    const OBJECT_NAME = 'invoice';
132

133
    use ApiOperations\All;
134
    use ApiOperations\Create;
135
    use ApiOperations\Delete;
136
    use ApiOperations\NestedResource;
137
    use ApiOperations\Retrieve;
138
    use ApiOperations\Search;
139
    use ApiOperations\Update;
140

141
    const BILLING_REASON_AUTOMATIC_PENDING_INVOICE_ITEM_INVOICE = 'automatic_pending_invoice_item_invoice';
142
    const BILLING_REASON_MANUAL = 'manual';
143
    const BILLING_REASON_QUOTE_ACCEPT = 'quote_accept';
144
    const BILLING_REASON_SUBSCRIPTION = 'subscription';
145
    const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create';
146
    const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle';
147
    const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold';
148
    const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update';
149
    const BILLING_REASON_UPCOMING = 'upcoming';
150

151
    const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
152
    const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
153

154
    const CUSTOMER_TAX_EXEMPT_EXEMPT = 'exempt';
155
    const CUSTOMER_TAX_EXEMPT_NONE = 'none';
156
    const CUSTOMER_TAX_EXEMPT_REVERSE = 'reverse';
157

158
    const STATUS_DRAFT = 'draft';
159
    const STATUS_OPEN = 'open';
160
    const STATUS_PAID = 'paid';
161
    const STATUS_UNCOLLECTIBLE = 'uncollectible';
162
    const STATUS_VOID = 'void';
163

164
    const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically';
165
    const BILLING_SEND_INVOICE = 'send_invoice';
166

167
    /**
168
     * @param null|array $params
169
     * @param null|array|string $opts
170
     *
171
     * @throws \Stripe\Exception\ApiErrorException if the request fails
172
     *
173
     * @return \Stripe\Invoice the attached invoice
174
     */
175
    public function attachPaymentIntent($params = null, $opts = null)
×
176
    {
177
        $url = $this->instanceUrl() . '/attach_payment_intent';
×
178
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
×
179
        $this->refreshFrom($response, $opts);
×
180

181
        return $this;
×
182
    }
183

184
    /**
185
     * @param null|array $params
186
     * @param null|array|string $opts
187
     *
188
     * @throws \Stripe\Exception\ApiErrorException if the request fails
189
     *
190
     * @return \Stripe\Invoice the finalized invoice
191
     */
192
    public function finalizeInvoice($params = null, $opts = null)
1✔
193
    {
194
        $url = $this->instanceUrl() . '/finalize';
1✔
195
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
1✔
196
        $this->refreshFrom($response, $opts);
1✔
197

198
        return $this;
1✔
199
    }
200

201
    /**
202
     * @param null|array $params
203
     * @param null|array|string $opts
204
     *
205
     * @throws \Stripe\Exception\ApiErrorException if the request fails
206
     *
207
     * @return \Stripe\Invoice the uncollectible invoice
208
     */
209
    public function markUncollectible($params = null, $opts = null)
1✔
210
    {
211
        $url = $this->instanceUrl() . '/mark_uncollectible';
1✔
212
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
1✔
213
        $this->refreshFrom($response, $opts);
1✔
214

215
        return $this;
1✔
216
    }
217

218
    /**
219
     * @param null|array $params
220
     * @param null|array|string $opts
221
     *
222
     * @throws \Stripe\Exception\ApiErrorException if the request fails
223
     *
224
     * @return \Stripe\Invoice the paid invoice
225
     */
226
    public function pay($params = null, $opts = null)
1✔
227
    {
228
        $url = $this->instanceUrl() . '/pay';
1✔
229
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
1✔
230
        $this->refreshFrom($response, $opts);
1✔
231

232
        return $this;
1✔
233
    }
234

235
    /**
236
     * @param null|array $params
237
     * @param null|array|string $opts
238
     *
239
     * @throws \Stripe\Exception\ApiErrorException if the request fails
240
     *
241
     * @return \Stripe\Invoice the sent invoice
242
     */
243
    public function sendInvoice($params = null, $opts = null)
1✔
244
    {
245
        $url = $this->instanceUrl() . '/send';
1✔
246
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
1✔
247
        $this->refreshFrom($response, $opts);
1✔
248

249
        return $this;
1✔
250
    }
251

252
    /**
253
     * @param null|array $params
254
     * @param null|array|string $opts
255
     *
256
     * @throws \Stripe\Exception\ApiErrorException if the request fails
257
     *
258
     * @return \Stripe\Invoice the upcoming invoice
259
     */
260
    public static function upcoming($params = null, $opts = null)
1✔
261
    {
262
        $url = static::classUrl() . '/upcoming';
1✔
263
        list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
1✔
264
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
1✔
265
        $obj->setLastResponse($response);
1✔
266

267
        return $obj;
1✔
268
    }
269

270
    /**
271
     * @param null|array $params
272
     * @param null|array|string $opts
273
     *
274
     * @throws \Stripe\Exception\ApiErrorException if the request fails
275
     *
276
     * @return \Stripe\Collection<\Stripe\InvoiceLineItem> list of invoice line items
277
     */
278
    public static function upcomingLines($params = null, $opts = null)
×
279
    {
280
        $url = static::classUrl() . '/upcoming/lines';
×
281
        list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
×
282
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
283
        $obj->setLastResponse($response);
×
284

285
        return $obj;
×
286
    }
287

288
    /**
289
     * @param null|array $params
290
     * @param null|array|string $opts
291
     *
292
     * @throws \Stripe\Exception\ApiErrorException if the request fails
293
     *
294
     * @return \Stripe\Invoice the voided invoice
295
     */
296
    public function voidInvoice($params = null, $opts = null)
1✔
297
    {
298
        $url = $this->instanceUrl() . '/void';
1✔
299
        list($response, $opts) = $this->_request('post', $url, $params, $opts);
1✔
300
        $this->refreshFrom($response, $opts);
1✔
301

302
        return $this;
1✔
303
    }
304

305
    /**
306
     * @param null|array $params
307
     * @param null|array|string $opts
308
     *
309
     * @throws \Stripe\Exception\ApiErrorException if the request fails
310
     *
311
     * @return \Stripe\SearchResult<\Stripe\Invoice> the invoice search results
312
     */
313
    public static function search($params = null, $opts = null)
×
314
    {
315
        $url = '/v1/invoices/search';
×
316

317
        return self::_searchResource($url, $params, $opts);
×
318
    }
319

320
    const PATH_PAYMENTS = '/payments';
321

322
    /**
323
     * @param string $id the ID of the invoice on which to retrieve the invoice payments
324
     * @param null|array $params
325
     * @param null|array|string $opts
326
     *
327
     * @throws \Stripe\Exception\ApiErrorException if the request fails
328
     *
329
     * @return \Stripe\Collection<\Stripe\InvoicePayment> the list of invoice payments
330
     */
331
    public static function allPayments($id, $params = null, $opts = null)
×
332
    {
333
        return self::_allNestedResources($id, static::PATH_PAYMENTS, $params, $opts);
×
334
    }
335

336
    /**
337
     * @param string $id the ID of the invoice to which the invoice payment belongs
338
     * @param string $paymentId the ID of the invoice payment to retrieve
339
     * @param null|array $params
340
     * @param null|array|string $opts
341
     *
342
     * @throws \Stripe\Exception\ApiErrorException if the request fails
343
     *
344
     * @return \Stripe\InvoicePayment
345
     */
346
    public static function retrievePayment($id, $paymentId, $params = null, $opts = null)
×
347
    {
348
        return self::_retrieveNestedResource($id, static::PATH_PAYMENTS, $paymentId, $params, $opts);
×
349
    }
350
    const PATH_LINES = '/lines';
351

352
    /**
353
     * @param string $id the ID of the invoice on which to retrieve the invoice line items
354
     * @param null|array $params
355
     * @param null|array|string $opts
356
     *
357
     * @throws \Stripe\Exception\ApiErrorException if the request fails
358
     *
359
     * @return \Stripe\Collection<\Stripe\InvoiceLineItem> the list of invoice line items
360
     */
361
    public static function allLines($id, $params = null, $opts = null)
1✔
362
    {
363
        return self::_allNestedResources($id, static::PATH_LINES, $params, $opts);
1✔
364
    }
365
}
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