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:
@@ -10,7 +10,7 @@ class Subscriptions
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get subscriptions from user.
|
* Get subscriptions from user.
|
||||||
*
|
*
|
||||||
@@ -37,21 +37,11 @@ class Subscriptions
|
|||||||
* name, description, period, price
|
* name, description, period, price
|
||||||
* and following attributes are optional:
|
* and following attributes are optional:
|
||||||
* vat, payload, ends_at, webhook_url, webhook_secret
|
* 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
|
* @return object|false the subscription object
|
||||||
* @throws GuzzleException
|
* @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;
|
return $this->user->asPaymentsUser('POST', 'subscriptions', $attributes)->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user