From bc04d66371ea79423adebfe17042c927e4a47d24 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 21 Mar 2017 11:32:02 +0200 Subject: [PATCH] Ensure account gateway fields array is initialized --- app/Http/Controllers/AccountGatewayController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index 177bdbe14a..44bbd40006 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -132,6 +132,10 @@ class AccountGatewayController extends BaseController $currentGateways = $account->account_gateways; $gateways = Gateway::where('payment_library_id', '=', 1)->orderBy('name')->get(); + if ($accountGateway) { + $accountGateway->fields = []; + } + foreach ($gateways as $gateway) { $fields = $gateway->getFields(); if (! $gateway->isCustom()) {