PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / vendor / stripe / stripe-php / lib / Service / TransferService.php

TransferService.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/stripe/stripe-php/lib/Service/TransferService.php

162 lines 5.8 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 TransferService extends \Stripe\Service\AbstractService
8 {
9 /**
10 * Returns a list of existing transfers sent to connected accounts. The transfers
11 * are returned in sorted order, with the most recently created transfers appearing
12 * first.
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\Transfer>
20 */
21 public function all($params = null, $opts = null)
22 {
23 return $this->requestCollection('get', '/v1/transfers', $params, $opts);
24 }
25
26 /**
27 * You can see a list of the reversals belonging to a specific transfer. Note that
28 * the 10 most recent reversals are always available by default on the transfer
29 * object. If you need more than those 10, you can use this API method and the
30 * <code>limit</code> and <code>starting_after</code> parameters to page through
31 * additional reversals.
32 *
33 * @param string $parentId
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\Collection<\Stripe\TransferReversal>
40 */
41 public function allReversals($parentId, $params = null, $opts = null)
42 {
43 return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts);
44 }
45
46 /**
47 * To send funds from your Stripe account to a connected account, you create a new
48 * transfer object. Your <a href="#balance">Stripe balance</a> must be able to
49 * cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
50 *
51 * @param null|array $params
52 * @param null|array|\Stripe\Util\RequestOptions $opts
53 *
54 * @throws \Stripe\Exception\ApiErrorException if the request fails
55 *
56 * @return \Stripe\Transfer
57 */
58 public function create($params = null, $opts = null)
59 {
60 return $this->request('post', '/v1/transfers', $params, $opts);
61 }
62
63 /**
64 * When you create a new reversal, you must specify a transfer to create it on.
65 *
66 * When reversing transfers, you can optionally reverse part of the transfer. You
67 * can do so as many times as you wish until the entire transfer has been reversed.
68 *
69 * Once entirely reversed, a transfer can’t be reversed again. This method will
70 * return an error when called on an already-reversed transfer, or when trying to
71 * reverse more money than is left on a transfer.
72 *
73 * @param string $parentId
74 * @param null|array $params
75 * @param null|array|\Stripe\Util\RequestOptions $opts
76 *
77 * @throws \Stripe\Exception\ApiErrorException if the request fails
78 *
79 * @return \Stripe\TransferReversal
80 */
81 public function createReversal($parentId, $params = null, $opts = null)
82 {
83 return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts);
84 }
85
86 /**
87 * Retrieves the details of an existing transfer. Supply the unique transfer ID
88 * from either a transfer creation request or the transfer list, and Stripe will
89 * return the corresponding transfer information.
90 *
91 * @param string $id
92 * @param null|array $params
93 * @param null|array|\Stripe\Util\RequestOptions $opts
94 *
95 * @throws \Stripe\Exception\ApiErrorException if the request fails
96 *
97 * @return \Stripe\Transfer
98 */
99 public function retrieve($id, $params = null, $opts = null)
100 {
101 return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts);
102 }
103
104 /**
105 * By default, you can see the 10 most recent reversals stored directly on the
106 * transfer object, but you can also retrieve details about a specific reversal
107 * stored on the transfer.
108 *
109 * @param string $parentId
110 * @param string $id
111 * @param null|array $params
112 * @param null|array|\Stripe\Util\RequestOptions $opts
113 *
114 * @throws \Stripe\Exception\ApiErrorException if the request fails
115 *
116 * @return \Stripe\TransferReversal
117 */
118 public function retrieveReversal($parentId, $id, $params = null, $opts = null)
119 {
120 return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts);
121 }
122
123 /**
124 * Updates the specified transfer by setting the values of the parameters passed.
125 * Any parameters not provided will be left unchanged.
126 *
127 * This request accepts only metadata as an argument.
128 *
129 * @param string $id
130 * @param null|array $params
131 * @param null|array|\Stripe\Util\RequestOptions $opts
132 *
133 * @throws \Stripe\Exception\ApiErrorException if the request fails
134 *
135 * @return \Stripe\Transfer
136 */
137 public function update($id, $params = null, $opts = null)
138 {
139 return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts);
140 }
141
142 /**
143 * Updates the specified reversal by setting the values of the parameters passed.
144 * Any parameters not provided will be left unchanged.
145 *
146 * This request only accepts metadata and description as arguments.
147 *
148 * @param string $parentId
149 * @param string $id
150 * @param null|array $params
151 * @param null|array|\Stripe\Util\RequestOptions $opts
152 *
153 * @throws \Stripe\Exception\ApiErrorException if the request fails
154 *
155 * @return \Stripe\TransferReversal
156 */
157 public function updateReversal($parentId, $id, $params = null, $opts = null)
158 {
159 return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts);
160 }
161 }
162