• 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

85.71
/lib/Service/SetupIntentService.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Service;
6

7
class SetupIntentService extends \Stripe\Service\AbstractService
8
{
9
    /**
10
     * Returns a list of SetupIntents.
11
     *
12
     * @param null|array $params
13
     * @param null|array|\Stripe\Util\RequestOptions $opts
14
     *
15
     * @throws \Stripe\Exception\ApiErrorException if the request fails
16
     *
17
     * @return \Stripe\Collection<\Stripe\SetupIntent>
18
     */
19
    public function all($params = null, $opts = null)
1✔
20
    {
21
        return $this->requestCollection('get', '/v1/setup_intents', $params, $opts);
1✔
22
    }
23

24
    /**
25
     * A SetupIntent object can be canceled when it is in one of these statuses:
26
     * <code>requires_payment_method</code>, <code>requires_confirmation</code>, or
27
     * <code>requires_action</code>.
28
     *
29
     * Once canceled, setup is abandoned and any operations on the SetupIntent will
30
     * fail with an error.
31
     *
32
     * @param string $id
33
     * @param null|array $params
34
     * @param null|array|\Stripe\Util\RequestOptions $opts
35
     *
36
     * @throws \Stripe\Exception\ApiErrorException if the request fails
37
     *
38
     * @return \Stripe\SetupIntent
39
     */
40
    public function cancel($id, $params = null, $opts = null)
1✔
41
    {
42
        return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts);
1✔
43
    }
44

45
    /**
46
     * Confirm that your customer intends to set up the current or provided payment
47
     * method. For example, you would confirm a SetupIntent when a customer hits the
48
     * “Save” button on a payment method management page on your website.
49
     *
50
     * If the selected payment method does not require any additional steps from the
51
     * customer, the SetupIntent will transition to the <code>succeeded</code> status.
52
     *
53
     * Otherwise, it will transition to the <code>requires_action</code> status and
54
     * suggest additional actions via <code>next_action</code>. If setup fails, the
55
     * SetupIntent will transition to the <code>requires_payment_method</code> status
56
     * or the <code>canceled</code> status if the confirmation limit is reached.
57
     *
58
     * @param string $id
59
     * @param null|array $params
60
     * @param null|array|\Stripe\Util\RequestOptions $opts
61
     *
62
     * @throws \Stripe\Exception\ApiErrorException if the request fails
63
     *
64
     * @return \Stripe\SetupIntent
65
     */
66
    public function confirm($id, $params = null, $opts = null)
1✔
67
    {
68
        return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts);
1✔
69
    }
70

71
    /**
72
     * Creates a SetupIntent object.
73
     *
74
     * After you create the SetupIntent, attach a payment method and <a
75
     * href="/docs/api/setup_intents/confirm">confirm</a> it to collect any required
76
     * permissions to charge the payment method later.
77
     *
78
     * @param null|array $params
79
     * @param null|array|\Stripe\Util\RequestOptions $opts
80
     *
81
     * @throws \Stripe\Exception\ApiErrorException if the request fails
82
     *
83
     * @return \Stripe\SetupIntent
84
     */
85
    public function create($params = null, $opts = null)
1✔
86
    {
87
        return $this->request('post', '/v1/setup_intents', $params, $opts);
1✔
88
    }
89

90
    /**
91
     * Retrieves the details of a SetupIntent that has previously been created.
92
     *
93
     * Client-side retrieval using a publishable key is allowed when the
94
     * <code>client_secret</code> is provided in the query string.
95
     *
96
     * When retrieved with a publishable key, only a subset of properties will be
97
     * returned. Please refer to the <a href="#setup_intent_object">SetupIntent</a>
98
     * object reference for more details.
99
     *
100
     * @param string $id
101
     * @param null|array $params
102
     * @param null|array|\Stripe\Util\RequestOptions $opts
103
     *
104
     * @throws \Stripe\Exception\ApiErrorException if the request fails
105
     *
106
     * @return \Stripe\SetupIntent
107
     */
108
    public function retrieve($id, $params = null, $opts = null)
1✔
109
    {
110
        return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts);
1✔
111
    }
112

113
    /**
114
     * Updates a SetupIntent object.
115
     *
116
     * @param string $id
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\SetupIntent
123
     */
124
    public function update($id, $params = null, $opts = null)
1✔
125
    {
126
        return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts);
1✔
127
    }
128

129
    /**
130
     * Verifies microdeposits on a SetupIntent object.
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\SetupIntent
139
     */
140
    public function verifyMicrodeposits($id, $params = null, $opts = null)
×
141
    {
142
        return $this->request('post', $this->buildPath('/v1/setup_intents/%s/verify_microdeposits', $id), $params, $opts);
×
143
    }
144
}
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