mirror of
https://github.com/bitinflow/accounts.git
synced 2026-03-13 13:35:52 +00:00
Update Subscriptions.php
This commit is contained in:
@@ -37,21 +37,11 @@ class Subscriptions
|
||||
* name, description, period, price
|
||||
* and following attributes are optional:
|
||||
* vat, payload, ends_at, webhook_url, webhook_secret
|
||||
* @param array $payload optional data that is stored in the subscription
|
||||
* @param bool $checkout optional checkout it directly
|
||||
* @return object|false the subscription object
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function create(string $name, array $attributes, array $payload = [], bool $checkout = false): object|false
|
||||
public function create(array $attributes): object|false
|
||||
{
|
||||
$defaults = ['period' => 'monthly'];
|
||||
$attributes = array_merge(array_merge($defaults, $attributes), [
|
||||
'payload' => array_merge($payload, [
|
||||
'name' => $name,
|
||||
]),
|
||||
'checkout' => $checkout
|
||||
]);
|
||||
|
||||
return $this->user->asPaymentsUser('POST', 'subscriptions', $attributes)->data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user