You are here

public function PaymentMethod::getPaymentGateway in Commerce Core 8.2

Gets the payment gateway.

Return value

\Drupal\commerce_payment\Entity\PaymentGatewayInterface|null The payment gateway entity, or null if unknown.

Overrides EntityWithPaymentGatewayInterface::getPaymentGateway

1 call to PaymentMethod::getPaymentGateway()
PaymentMethod::preSave in modules/payment/src/Entity/PaymentMethod.php
Acts on an entity before the presave hook is invoked.

File

modules/payment/src/Entity/PaymentMethod.php, line 95

Class

PaymentMethod
Defines the payment method entity class.

Namespace

Drupal\commerce_payment\Entity

Code

public function getPaymentGateway() {
  return $this
    ->get('payment_gateway')->entity;
}