1 | <?php namespace Arcanedev\Stripe\Resources; |
||
44 | class Account extends StripeResource implements AccountContract |
||
45 | { |
||
46 | /* ------------------------------------------------------------------------------------------------ |
||
47 | | Getters & Setters |
||
48 | | ------------------------------------------------------------------------------------------------ |
||
49 | */ |
||
50 | /** |
||
51 | * Get the instance url. |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | 18 | public function instanceUrl() |
|
59 | |||
60 | /* ------------------------------------------------------------------------------------------------ |
||
61 | | Main Functions |
||
62 | | ------------------------------------------------------------------------------------------------ |
||
63 | */ |
||
64 | /** |
||
65 | * Get all Accounts. |
||
66 | * @link https://stripe.com/docs/api/php#list_accounts |
||
67 | * |
||
68 | * @param array|null $params |
||
69 | * @param array|string|null $options |
||
70 | * |
||
71 | * @return \Arcanedev\Stripe\Collection|array |
||
72 | */ |
||
73 | 2 | public static function all($params = [], $options = null) |
|
77 | |||
78 | /** |
||
79 | * Retrieve an Account. |
||
80 | * @link https://stripe.com/docs/api/php#retrieve_account |
||
81 | * |
||
82 | * @param string|null $id |
||
83 | * @param array|string|null $options |
||
84 | * |
||
85 | * @return self |
||
86 | */ |
||
87 | 10 | public static function retrieve($id = null, $options = null) |
|
88 | { |
||
89 | if ( |
||
90 | 10 | ! $options && |
|
91 | 10 | is_string($id) && |
|
92 | 10 | substr($id, 0, 3) === 'sk_' |
|
93 | ) { |
||
94 | $options = $id; |
||
95 | $id = null; |
||
96 | } |
||
97 | |||
98 | 10 | return self::scopedRetrieve($id, $options); |
|
99 | } |
||
100 | |||
101 | /** |
||
102 | * Create an Account. |
||
103 | * @link https://stripe.com/docs/api/php#create_account |
||
104 | * |
||
105 | * @param array|null $params |
||
106 | * @param array|string|null $options |
||
107 | * |
||
108 | * @return self |
||
109 | */ |
||
110 | 22 | public static function create($params = [], $options = null) |
|
111 | { |
||
112 | 22 | return self::scopedCreate($params, $options); |
|
113 | } |
||
114 | |||
115 | /** |
||
116 | * Update an Account. |
||
117 | * @link https://stripe.com/docs/api/php#update_account |
||
118 | * |
||
119 | * @param string $id |
||
120 | * @param array|null $params |
||
121 | * @param array|string|null $options |
||
122 | * |
||
123 | * @return self |
||
124 | */ |
||
125 | 2 | public static function update($id, $params = [], $options = null) |
|
129 | |||
130 | /** |
||
131 | * Update/Save an Account. |
||
132 | * @link https://stripe.com/docs/api/php#update_account |
||
133 | * |
||
134 | * @param array|string|null $options |
||
135 | * |
||
136 | * @return self |
||
137 | */ |
||
138 | 4 | public function save($options = null) |
|
142 | |||
143 | /** |
||
144 | * Delete an Account. |
||
145 | * @link https://stripe.com/docs/api/php#delete_account |
||
146 | * |
||
147 | * @param array|null $params |
||
148 | * @param array|string|null $options |
||
149 | * |
||
150 | * @return self |
||
151 | */ |
||
152 | 2 | public function delete($params = [], $options = null) |
|
156 | |||
157 | /** |
||
158 | * Reject an Account. |
||
159 | * @link https://stripe.com/docs/api/php#reject_account |
||
160 | * |
||
161 | * @param array|null $params |
||
162 | * @param array|string|null $options |
||
163 | * |
||
164 | * @return self |
||
165 | */ |
||
166 | 2 | public function reject($params = [], $options = null) |
|
172 | } |
||
173 |