Gate payment gateway behind Pro and Business plans.
Deploy Ladill Events / deploy (push) Successful in 46s
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:
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Models\PaymentGatewaySetting;
|
||||
use App\Models\QrSetting;
|
||||
use App\Services\Billing\BillingClient;
|
||||
use App\Services\Events\SubscriptionService;
|
||||
use App\Services\Payments\MerchantGatewayService;
|
||||
use App\Support\AccountBranding;
|
||||
use App\Support\Qr\QrCornerStyleCatalog;
|
||||
@@ -21,6 +22,7 @@ class AccountController extends Controller
|
||||
public function __construct(
|
||||
private BillingClient $billing,
|
||||
private MerchantGatewayService $gateway,
|
||||
private SubscriptionService $subscriptions,
|
||||
) {}
|
||||
|
||||
private function topupUrl(): string
|
||||
@@ -83,6 +85,7 @@ class AccountController extends Controller
|
||||
'cornerInnerStyles' => QrCornerStyleCatalog::innerStyles(),
|
||||
'frameStyles' => QrFrameStyleCatalog::visible(),
|
||||
'gateway' => $this->gateway->settingFor($account),
|
||||
'canUsePaymentGateway' => $this->subscriptions->canUsePaymentGateway($account),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -164,7 +167,7 @@ class AccountController extends Controller
|
||||
);
|
||||
|
||||
$provider = (string) ($data['gateway_provider'] ?? '');
|
||||
if ($provider !== '') {
|
||||
if ($provider !== '' && $this->subscriptions->canUsePaymentGateway($account)) {
|
||||
$existing = PaymentGatewaySetting::query()->firstOrNew([
|
||||
'owner_ref' => $account->public_id,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user