From 755f125bf0f7a169acb6c5fe17ebd63e166685f1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 8 May 2018 17:47:47 +0300 Subject: [PATCH] Prevent multiple gateways w/tokens --- app/Models/Account.php | 2 +- app/Models/Gateway.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index d2b41875e754..ce8622855b77 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -907,7 +907,7 @@ class Account extends Eloquent $available = true; foreach ($gatewayTypes as $type) { - if ($type != GATEWAY_TYPE_TOKEN && $paymentDriver->handles($type)) { + if ($paymentDriver->handles($type)) { $available = false; break; } diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index 9ce356aa37c6..e42675e82878 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -48,6 +48,8 @@ class Gateway extends Eloquent GATEWAY_AUTHORIZE_NET, GATEWAY_MOLLIE, GATEWAY_GOCARDLESS, + GATEWAY_BITPAY, + GATEWAY_DWOLLA, GATEWAY_CUSTOM1, GATEWAY_CUSTOM2, GATEWAY_CUSTOM3, @@ -60,7 +62,6 @@ class Gateway extends Eloquent */ public static $alternate = [ GATEWAY_PAYPAL_EXPRESS, - GATEWAY_GOCARDLESS, GATEWAY_BITPAY, GATEWAY_DWOLLA, GATEWAY_CUSTOM1,