You are here

public function Other::orderView in Ubercart 8.4

Called when an order is being viewed by an administrator.

Parameters

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

Return value

array A render array.

Overrides PaymentMethodPluginBase::orderView

File

payment/uc_payment_pack/src/Plugin/Ubercart/PaymentMethod/Other.php, line 21

Class

Other
Defines a generic payment method.

Namespace

Drupal\uc_payment_pack\Plugin\Ubercart\PaymentMethod

Code

public function orderView(OrderInterface $order) {
  $build = [];
  if ($description = $this->database
    ->query('SELECT description FROM {uc_payment_other} WHERE order_id = :id', [
    ':id' => $order
      ->id(),
  ])
    ->fetchField()) {
    $build = [
      '#markup' => $this
        ->t('Description: @desc', [
        '@desc' => $description,
      ]),
    ];
  }
  return $build;
}