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

stripe / stripe-php / #7055

pending completion
#7055

push

php-coveralls

anniel-stripe
Bump version to 10.14.0-beta.1

1802 of 2678 relevant lines covered (67.29%)

3.74 hits per line

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

55.0
/lib/Service/QuoteService.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Service;
6

7
class QuoteService extends \Stripe\Service\AbstractService
8
{
9
    /**
10
     * Accepts the specified quote.
11
     *
12
     * @param string $id
13
     * @param null|array $params
14
     * @param null|array|\Stripe\Util\RequestOptions $opts
15
     *
16
     * @throws \Stripe\Exception\ApiErrorException if the request fails
17
     *
18
     * @return \Stripe\Quote
19
     */
20
    public function accept($id, $params = null, $opts = null)
21
    {
22
        return $this->request('post', $this->buildPath('/v1/quotes/%s/accept', $id), $params, $opts);
×
23
    }
24

25
    /**
26
     * Returns a list of your quotes.
27
     *
28
     * @param null|array $params
29
     * @param null|array|\Stripe\Util\RequestOptions $opts
30
     *
31
     * @throws \Stripe\Exception\ApiErrorException if the request fails
32
     *
33
     * @return \Stripe\Collection<\Stripe\Quote>
34
     */
35
    public function all($params = null, $opts = null)
36
    {
37
        return $this->requestCollection('get', '/v1/quotes', $params, $opts);
1✔
38
    }
39

40
    /**
41
     * When retrieving a quote, there is an includable <a
42
     * href="https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items"><strong>computed.upfront.line_items</strong></a>
43
     * property containing the first handful of those items. There is also a URL where
44
     * you can retrieve the full (paginated) list of upfront line items.
45
     *
46
     * @param string $id
47
     * @param null|array $params
48
     * @param null|array|\Stripe\Util\RequestOptions $opts
49
     *
50
     * @throws \Stripe\Exception\ApiErrorException if the request fails
51
     *
52
     * @return \Stripe\Collection<\Stripe\LineItem>
53
     */
54
    public function allComputedUpfrontLineItems($id, $params = null, $opts = null)
55
    {
56
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/computed_upfront_line_items', $id), $params, $opts);
×
57
    }
58

59
    /**
60
     * When retrieving a quote, there is an includable <strong>line_items</strong>
61
     * property containing the first handful of those items. There is also a URL where
62
     * you can retrieve the full (paginated) list of line items.
63
     *
64
     * @param string $id
65
     * @param null|array $params
66
     * @param null|array|\Stripe\Util\RequestOptions $opts
67
     *
68
     * @throws \Stripe\Exception\ApiErrorException if the request fails
69
     *
70
     * @return \Stripe\Collection<\Stripe\LineItem>
71
     */
72
    public function allLineItems($id, $params = null, $opts = null)
73
    {
74
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/line_items', $id), $params, $opts);
1✔
75
    }
76

77
    /**
78
     * Retrieves a paginated list of lines for a quote. These lines describe changes
79
     * that will be used to create new subscription schedules or update existing
80
     * subscription schedules when the quote is accepted.
81
     *
82
     * @param string $id
83
     * @param null|array $params
84
     * @param null|array|\Stripe\Util\RequestOptions $opts
85
     *
86
     * @throws \Stripe\Exception\ApiErrorException if the request fails
87
     *
88
     * @return \Stripe\Collection<\Stripe\QuoteLine>
89
     */
90
    public function allLines($id, $params = null, $opts = null)
91
    {
92
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/lines', $id), $params, $opts);
×
93
    }
94

95
    /**
96
     * Cancels the quote.
97
     *
98
     * @param string $id
99
     * @param null|array $params
100
     * @param null|array|\Stripe\Util\RequestOptions $opts
101
     *
102
     * @throws \Stripe\Exception\ApiErrorException if the request fails
103
     *
104
     * @return \Stripe\Quote
105
     */
106
    public function cancel($id, $params = null, $opts = null)
107
    {
108
        return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts);
2✔
109
    }
110

111
    /**
112
     * A quote models prices and services for a customer. Default options for
113
     * <code>header</code>, <code>description</code>, <code>footer</code>, and
114
     * <code>expires_at</code> can be set in the dashboard via the <a
115
     * href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
116
     *
117
     * @param null|array $params
118
     * @param null|array|\Stripe\Util\RequestOptions $opts
119
     *
120
     * @throws \Stripe\Exception\ApiErrorException if the request fails
121
     *
122
     * @return \Stripe\Quote
123
     */
124
    public function create($params = null, $opts = null)
125
    {
126
        return $this->request('post', '/v1/quotes', $params, $opts);
1✔
127
    }
128

129
    /**
130
     * Converts a stale quote to draft.
131
     *
132
     * @param string $id
133
     * @param null|array $params
134
     * @param null|array|\Stripe\Util\RequestOptions $opts
135
     *
136
     * @throws \Stripe\Exception\ApiErrorException if the request fails
137
     *
138
     * @return \Stripe\Quote
139
     */
140
    public function draftQuote($id, $params = null, $opts = null)
141
    {
142
        return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_draft', $id), $params, $opts);
×
143
    }
144

145
    /**
146
     * Finalizes the quote.
147
     *
148
     * @param string $id
149
     * @param null|array $params
150
     * @param null|array|\Stripe\Util\RequestOptions $opts
151
     *
152
     * @throws \Stripe\Exception\ApiErrorException if the request fails
153
     *
154
     * @return \Stripe\Quote
155
     */
156
    public function finalizeQuote($id, $params = null, $opts = null)
157
    {
158
        return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts);
1✔
159
    }
160

161
    /**
162
     * Converts a draft or open quote to stale.
163
     *
164
     * @param string $id
165
     * @param null|array $params
166
     * @param null|array|\Stripe\Util\RequestOptions $opts
167
     *
168
     * @throws \Stripe\Exception\ApiErrorException if the request fails
169
     *
170
     * @return \Stripe\Quote
171
     */
172
    public function markStaleQuote($id, $params = null, $opts = null)
173
    {
174
        return $this->request('post', $this->buildPath('/v1/quotes/%s/mark_stale', $id), $params, $opts);
×
175
    }
176

177
    /**
178
     * Preview the invoice line items that would be generated by accepting the quote.
179
     *
180
     * @param string $parentId
181
     * @param string $id
182
     * @param null|array $params
183
     * @param null|array|\Stripe\Util\RequestOptions $opts
184
     *
185
     * @throws \Stripe\Exception\ApiErrorException if the request fails
186
     *
187
     * @return \Stripe\Collection<\Stripe\InvoiceLineItem>
188
     */
189
    public function previewInvoiceLines($parentId, $id, $params = null, $opts = null)
190
    {
191
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices/%s/lines', $parentId, $id), $params, $opts);
×
192
    }
193

194
    /**
195
     * Preview the invoices that would be generated by accepting the quote.
196
     *
197
     * @param string $id
198
     * @param null|array $params
199
     * @param null|array|\Stripe\Util\RequestOptions $opts
200
     *
201
     * @throws \Stripe\Exception\ApiErrorException if the request fails
202
     *
203
     * @return \Stripe\Collection<\Stripe\Invoice>
204
     */
205
    public function previewInvoices($id, $params = null, $opts = null)
206
    {
207
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_invoices', $id), $params, $opts);
×
208
    }
209

210
    /**
211
     * Preview the schedules that would be generated by accepting the quote.
212
     *
213
     * @param string $id
214
     * @param null|array $params
215
     * @param null|array|\Stripe\Util\RequestOptions $opts
216
     *
217
     * @throws \Stripe\Exception\ApiErrorException if the request fails
218
     *
219
     * @return \Stripe\Collection<\Stripe\SubscriptionSchedule>
220
     */
221
    public function previewSubscriptionSchedules($id, $params = null, $opts = null)
222
    {
223
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/preview_subscription_schedules', $id), $params, $opts);
×
224
    }
225

226
    /**
227
     * Recompute the upcoming invoice estimate for the quote.
228
     *
229
     * @param string $id
230
     * @param null|array $params
231
     * @param null|array|\Stripe\Util\RequestOptions $opts
232
     *
233
     * @throws \Stripe\Exception\ApiErrorException if the request fails
234
     *
235
     * @return \Stripe\Quote
236
     */
237
    public function reestimate($id, $params = null, $opts = null)
238
    {
239
        return $this->request('post', $this->buildPath('/v1/quotes/%s/reestimate', $id), $params, $opts);
×
240
    }
241

242
    /**
243
     * Retrieves the quote with the given ID.
244
     *
245
     * @param string $id
246
     * @param null|array $params
247
     * @param null|array|\Stripe\Util\RequestOptions $opts
248
     *
249
     * @throws \Stripe\Exception\ApiErrorException if the request fails
250
     *
251
     * @return \Stripe\Quote
252
     */
253
    public function retrieve($id, $params = null, $opts = null)
254
    {
255
        return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
1✔
256
    }
257

258
    /**
259
     * A quote models prices and services for a customer.
260
     *
261
     * @param string $id
262
     * @param null|array $params
263
     * @param null|array|\Stripe\Util\RequestOptions $opts
264
     *
265
     * @throws \Stripe\Exception\ApiErrorException if the request fails
266
     *
267
     * @return \Stripe\Quote
268
     */
269
    public function update($id, $params = null, $opts = null)
270
    {
271
        return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
1✔
272
    }
273

274
    /**
275
     * Download the PDF for a finalized quote.
276
     *
277
     * @param string $id
278
     * @param callable $readBodyChunkCallable
279
     * @param null|array $params
280
     * @param null|array|\Stripe\Util\RequestOptions $opts
281
     *
282
     * @throws \Stripe\Exception\ApiErrorException if the request fails
283
     */
284
    public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
285
    {
286
        $opts = \Stripe\Util\RequestOptions::parse($opts);
1✔
287
        if (!isset($opts->apiBase)) {
1✔
288
            $opts->apiBase = $this->getClient()->getFilesBase();
1✔
289
        }
290
        $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts);
1✔
291
    }
292
}
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