You are here

public function PayPalPaymentsStandard::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_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalPaymentsStandard.php, line 183

Class

PayPalPaymentsStandard
Defines the PayPal Payments Standard payment method.

Namespace

Drupal\uc_paypal\Plugin\Ubercart\PaymentMethod

Code

public function orderView(OrderInterface $order) {
  $txn_id = $this->database
    ->query("SELECT txn_id FROM {uc_payment_paypal_ipn} WHERE order_id = :id ORDER BY received ASC", [
    ':id' => $order
      ->id(),
  ])
    ->fetchField();
  if (empty($txn_id)) {
    $txn_id = $this
      ->t('Unknown');
  }
  $build['#markup'] = $this
    ->t('Transaction ID:<br />@txn_id', [
    '@txn_id' => $txn_id,
  ]);
  return $build;
}