mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-14 06:06:18 +00:00
update subscription, add alias
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
@@ -10,15 +10,50 @@ use GuzzleHttp\Exception\GuzzleException;
|
||||
* @property string $id
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property string $status
|
||||
* @property string $unit
|
||||
* @property float $price
|
||||
* @property float $vat_rate
|
||||
* @property array $payload
|
||||
* @property string $ends_at
|
||||
* @property string $webhook_url
|
||||
* @property string $webhook_secret
|
||||
*/
|
||||
class Subscription extends BaseResource
|
||||
{
|
||||
use HasBillable;
|
||||
|
||||
/**
|
||||
* Update a given subscription from the current user.
|
||||
*
|
||||
* @param array{
|
||||
* name: null,
|
||||
* description: null|string,
|
||||
* unit: string,
|
||||
* price: float,
|
||||
* vat_rate: null|float,
|
||||
* payload: null|array,
|
||||
* ends_at: null|string,
|
||||
* webhook_url: null|string,
|
||||
* webhook_secret: null|string
|
||||
* } $attributes The subscription data:
|
||||
* - name: The name
|
||||
* - description: The description (optional)
|
||||
* - unit: The unit (e.g. "hour", "day", "week", "month", "year")
|
||||
* - price: The price per unit
|
||||
* - vat_rate: The VAT rate (optional)
|
||||
* - payload: The payload (optional)
|
||||
* - ends_at: The end date (optional)
|
||||
* - webhook_url: The webhook URL (optional)
|
||||
* - webhook_secret: The webhook secret (optional)
|
||||
* @throws RequestRequiresClientIdException
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(array $attributes): self
|
||||
{
|
||||
return (new self($this->billable->request('PUT', sprintf('v1/subscriptions/%s', $this->id), $attributes)))
|
||||
->setBillable($this->billable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Force given subscription to check out (trusted apps only).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user