You are here

public function EcheckTransactionVerifier::processPayment in Commerce Authorize.Net 8

Processes the payment.

Parameters

\Drupal\commerce_payment\Entity\PaymentInterface $payment: The payment.

Overrides PaymentProcessorInterface::processPayment

File

src/EcheckTransactionVerifier.php, line 87

Class

EcheckTransactionVerifier
Verify echeck transaction states.

Namespace

Drupal\commerce_authnet

Code

public function processPayment(PaymentInterface $payment) {
  $payment_gateway_plugin = $payment
    ->getPaymentGateway()
    ->getPlugin();
  if (!$payment_gateway_plugin instanceof Echeck) {
    return NULL;
  }
  if ($payment
    ->getState() !== 'completed') {
    $payment_gateway_plugin
      ->capturePayment($payment);
  }
}