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

stripe / stripe-php / 6471862601

10 Oct 2023 04:02PM UTC coverage: 69.665% (-0.5%) from 70.141%
6471862601

push

github

web-flow
Merge pull request #1570 from localheinz/feature/coveralls

Enhancement: Use `coverallsapp/github-action` to report code coverage

2393 of 3435 relevant lines covered (69.67%)

3.5 hits per line

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

82.61
/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)
1✔
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)
1✔
73
    {
74
        return $this->requestCollection('get', $this->buildPath('/v1/quotes/%s/line_items', $id), $params, $opts);
1✔
75
    }
76

77
    /**
78
     * Cancels the quote.
79
     *
80
     * @param string $id
81
     * @param null|array $params
82
     * @param null|array|\Stripe\Util\RequestOptions $opts
83
     *
84
     * @throws \Stripe\Exception\ApiErrorException if the request fails
85
     *
86
     * @return \Stripe\Quote
87
     */
88
    public function cancel($id, $params = null, $opts = null)
2✔
89
    {
90
        return $this->request('post', $this->buildPath('/v1/quotes/%s/cancel', $id), $params, $opts);
2✔
91
    }
92

93
    /**
94
     * A quote models prices and services for a customer. Default options for
95
     * <code>header</code>, <code>description</code>, <code>footer</code>, and
96
     * <code>expires_at</code> can be set in the dashboard via the <a
97
     * href="https://dashboard.stripe.com/settings/billing/quote">quote template</a>.
98
     *
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 create($params = null, $opts = null)
1✔
107
    {
108
        return $this->request('post', '/v1/quotes', $params, $opts);
1✔
109
    }
110

111
    /**
112
     * Finalizes the quote.
113
     *
114
     * @param string $id
115
     * @param null|array $params
116
     * @param null|array|\Stripe\Util\RequestOptions $opts
117
     *
118
     * @throws \Stripe\Exception\ApiErrorException if the request fails
119
     *
120
     * @return \Stripe\Quote
121
     */
122
    public function finalizeQuote($id, $params = null, $opts = null)
1✔
123
    {
124
        return $this->request('post', $this->buildPath('/v1/quotes/%s/finalize', $id), $params, $opts);
1✔
125
    }
126

127
    /**
128
     * Download the PDF for a finalized quote.
129
     *
130
     * @param string $id
131
     * @param callable $readBodyChunkCallable
132
     * @param null|array $params
133
     * @param null|array|\Stripe\Util\RequestOptions $opts
134
     *
135
     * @throws \Stripe\Exception\ApiErrorException if the request fails
136
     *
137
     * @return mixed
138
     */
139
    public function pdf($id, $readBodyChunkCallable, $params = null, $opts = null)
1✔
140
    {
141
        $opts = \Stripe\Util\RequestOptions::parse($opts);
1✔
142
        if (!isset($opts->apiBase)) {
1✔
143
            $opts->apiBase = $this->getClient()->getFilesBase();
1✔
144
        }
145

146
        return $this->requestStream('get', $this->buildPath('/v1/quotes/%s/pdf', $id), $readBodyChunkCallable, $params, $opts);
1✔
147
    }
148

149
    /**
150
     * Retrieves the quote with the given ID.
151
     *
152
     * @param string $id
153
     * @param null|array $params
154
     * @param null|array|\Stripe\Util\RequestOptions $opts
155
     *
156
     * @throws \Stripe\Exception\ApiErrorException if the request fails
157
     *
158
     * @return \Stripe\Quote
159
     */
160
    public function retrieve($id, $params = null, $opts = null)
1✔
161
    {
162
        return $this->request('get', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
1✔
163
    }
164

165
    /**
166
     * A quote models prices and services for a customer.
167
     *
168
     * @param string $id
169
     * @param null|array $params
170
     * @param null|array|\Stripe\Util\RequestOptions $opts
171
     *
172
     * @throws \Stripe\Exception\ApiErrorException if the request fails
173
     *
174
     * @return \Stripe\Quote
175
     */
176
    public function update($id, $params = null, $opts = null)
1✔
177
    {
178
        return $this->request('post', $this->buildPath('/v1/quotes/%s', $id), $params, $opts);
1✔
179
    }
180
}
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