Gate payment gateway behind Pro and Business plans.
Deploy Ladill Events / deploy (push) Successful in 46s

Free accounts can no longer connect or use Paystack/Flutterwave/Hubtel;
settings show an upgrade path and checkout requires a paid subscription.
This commit is contained in:
isaacclad
2026-07-15 21:04:03 +00:00
parent 6a793548ad
commit b73b071cb1
5 changed files with 96 additions and 29 deletions
+28
View File
@@ -75,4 +75,32 @@ class EventsProTest extends TestCase
$this->assertTrue($svc->canCreateEvent($user));
$this->assertSame(0, $svc->liveEventCount($user));
}
public function test_free_user_cannot_use_payment_gateway(): void
{
$user = $this->user();
$svc = app(SubscriptionService::class);
$this->assertFalse($svc->canUsePaymentGateway($user));
$this->assertFalse(app(\App\Services\Payments\MerchantGatewayService::class)->isConfigured($user));
}
public function test_pro_user_can_use_payment_gateway_when_configured(): void
{
Http::fake(['*/debit' => Http::response(['id' => 1], 201)]);
$user = $this->user();
$svc = app(SubscriptionService::class);
$svc->subscribe($user);
\App\Models\PaymentGatewaySetting::create([
'owner_ref' => $user->public_id,
'provider' => \App\Models\PaymentGatewaySetting::PROVIDER_PAYSTACK,
'public_key' => 'pk_test',
'secret_key' => 'sk_test',
'is_active' => true,
]);
$this->assertTrue($svc->canUsePaymentGateway($user));
$this->assertTrue(app(\App\Services\Payments\MerchantGatewayService::class)->isConfigured($user));
}
}