• 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

80.0
/lib/Service/RefundService.php
1
<?php
2

3
// File generated from our OpenAPI spec
4

5
namespace Stripe\Service;
6

7
class RefundService extends \Stripe\Service\AbstractService
8
{
9
    /**
10
     * Returns a list of all refunds you created. We return the refunds in sorted
11
     * order, with the most recent refunds appearing first The 10 most recent refunds
12
     * are always available by default on the Charge object.
13
     *
14
     * @param null|array $params
15
     * @param null|array|\Stripe\Util\RequestOptions $opts
16
     *
17
     * @throws \Stripe\Exception\ApiErrorException if the request fails
18
     *
19
     * @return \Stripe\Collection<\Stripe\Refund>
20
     */
21
    public function all($params = null, $opts = null)
1✔
22
    {
23
        return $this->requestCollection('get', '/v1/refunds', $params, $opts);
1✔
24
    }
25

26
    /**
27
     * Cancels a refund with a status of <code>requires_action</code>.
28
     *
29
     * You can’t cancel refunds in other states. Only refunds for payment methods that
30
     * require customer action can enter the <code>requires_action</code> state.
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\Refund
39
     */
40
    public function cancel($id, $params = null, $opts = null)
×
41
    {
42
        return $this->request('post', $this->buildPath('/v1/refunds/%s/cancel', $id), $params, $opts);
×
43
    }
44

45
    /**
46
     * When you create a new refund, you must specify a Charge or a PaymentIntent
47
     * object on which to create it.
48
     *
49
     * Creating a new refund will refund a charge that has previously been created but
50
     * not yet refunded. Funds will be refunded to the credit or debit card that was
51
     * originally charged.
52
     *
53
     * You can optionally refund only part of a charge. You can do so multiple times,
54
     * until the entire charge has been refunded.
55
     *
56
     * Once entirely refunded, a charge can’t be refunded again. This method will raise
57
     * an error when called on an already-refunded charge, or when trying to refund
58
     * more money than is left on a charge.
59
     *
60
     * @param null|array $params
61
     * @param null|array|\Stripe\Util\RequestOptions $opts
62
     *
63
     * @throws \Stripe\Exception\ApiErrorException if the request fails
64
     *
65
     * @return \Stripe\Refund
66
     */
67
    public function create($params = null, $opts = null)
1✔
68
    {
69
        return $this->request('post', '/v1/refunds', $params, $opts);
1✔
70
    }
71

72
    /**
73
     * Retrieves the details of an existing refund.
74
     *
75
     * @param string $id
76
     * @param null|array $params
77
     * @param null|array|\Stripe\Util\RequestOptions $opts
78
     *
79
     * @throws \Stripe\Exception\ApiErrorException if the request fails
80
     *
81
     * @return \Stripe\Refund
82
     */
83
    public function retrieve($id, $params = null, $opts = null)
1✔
84
    {
85
        return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts);
1✔
86
    }
87

88
    /**
89
     * Updates the refund that you specify by setting the values of the passed
90
     * parameters. Any parameters that you don’t provide remain unchanged.
91
     *
92
     * This request only accepts <code>metadata</code> as an argument.
93
     *
94
     * @param string $id
95
     * @param null|array $params
96
     * @param null|array|\Stripe\Util\RequestOptions $opts
97
     *
98
     * @throws \Stripe\Exception\ApiErrorException if the request fails
99
     *
100
     * @return \Stripe\Refund
101
     */
102
    public function update($id, $params = null, $opts = null)
1✔
103
    {
104
        return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts);
1✔
105
    }
106
}
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