Make Events payment routing plan-aware.
Deploy Ladill Events / deploy (push) Successful in 51s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-21 19:47:10 +00:00
co-authored by Cursor
parent 837c249634
commit 1bcbdbfdb1
6 changed files with 119 additions and 37 deletions
@@ -174,12 +174,17 @@ class AccountController extends Controller
);
$provider = (string) ($data['gateway_provider'] ?? '');
if ($provider !== '' && $this->subscriptions->canUsePaymentGateway($account)) {
if ($this->subscriptions->canUsePaymentGateway($account)) {
$existing = PaymentGatewaySetting::query()->firstOrNew([
'owner_ref' => $account->public_id,
]);
$existing->provider = $provider;
$existing->is_active = $request->boolean('gateway_is_active', true);
if ($provider === '' && ! $existing->exists) {
return redirect()->route('account.settings')->with('success', 'Settings saved.');
}
if ($provider !== '') {
$existing->provider = $provider;
}
$existing->is_active = $provider !== '' && $request->boolean('gateway_is_active');
if (filled($data['gateway_public_key'] ?? null)) {
$existing->public_key = $data['gateway_public_key'];
}