From c641ec725ddea4130255f0868f539e638381e680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurice=20Preu=C3=9F?= Date: Sun, 21 Sep 2025 12:13:56 +0000 Subject: [PATCH] add refund to revoke endpoint --- src/Id/Resources/Subscription.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Id/Resources/Subscription.php b/src/Id/Resources/Subscription.php index fa43b5b..7fb9445 100644 --- a/src/Id/Resources/Subscription.php +++ b/src/Id/Resources/Subscription.php @@ -70,9 +70,13 @@ class Subscription extends BaseResource * * @throws Throwable */ - public function revoke(): self + public function revoke(bool $refund = false): self { - return (new self(fn() => $this->billable->request('PUT', sprintf('v1/subscriptions/%s/revoke', $this->id)))) + $attributes = [ + 'refund' => $refund, + ]; + + return (new self(fn() => $this->billable->request('PUT', sprintf('v1/subscriptions/%s/revoke', $this->id), $attributes))) ->setBillable($this->billable); } @@ -107,4 +111,4 @@ class Subscription extends BaseResource { return $this->billable->request('DELETE', sprintf('v1/subscriptions/%s', $this->id))->success(); } -} \ No newline at end of file +}