• 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/QuotePhase.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe;
6

7
/**
8
 * A quote phase describes the line items, coupons, and trialing status of a subscription for a predefined time period.
9
 *
10
 * @property string $id Unique identifier for the object.
11
 * @property string $object String representing the object's type. Objects of the same type share the same value.
12
 * @property int $amount_subtotal Total before any discounts or taxes are applied.
13
 * @property int $amount_total Total after discounts and taxes are applied.
14
 * @property null|string $billing_cycle_anchor If set to <code>reset</code>, the billing_cycle_anchor of the subscription is set to the start of the phase when entering the phase. If unset, then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle <a href="https://stripe.com/docs/billing/subscriptions/billing-cycle">documentation</a>.
15
 * @property null|string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as <code>active</code>.
16
 * @property null|(string|\Stripe\TaxRate)[] $default_tax_rates The default tax rates to apply to the subscription during this phase of the quote.
17
 * @property (string|\Stripe\Discount)[] $discounts The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts.
18
 * @property null|int $end_date The end of this phase of the quote
19
 * @property null|\Stripe\StripeObject $invoice_settings The invoice settings applicable during this phase.
20
 * @property null|int $iterations Integer representing the multiplier applied to the price interval. For example, <code>iterations=2</code> applied to a price with <code>interval=month</code> and <code>interval_count=3</code> results in a phase of duration <code>2 * 3 months = 6 months</code>.
21
 * @property null|\Stripe\Collection<\Stripe\LineItem> $line_items A list of items the customer is being quoted for.
22
 * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will declaratively set metadata on the subscription schedule's phases when the quote is accepted.
23
 * @property string $proration_behavior If the quote will prorate when transitioning to this phase. Possible values are <code>create_prorations</code> and <code>none</code>.
24
 * @property \Stripe\StripeObject $total_details
25
 * @property null|bool $trial If set to true the entire phase is counted as a trial and the customer will not be charged for any recurring fees.
26
 * @property null|int $trial_end When the trial ends within the phase.
27
 */
28
class QuotePhase extends ApiResource
29
{
30
    const OBJECT_NAME = 'quote_phase';
31

32
    const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically';
33
    const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice';
34

35
    const PRORATION_BEHAVIOR_ALWAYS_INVOICE = 'always_invoice';
36
    const PRORATION_BEHAVIOR_CREATE_PRORATIONS = 'create_prorations';
37
    const PRORATION_BEHAVIOR_NONE = 'none';
38

39
    /**
40
     * Returns a list of quote phases.
41
     *
42
     * @param null|array $params
43
     * @param null|array|string $opts
44
     *
45
     * @throws \Stripe\Exception\ApiErrorException if the request fails
46
     *
47
     * @return \Stripe\Collection<\Stripe\QuotePhase> of ApiResources
48
     */
NEW
49
    public static function all($params = null, $opts = null)
×
50
    {
NEW
51
        $url = static::classUrl();
×
52

NEW
53
        return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
×
54
    }
55

56
    /**
57
     * Retrieves the quote phase with the given ID.
58
     *
59
     * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
60
     * @param null|array|string $opts
61
     *
62
     * @throws \Stripe\Exception\ApiErrorException if the request fails
63
     *
64
     * @return \Stripe\QuotePhase
65
     */
NEW
66
    public static function retrieve($id, $opts = null)
×
67
    {
NEW
68
        $opts = \Stripe\Util\RequestOptions::parse($opts);
×
NEW
69
        $instance = new static($id, $opts);
×
NEW
70
        $instance->refresh();
×
71

NEW
72
        return $instance;
×
73
    }
74

75
    /**
76
     * @param string $id
77
     * @param null|array $params
78
     * @param null|array|string $opts
79
     *
80
     * @throws \Stripe\Exception\ApiErrorException if the request fails
81
     *
82
     * @return \Stripe\Collection<\Stripe\LineItem> list of line items
83
     */
84
    public static function allLineItems($id, $params = null, $opts = null)
×
85
    {
86
        $url = static::resourceUrl($id) . '/line_items';
×
87
        list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
×
88
        $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
×
89
        $obj->setLastResponse($response);
×
90

91
        return $obj;
×
92
    }
93
}
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