1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Refactor gateway types

This commit is contained in:
David Bomba 2020-10-12 07:59:25 +11:00
parent 6967796756
commit b12fe64a63
3 changed files with 7 additions and 20 deletions

View File

@ -22,16 +22,10 @@ class GatewayType extends StaticModel
const BANK_TRANSFER = 2;
const PAYPAL = 3;
const CRYPTO = 4;
const DWOLLA = 5;
const CUSTOM1 = 6;
const ALIPAY = 7;
const SOFORT = 8;
const SEPA = 9;
const GOCARDLESS = 10;
const APPLE_PAY = 11;
const CUSTOM2 = 12;
const CUSTOM3 = 13;
const TOKEN = 'token';
const CUSTOM = 5;
const ALIPAY = 6;
const SOFORT = 7;
const APPLE_PAY = 8;
public function gateway()
{

View File

@ -102,16 +102,11 @@ class CheckoutComPaymentDriver extends BaseDriver
*/
public function viewForType($gateway_type_id)
{
//currently only ever token or creditcard so no need for switches
$this->payment_method = $gateway_type_id;
if ($gateway_type_id == GatewayType::CREDIT_CARD) {
return 'gateways.checkout.credit_card';
}
if ($gateway_type_id == GatewayType::TOKEN) {
return 'gateways.checkout.credit_card';
}
return 'gateways.checkout.credit_card';
}
/**

View File

@ -108,7 +108,6 @@ class StripePaymentDriver extends BaseDriver
{
$types = [
GatewayType::CREDIT_CARD,
//GatewayType::TOKEN,
];
if ($this->company_gateway->getSofortEnabled() && $this->invitation && $this->client() && isset($this->client()->country) && in_array($this->client()->country, ['AUT', 'BEL', 'DEU', 'ITA', 'NLD', 'ESP'])) {
@ -142,7 +141,6 @@ class StripePaymentDriver extends BaseDriver
{
switch ($gateway_type_id) {
case GatewayType::CREDIT_CARD:
case GatewayType::TOKEN:
return 'gateways.stripe.credit_card';
break;
case GatewayType::SOFORT: