From 6662950e51c8436e7d8914f51570b42460f638f9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 4 Aug 2014 06:34:53 -0700 Subject: [PATCH] Fixed issue when setting payment API key --- app/controllers/AccountController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index ac80dcda8464..2b7cd08e26d8 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -644,11 +644,14 @@ class AccountController extends \BaseController { $config->$field = $value; } - $cardCount = 0; - foreach($creditcards as $card => $value) - { - $cardCount += intval($value); - } + $cardCount = 0; + if ($creditcards) + { + foreach($creditcards as $card => $value) + { + $cardCount += intval($value); + } + } $accountGateway->config = json_encode($config); $accountGateway->accepted_credit_cards = $cardCount;