PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.5
GiveWP – Donation Plugin and Fundraising Platform v4.15.5
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / vendor / stripe / stripe-php / lib / Service / RefundService.php

RefundService.php in GiveWP – Donation Plugin and Fundraising Platform 4.15.5, at vendor/stripe/stripe-php/lib/Service/RefundService.php

96 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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’ve previously created. The refunds are
11 * returned in sorted order, with the most recent refunds appearing first. For
12 * convenience, the 10 most recent refunds are always available by default on the
13 * charge object.
14 *
15 * @param null|array $params
16 * @param null|array|\Stripe\Util\RequestOptions $opts
17 *
18 * @throws \Stripe\Exception\ApiErrorException if the request fails
19 *
20 * @return \Stripe\Collection<\Stripe\Refund>
21 */
22 public function all($params = null, $opts = null)
23 {
24 return $this->requestCollection('get', '/v1/refunds', $params, $opts);
25 }
26
27 /**
28 * Cancels a refund with a status of <code>requires_action</code>.
29 *
30 * Refunds in other states cannot be canceled, and only refunds for payment methods
31 * that require customer action will enter the <code>requires_action</code> state.
32 *
33 * @param string $id
34 * @param null|array $params
35 * @param null|array|\Stripe\Util\RequestOptions $opts
36 *
37 * @throws \Stripe\Exception\ApiErrorException if the request fails
38 *
39 * @return \Stripe\Refund
40 */
41 public function cancel($id, $params = null, $opts = null)
42 {
43 return $this->request('post', $this->buildPath('/v1/refunds/%s/cancel', $id), $params, $opts);
44 }
45
46 /**
47 * Create a refund.
48 *
49 * @param null|array $params
50 * @param null|array|\Stripe\Util\RequestOptions $opts
51 *
52 * @throws \Stripe\Exception\ApiErrorException if the request fails
53 *
54 * @return \Stripe\Refund
55 */
56 public function create($params = null, $opts = null)
57 {
58 return $this->request('post', '/v1/refunds', $params, $opts);
59 }
60
61 /**
62 * Retrieves the details of an existing refund.
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\Refund
71 */
72 public function retrieve($id, $params = null, $opts = null)
73 {
74 return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts);
75 }
76
77 /**
78 * Updates the specified refund by setting the values of the parameters passed. Any
79 * parameters not provided will be left unchanged.
80 *
81 * This request only accepts <code>metadata</code> as an argument.
82 *
83 * @param string $id
84 * @param null|array $params
85 * @param null|array|\Stripe\Util\RequestOptions $opts
86 *
87 * @throws \Stripe\Exception\ApiErrorException if the request fails
88 *
89 * @return \Stripe\Refund
90 */
91 public function update($id, $params = null, $opts = null)
92 {
93 return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts);
94 }
95 }
96