Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user