コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     uc_payment_enter($form_state->getValue('order_id'), 'check', $form_state->getValue('amount'), $this->currentUser()->id(), '', $form_state->getValue('comment'));
     db_insert('uc_payment_check')->fields(array('order_id' => $form_state->getValue('order_id'), 'clear_date' => mktime(12, 0, 0, $form_state->getValue('clear_month'), $form_state->getValue('clear_day'), $form_state->getValue('clear_year'))))->execute();
     drupal_set_message($this->t('Check received, expected clear date of @date.', ['@date' => uc_date_format($form_state->getValue('clear_month'), $form_state->getValue('clear_day'), $form_state->getValue('clear_year'))]));
     $form_state->setRedirect('uc_order.admin_view', ['uc_order' => $form_state->getValue('order_id')]);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function orderView(OrderInterface $order)
 {
     $cod_config = \Drupal::config('uc_payment_pack.cod.settings');
     $build = array();
     if ($cod_config->get('delivery_date') && isset($order->payment_details['delivery_month']) && isset($order->payment_details['delivery_day']) && isset($order->payment_details['delivery_year'])) {
         $build['#markup'] = t('Desired delivery date:') . '<br />' . uc_date_format($order->payment_details['delivery_month'], $order->payment_details['delivery_day'], $order->payment_details['delivery_year']);
     }
     return $build;
 }