You are here

public function CashOnDelivery::cartReview in Ubercart 8.4

Returns the payment method review details.

Parameters

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

Return value

array

Overrides PaymentMethodPluginBase::cartReview

File

payment/uc_payment_pack/src/Plugin/Ubercart/PaymentMethod/CashOnDelivery.php, line 110

Class

CashOnDelivery
Defines the cash on delivery payment method.

Namespace

Drupal\uc_payment_pack\Plugin\Ubercart\PaymentMethod

Code

public function cartReview(OrderInterface $order) {
  $review = [];
  if ($this->configuration['delivery_date'] && isset($order->payment_details['delivery_date'])) {
    $date = \Drupal::service('date.formatter')
      ->format($order->payment_details['delivery_date'], 'uc_store');
    $review[] = [
      'title' => $this
        ->t('Delivery date'),
      'data' => $date,
    ];
  }
  return $review;
}