You are here

public function PaymentGatewayBase::getDefaultPaymentMethodType in Commerce Core 8.2

Gets the default payment method type.

Return value

\Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType\PaymentMethodTypeInterface The default payment method type.

Overrides PaymentGatewayInterface::getDefaultPaymentMethodType

File

modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php, line 255

Class

PaymentGatewayBase
Provides the base class for payment gateways.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function getDefaultPaymentMethodType() {
  $default_payment_method_type = $this->pluginDefinition['default_payment_method_type'];
  if (!isset($this->paymentMethodTypes[$default_payment_method_type])) {
    throw new \InvalidArgumentException('Invalid default_payment_method_type specified.');
  }
  return $this->paymentMethodTypes[$default_payment_method_type];
}