add refund to revoke endpoint

This commit is contained in:
2025-09-21 12:13:56 +00:00
parent 8eb0c25582
commit c641ec725d

View File

@@ -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();
}
}
}