add set default payment method

Signed-off-by: Maurice Preuß <envoyr@froxlor.org>
This commit is contained in:
Maurice Preuß committed 2026-05-17 16:46:06 +02:00
1 parent 4555efa80c
commit a7ec7aa908
2 files changed
+48 -21

No files matched your search

+21 -8
View File
@@ -55,14 +55,27 @@ trait ManagesPaymentMethods
* @throws Throwable
* @see \Anikeen\Id\Resources\PaymentMethods::hasDefaultPaymentMethod()
*/
public function hasDefaultPaymentMethod(): bool
{
return $this->paymentMethods()->hasDefaultPaymentMethod();
}
/**
* Get billing portal URL for the current user.
*
public function hasDefaultPaymentMethod(): bool
{
return $this->paymentMethods()->hasDefaultPaymentMethod();
}
/**
* Set the default payment method for the current user.
*
* @throws Throwable
* @see \Anikeen\Id\Resources\PaymentMethods::setDefault()
*/
public function setDefaultPaymentMethod(string $id): PaymentMethod
{
unset($this->paymentMethodsCache);
return $this->paymentMethods()->setDefault($id);
}
/**
* Get billing portal URL for the current user.
*
* @param string|null $returnUrl The URL to redirect to after the user has finished in the billing portal.
* @param array $options Additional options for the billing portal.
* @throws Throwable