You are here

public function CreditCardPaymentMethodBase::orderSubmit in Ubercart 8.4

Called when an order is being submitted with this payment method.

Parameters

\Drupal\uc_order\OrderInterface $order: The order that is being submitted.

Return value

string|null An error message that can be shown to the user if the payment failed, or NULL if everything was successful.

Overrides PaymentMethodPluginBase::orderSubmit

File

payment/uc_credit/src/CreditCardPaymentMethodBase.php, line 591

Class

CreditCardPaymentMethodBase
Defines a base credit card payment method plugin implementation.

Namespace

Drupal\uc_credit

Code

public function orderSubmit(OrderInterface $order) {

  // Attempt to process the credit card payment.
  if (!$this
    ->processPayment($order, $order
    ->getTotal(), $this->configuration['txn_type'])) {
    return $this
      ->t('We were unable to process your credit card payment. Please verify your details and try again.');
  }
}