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 BANK_TRANSFER = 2;
const PAYPAL = 3; const PAYPAL = 3;
const CRYPTO = 4; const CRYPTO = 4;
const DWOLLA = 5; const CUSTOM = 5;
const CUSTOM1 = 6; const ALIPAY = 6;
const ALIPAY = 7; const SOFORT = 7;
const SOFORT = 8; const APPLE_PAY = 8;
const SEPA = 9;
const GOCARDLESS = 10;
const APPLE_PAY = 11;
const CUSTOM2 = 12;
const CUSTOM3 = 13;
const TOKEN = 'token';
public function gateway() public function gateway()
{ {

View File

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

View File

@ -108,7 +108,6 @@ class StripePaymentDriver extends BaseDriver
{ {
$types = [ $types = [
GatewayType::CREDIT_CARD, 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'])) { 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) { switch ($gateway_type_id) {
case GatewayType::CREDIT_CARD: case GatewayType::CREDIT_CARD:
case GatewayType::TOKEN:
return 'gateways.stripe.credit_card'; return 'gateways.stripe.credit_card';
break; break;
case GatewayType::SOFORT: case GatewayType::SOFORT: