PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13.1
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13.1
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 / SourceService.php

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

113 lines 3.5 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 SourceService extends \Stripe\Service\AbstractService
8 {
9 /**
10 * List source transactions for a given source.
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\Collection<\Stripe\SourceTransaction>
19 */
20 public function allSourceTransactions($id, $params = null, $opts = null)
21 {
22 return $this->requestCollection('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts);
23 }
24
25 /**
26 * Creates a new source object.
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\Source
34 */
35 public function create($params = null, $opts = null)
36 {
37 return $this->request('post', '/v1/sources', $params, $opts);
38 }
39
40 /**
41 * Delete a specified source for a given customer.
42 *
43 * @param string $parentId
44 * @param string $id
45 * @param null|array $params
46 * @param null|array|\Stripe\Util\RequestOptions $opts
47 *
48 * @throws \Stripe\Exception\ApiErrorException if the request fails
49 *
50 * @return \Stripe\Source
51 */
52 public function detach($parentId, $id, $params = null, $opts = null)
53 {
54 return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts);
55 }
56
57 /**
58 * Retrieves an existing source object. Supply the unique source ID from a source
59 * creation request and Stripe will return the corresponding up-to-date source
60 * object information.
61 *
62 * @param string $id
63 * @param null|array $params
64 * @param null|array|\Stripe\Util\RequestOptions $opts
65 *
66 * @throws \Stripe\Exception\ApiErrorException if the request fails
67 *
68 * @return \Stripe\Source
69 */
70 public function retrieve($id, $params = null, $opts = null)
71 {
72 return $this->request('get', $this->buildPath('/v1/sources/%s', $id), $params, $opts);
73 }
74
75 /**
76 * Updates the specified source by setting the values of the parameters passed. Any
77 * parameters not provided will be left unchanged.
78 *
79 * This request accepts the <code>metadata</code> and <code>owner</code> as
80 * arguments. It is also possible to update type specific information for selected
81 * payment methods. Please refer to our <a href="/docs/sources">payment method
82 * guides</a> for more detail.
83 *
84 * @param string $id
85 * @param null|array $params
86 * @param null|array|\Stripe\Util\RequestOptions $opts
87 *
88 * @throws \Stripe\Exception\ApiErrorException if the request fails
89 *
90 * @return \Stripe\Source
91 */
92 public function update($id, $params = null, $opts = null)
93 {
94 return $this->request('post', $this->buildPath('/v1/sources/%s', $id), $params, $opts);
95 }
96
97 /**
98 * Verify a given source.
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\Source
107 */
108 public function verify($id, $params = null, $opts = null)
109 {
110 return $this->request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts);
111 }
112 }
113