Пример #1
0
 /**
  * Action for action extra information page
  */
 public function actionExtraInformation()
 {
     // Check basket xml and collect recipient details
     if ($this->sagepayConfig->basketAsXmlDisabled() && !$this->sagepayConfig->getCollectRecipientDetails()) {
         $this->redirect($this->integrationType, 'details');
     }
     if ($this->integrationType != SAGEPAY_DIRECT) {
         $message = $this->saveExtra($this->integrationType, 'confirm');
     } else {
         // Check token for DIRECT integration type
         $token = HelperCommon::getStore('account', 'token');
         $message = $this->saveExtra($this->integrationType, $token ? 'card-token' : 'card');
     }
     $current = $this->getDefaultExtraDetails();
     // Check if extra information was failed
     if ($this->error) {
         $current['extra'] = filter_input(INPUT_POST, 'extra');
         $current['tourOperatorFrom'] = filter_input(INPUT_POST, 'tourFrom');
         $current['tourOperatorTo'] = filter_input(INPUT_POST, 'tourTo');
         $current['carRentalFrom'] = filter_input(INPUT_POST, 'carFrom');
         $current['carRentalTo'] = filter_input(INPUT_POST, 'carTo');
         $current['cruiseFrom'] = filter_input(INPUT_POST, 'cruiseFrom');
         $current['cruiseTo'] = filter_input(INPUT_POST, 'cruiseTo');
         $current['hotelFrom'] = filter_input(INPUT_POST, 'hotelFrom');
         $current['hotelTo'] = filter_input(INPUT_POST, 'hotelTo');
         $current['numberInParty'] = filter_input(INPUT_POST, 'numberInParty');
         $current['guestName'] = filter_input(INPUT_POST, 'guestName');
         $current['referenceNumber'] = filter_input(INPUT_POST, 'referenceNumber');
         $current['roomRate'] = filter_input(INPUT_POST, 'roomRate');
     }
     // Array of trip options
     $tripSelectors = array('tour' => 'Tour', 'car' => 'Car Rental', 'cruise' => 'Cruise', 'hotel' => 'Hotel');
     // Render view extra information
     $view = new HelperView('common/extra_information');
     $view->setData(array('actionUrl' => url(array($this->integrationType, 'extra-information')), 'backUrl' => url(array($this->integrationType, 'details')), 'current' => $current, 'env' => $this->sagepayConfig->getEnv(), 'vendorName' => $this->sagepayConfig->getVendorName(), 'integrationType' => $this->integrationType, 'collectRecipientDetails' => $this->sagepayConfig->getCollectRecipientDetails(), 'basketXml' => !$this->sagepayConfig->basketAsXmlDisabled(), 'tripSelectors' => $tripSelectors, 'error' => $this->error, 'message' => $message));
     $view->render();
 }