You are here

public function Other::orderLoad in Ubercart 8.4

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

Parameters

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

Overrides PaymentMethodPluginBase::orderLoad

File

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

Class

Other
Defines a generic payment method.

Namespace

Drupal\uc_payment_pack\Plugin\Ubercart\PaymentMethod

Code

public function orderLoad(OrderInterface $order) {
  $description = $this->database
    ->query('SELECT description FROM {uc_payment_other} WHERE order_id = :id', [
    ':id' => $order
      ->id(),
  ])
    ->fetchField();
  if (isset($description)) {
    $order->payment_details['description'] = $description;
  }
}