Example #1
0
 /**
  * Action confirmation page for form payment
  */
 public function actionConfirm()
 {
     parent::actionConfirm();
     $api = $this->buildApi();
     $details = HelperCommon::getStore('details');
     $api->updateData($details);
     // fill items with product details
     $items = array();
     foreach ($api->getBasket()->getItems() as $item) {
         $items[] = array('productUrlImage' => $this->getProductUrlImage($item->getDescription()), 'description' => $item->getDescription(), 'quantity' => $item->getQuantity(), 'unitGrossAmount' => number_format($item->getUnitGrossAmount(), 2), 'totalGrossAmount' => number_format($item->getTotalGrossAmount(), 2));
     }
     $env = $this->sagepayConfig->getEnv();
     // Render confirm page for form payment
     $view = new HelperView('form/confirm');
     $view->setData(array('basket' => array('items' => $items, 'deliveryGrossPrice' => number_format($api->getBasket()->getDeliveryGrossAmount(), 2), 'totalGrossPrice' => number_format($api->getBasket()->getAmount(), 2)), 'env' => $env, 'vendorName' => $this->sagepayConfig->getVendorName(), 'integrationType' => $this->integrationType, 'currency' => $this->sagepayConfig->getCurrency(), 'purchaseUrl' => $this->sagepayConfig->getPurchaseUrl('form', $env), 'request' => $api->createRequest(), 'displayQueryString' => htmlspecialchars(rawurldecode(utf8_encode($api->getQueryData()))), 'details' => $details));
     $view->render();
 }