Files
ladill-give/app/Services/Billing/PlanEntitlementService.php
T
isaacclad 5d642900c5
Deploy Ladill Give / deploy (push) Successful in 58s
Require Ladill Pay only for Give donations.
Remove custom/owner payment gateway option and always collect donations through Ladill Pay with platform fees.
2026-07-24 14:15:43 +00:00

30 lines
807 B
PHP

<?php
namespace App\Services\Billing;
use App\Models\User;
use Throwable;
class PlanEntitlementService
{
public const CUSTOM_PAYMENT_GATEWAY = 'custom_payment_gateway';
public function __construct(private readonly BillingClient $billing) {}
public function has(User $owner, string $feature): bool
{
try {
return in_array($feature, (array) ($this->billing->suiteEntitlement((string) $owner->public_id)['features'] ?? []), true);
} catch (Throwable) {
return false;
}
}
public function canUseCustomPaymentGateway(User $owner): bool
{
// Custom / owner payment gateways are retired. All checkouts use Ladill Pay
// with platform fees (see config/pay.php fee_tiers on the platform).
return false;
}
}