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

stripe / stripe-php / 9308609267

30 May 2024 08:13PM UTC coverage: 60.343% (-1.0%) from 61.377%
9308609267

push

github

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

Update generated code for beta

1080 of 1830 new or added lines in 117 files covered. (59.02%)

15 existing lines in 3 files now uncovered.

3486 of 5777 relevant lines covered (60.34%)

2.19 hits per line

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

0.0
/lib/InvoiceLineItem.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * @property string $id Unique identifier for the object.
9
 * @property string $object String representing the object's type. Objects of the same type share the same value.
10
 * @property int $amount The amount, in cents (or local equivalent).
11
 * @property null|int $amount_excluding_tax The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts.
12
 * @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>.
13
 * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
14
 * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item.
15
 * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations.
16
 * @property (string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
17
 * @property null|string $invoice The ID of the invoice that contains this line item.
18
 * @property null|string|\Stripe\InvoiceItem $invoice_item The ID of the <a href="https://stripe.com/docs/api/invoiceitems">invoice item</a> associated with this line item if any.
19
 * @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.
20
 * @property null|\Stripe\StripeObject[] $margin_amounts The amount of margin calculated per margin for this line item.
21
 * @property null|(string|\Stripe\Margin)[] $margins The margins applied to the line item. When set, the <code>default_margins</code> on the invoice do not apply to the line item. Use <code>expand[]=margins</code> to expand each margin.
22
 * @property \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. Note that for line items with <code>type=subscription</code>, <code>metadata</code> reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
23
 * @property \Stripe\StripeObject $period
24
 * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration.
25
 * @property null|\Stripe\Price $price The price of the line item.
26
 * @property bool $proration Whether this is a proration.
27
 * @property null|\Stripe\StripeObject $proration_details Additional details for proration line items
28
 * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration.
29
 * @property null|string|\Stripe\Subscription $subscription The subscription that the invoice item pertains to, if any.
30
 * @property null|string|\Stripe\SubscriptionItem $subscription_item The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription.
31
 * @property null|\Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item
32
 * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item.
33
 * @property string $type A string identifying the type of the source of this line item, either an <code>invoiceitem</code> or a <code>subscription</code>.
34
 * @property null|string $unit_amount_excluding_tax The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts.
35
 */
36
class InvoiceLineItem extends ApiResource
37
{
38
    const OBJECT_NAME = 'line_item';
39

40
    use ApiOperations\Update;
41

42
    /**
43
     * Updates an invoice’s line item. Some fields, such as <code>tax_amounts</code>,
44
     * only live on the invoice line item, so they can only be updated through this
45
     * endpoint. Other fields, such as <code>amount</code>, live on both the invoice
46
     * item and the invoice line item, so updates on this endpoint will propagate to
47
     * the invoice item as well. Updating an invoice’s line item is only possible
48
     * before the invoice is finalized.
49
     *
50
     * @param string $id the ID of the resource to update
51
     * @param null|array $params
52
     * @param null|array|string $opts
53
     *
54
     * @throws \Stripe\Exception\ApiErrorException if the request fails
55
     *
56
     * @return \Stripe\InvoiceLineItem the updated resource
57
     */
NEW
58
    public static function update($id, $params = null, $opts = null)
×
59
    {
NEW
60
        self::_validateParams($params);
×
NEW
61
        $url = static::resourceUrl($id);
×
62

NEW
63
        list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
×
NEW
64
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
NEW
65
        $obj->setLastResponse($response);
×
66

NEW
67
        return $obj;
×
68
    }
69
}
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