From 16750e83c20c1f07e4e39777bbcb334eb6a6cc1b Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 27 Mar 2017 13:02:02 +0300 Subject: [PATCH] Added check that custom_gateway is the correct id in table --- app/Listeners/HandleUserLoggedIn.php | 6 ++++++ resources/lang/en/texts.php | 1 + 2 files changed, 7 insertions(+) diff --git a/app/Listeners/HandleUserLoggedIn.php b/app/Listeners/HandleUserLoggedIn.php index 73053ef106e4..78afb39c6811 100644 --- a/app/Listeners/HandleUserLoggedIn.php +++ b/app/Listeners/HandleUserLoggedIn.php @@ -6,6 +6,7 @@ use App\Events\UserLoggedIn; use App\Events\UserSignedUp; use App\Libraries\HistoryUtils; use App\Ninja\Repositories\AccountRepository; +use Utils; use Auth; use Carbon; use Session; @@ -65,5 +66,10 @@ class HandleUserLoggedIn } elseif ($account->isLogoTooLarge()) { Session::flash('warning', trans('texts.logo_too_large', ['size' => $account->getLogoSize() . 'KB'])); } + + // check custom gateway id is correct + if (! Utils::isNinja() && Gateway::find(GATEWAY_CUSTOM)->name !== 'Custom') { + Session::flash('error', trans('texts.error_incorrect_gateway_ids')); + } } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 8f85ddf3719e..c0a481bbd56c 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2447,6 +2447,7 @@ $LANG = array( 'credit_number' => 'Credit Number', 'create_credit_note' => 'Create Credit Note', 'menu' => 'Menu', + 'error_incorrect_gateway_ids' => 'Error: The gateways table has incorrect ids.', );