Exemplo n.º 1
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $baseSsl = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__;
     $this->context->smarty->assign(array('nbProducts' => $cart->nbProducts(), 'cust_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'total' => $cart->getOrderTotal(true, Cart::BOTH), 'isoCode' => $this->context->language->iso_code, 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'base_dir_ssl' => $baseSsl));
     $currency = new Currency($this->context->cart->id_currency);
     $step = isset($_GET['step']) ? $_GET['step'] : null;
     switch ($step) {
         case 'checkout':
             $response = $this->module->checkout($cart->getOrderTotal(), $cart->id, $currency->iso_code, $this->context->customer->secure_key, $this->context->link->getModuleLink('mtgox', 'payment'));
             if ($response['result'] == "success") {
                 header('Location: ' . $response['return']['payment_url']);
                 exit;
             } else {
                 exit('Fatal error. Could not checkout. Please try again');
             }
             break;
         case 'success':
             return $this->setTemplate('success.tpl');
             break;
         case 'failure':
             return $this->setTemplate('failure.tpl');
             break;
         case 'callback':
             $this->module->parseIpn($_POST);
             break;
         default:
             return $this->setTemplate('confirm.tpl');
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     parent::initContent();
     $this->context->smarty->assign(array('total' => $this->context->cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('validation.tpl');
 }
Exemplo n.º 3
0
 public function initContent()
 {
     global $smarty;
     parent::initContent();
     $this->setTemplate('tppaymentform.tpl');
     $smarty->assign(array('jslinkForm' => $this->getAmbientUrlForm(), 'publicKey' => $this->getPublicKey(), 'email' => $this->getMail(), 'name' => $this->getCompleteName(), 'orderId' => Tools::getValue('order')));
 }
 public function initContent()
 {
     parent::initContent();
     //Generate Kwixo form
     $this->context->smarty->assign(array('form' => KwixoFrontController::generateForm()));
     $this->setTemplate('payment_execution.tpl');
 }
Exemplo n.º 5
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $shop_name = htmlentities(Configuration::get('PS_SHOP_NAME'), NULL, 'utf-8');
     $shop_url = Tools::getHttpHost(true, true);
     $customer = Context::getContext()->customer;
     if (!preg_match("#.*\\.html\$#Ui", Tools::getValue('mail')) or !preg_match("#.*\\.html\$#Ui", Tools::getValue('mail'))) {
         die(Tools::redirect());
     }
     $file = file_get_contents(dirname(__FILE__) . '/../../mails/' . strval(preg_replace('#\\.{2,}#', '.', Tools::getValue('mail'))));
     $file = str_replace('{shop_name}', $shop_name, $file);
     $file = str_replace('{shop_url}', $shop_url . __PS_BASE_URI__, $file);
     $file = str_replace('{shop_logo}', $shop_url . _PS_IMG_ . 'logo.jpg', $file);
     $file = str_replace('{firstname}', $customer->firstname, $file);
     $file = str_replace('{lastname}', $customer->lastname, $file);
     $file = str_replace('{email}', $customer->email, $file);
     $file = str_replace('{firstname_friend}', 'XXXXX', $file);
     $file = str_replace('{lastname_friend}', 'xxxxxx', $file);
     $file = str_replace('{link}', 'authentication.php?create_account=1', $file);
     $discount_type = (int) Configuration::get('REFERRAL_DISCOUNT_TYPE');
     if ($discount_type == 1) {
         $file = str_replace('{discount}', Discount::display((double) Configuration::get('REFERRAL_PERCENTAGE'), $discount_type, new Currency($this->context->currency->id)), $file);
     } else {
         $file = str_replace('{discount}', Discount::display((double) Configuration::get('REFERRAL_DISCOUNT_VALUE_' . $this->context->currency->id), $discount_type, new Currency($this->context->currency->id)), $file);
     }
     $this->context->smarty->assign(array('content' => $file));
     $this->setTemplate('email.tpl');
 }
Exemplo n.º 6
0
 public function initContent()
 {
     parent::initContent();
     $this->paypal = new PayPal();
     $this->context = Context::getContext();
     $this->id_module = (int) Tools::getValue('id_module');
     $this->id_order = (int) Tools::getValue('id_order');
     $order = new Order($this->id_order);
     $order_state = new OrderState($order->current_state);
     $paypal_order = PayPalOrder::getOrderById($this->id_order);
     if ($order_state->template[$this->context->language->id] == 'payment_error') {
         $this->context->smarty->assign(array('message' => $order_state->name[$this->context->language->id], 'logs' => array($this->paypal->l('An error occurred while processing payment.')), 'order' => $paypal_order, 'price' => Tools::displayPrice($paypal_order['total_paid'], $this->context->currency)));
         return $this->setTemplate('error.tpl');
     }
     $order_currency = new Currency((int) $order->id_currency);
     $display_currency = new Currency((int) $this->context->currency->id);
     $price = Tools::convertPriceFull($paypal_order['total_paid'], $order_currency, $display_currency);
     $this->context->smarty->assign(array('is_guest' => $this->context->customer->is_guest || $this->context->customer->id == false, 'order' => $paypal_order, 'price' => Tools::displayPrice($price, $this->context->currency->id), 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()));
     if ($this->context->customer->is_guest || $this->context->customer->id == false) {
         $this->context->smarty->assign(array('id_order' => (int) $this->id_order, 'id_order_formatted' => sprintf('#%06d', (int) $this->id_order), 'order_reference' => $order->reference));
         /* If guest we clear the cookie for security reason */
         $this->context->customer->mylogout();
     }
     if ($this->context->getMobileDevice() == true) {
         $this->setTemplate('order-confirmation-mobile.tpl');
     } else {
         $this->setTemplate('order-confirmation.tpl');
     }
 }
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     try {
         if (!Maestrano::param('connec.enabled')) {
             return false;
         }
         $client = new Maestrano_Connec_Client();
         $notification = json_decode(file_get_contents('php://input'), false);
         $entity_name = strtoupper(trim($notification->entity));
         $entity_id = $notification->id;
         switch ($entity_name) {
             case "PERSONS":
                 $customerMapper = new CustomerMapper();
                 $customerMapper->fetchConnecResource($entity_id);
                 break;
             case "ITEMS":
                 $productMapper = new ProductMapper();
                 $productMapper->fetchConnecResource($entity_id);
                 break;
             case "TAXCODES":
                 $taxMapper = new TaxMapper();
                 $taxMapper->fetchConnecResource($entity_id);
                 break;
         }
     } catch (Exception $e) {
         error_log("Caught exception in subscribe " . json_encode($e->getMessage()));
     }
 }
Exemplo n.º 8
0
 public function init()
 {
     parent::init();
     require_once $this->module->getLocalPath() . 'MailAlert.php';
     $this->id_product = (int) Tools::getValue('id_product');
     $this->id_product_attribute = (int) Tools::getValue('id_product_attribute');
 }
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     $link = new Link();
     parent::initContent();
     $this->setTemplate('warning_page.tpl');
 }
Exemplo n.º 10
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $id_cart = Tools::GetValue('id_cart');
     $cart = new Cart((int) $id_cart);
     $liqpay = new Liqpay();
     $total = $cart->getOrderTotal(true, 3);
     $liqpay->validateOrder(intval($cart->id), Configuration::get('PS_OS_PREPARATION'), $total, $liqpay->displayName);
     $currency = new Currency((int) $cart->id_currency);
     $private_key = Configuration::get('LIQPAY_PRIVATE_KEY');
     $public_key = Configuration::get('LIQPAY_PUBLIC_KEY');
     $amount = number_format($cart->getOrderTotal(true, Cart::BOTH), 1, '.', '');
     $currency = $currency->iso_code == 'RUR' ? 'RUB' : $currency->iso_code;
     $order_id = '000' . $id_cart;
     $description = 'Order #' . $order_id;
     $result_url = 'http://' . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'index.php?controller=history';
     $server_url = 'http://' . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . $liqpay->getPath() . 'validation.php';
     $type = 'buy';
     $version = '3';
     $language = Configuration::get('PS_LOCALE_LANGUAGE') == 'en' ? 'en' : 'ru';
     $data = base64_encode(json_encode(array('version' => $version, 'public_key' => $public_key, 'amount' => $amount, 'currency' => $currency, 'description' => $description, 'order_id' => $order_id, 'type' => $type, 'language' => $language)));
     $signature = base64_encode(sha1($private_key . $data . $private_key, 1));
     $this->context->smarty->assign(compact('data', 'signature'));
     $this->setTemplate('redirect.tpl');
 }
 public function initContent()
 {
     parent::initContent();
     $params = KwixoURLCallFrontController::ManageUrlCall();
     $payment_ok = $params['payment_status'];
     $errors = $params['errors'];
     $id_order = $params['id_order'];
     if ($id_order != false) {
         $order = new Order($id_order);
         $cart = new Cart($order->id_cart);
         $products = $cart->getProducts();
         $amount = $order->total_paid_tax_incl;
         $total_shipping = $order->total_shipping;
     } else {
         $products = false;
         $amount = false;
         $total_shipping = false;
     }
     $link = new Link();
     $this->context->smarty->assign('payment_ok', $payment_ok);
     $this->context->smarty->assign('errors', $errors);
     $this->context->smarty->assign('amount', $amount);
     $this->context->smarty->assign('total_shipping', $total_shipping);
     $this->context->smarty->assign('products', $products);
     $this->context->smarty->assign('path_order', $link->getPageLink('order', true));
     $this->context->smarty->assign('path_history', $link->getPageLink('history', true));
     $this->context->smarty->assign('path_contact', $link->getPageLink('contact', true));
     $this->setTemplate('urlcall.tpl');
 }
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $this->context->smarty->assign(array('payment_status' => $this->module->payment_status, 'nbProducts' => $cart->nbProducts(), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'errors' => $this->errors));
     $this->setTemplate('error.tpl');
 }
Exemplo n.º 13
0
 public function initContent()
 {
     parent::initContent();
     $ordernumber = Tools::getValue('InvId');
     $this->context->smarty->assign('ordernumber', $ordernumber);
     if (Configuration::get('robokassa_postvalidate')) {
         if (!$ordernumber) {
             robokassa::validateAnsver($this->module->l('Cart number is not set'));
         }
         $cart = new Cart((int) $ordernumber);
         if (!Validate::isLoadedObject($cart)) {
             robokassa::validateAnsver($this->module->l('Cart does not exist'));
         }
         if (!($ordernumber = Order::getOrderByCartId($cart->id))) {
             $this->setTemplate('waitingPayment.tpl');
         }
     }
     if (!$ordernumber) {
         robokassa::validateAnsver($this->module->l('Order number is not set'));
     }
     $order = new Order((int) $ordernumber);
     if (!Validate::isLoadedObject($order)) {
         robokassa::validateAnsver($this->module->l('Order does not exist'));
     }
     $customer = new Customer((int) $order->id_customer);
     if ($customer->id != $this->context->cookie->id_customer) {
         robokassa::validateAnsver($this->module->l('You are not logged in'));
     }
     if ($order->hasBeenPaid()) {
         Tools::redirectLink(__PS_BASE_URI__ . 'order-confirmation.php?key=' . $customer->secure_key . '&id_cart=' . (int) $order->id_cart . '&id_module=' . (int) $this->module->id . '&id_order=' . (int) $order->id);
     } else {
         $this->setTemplate('waitingPayment.tpl');
     }
 }
Exemplo n.º 14
0
 public function initContent()
 {
     $meta = array();
     parent::initContent();
     $colums = Context::getContext()->theme->hasColumns(Context::getContext()->controller->page_name);
     if ($colums) {
         $hide_column_left = isset($colums['left_column']) && !empty($colums['left_column']) ? 0 : 1;
         $hide_column_right = isset($colums['right_column']) && !empty($colums['right_column']) ? 0 : 1;
     }
     /*  if ( Tools::getvalue('id_category') && Tools::getvalue('id_category') != Null) {
             $this->context->smarty->assign(BlogCategory::GetMetaByCategory(Tools::getvalue('id_category')));
         }
         if (Tools::getvalue('id_post') && Tools::getvalue('id_post') != Null) {
             $this->context->smarty->assign(SmartBlogPost::GetPostMetaByPost(Tools::getvalue('id_post')));
         }
         if (Tools::getvalue('id_category') == Null && Tools::getvalue('id_post') == Null) {
             $meta['meta_title'] = Configuration::get('smartblogmetatitle');
             $meta['meta_description'] = Configuration::get('smartblogmetadescrip');
             $meta['meta_keywords'] = Configuration::get('smartblogmetakeyword');
             $this->context->smarty->assign($meta);
         }
         */
     $this->context->smarty->assign($meta);
     if (Configuration::get('smartshowcolumn') == 0) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'hide_right_column' => '', 'hide_left_column' => '', 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     } elseif (Configuration::get('smartshowcolumn') == 1) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'hide_right_column' => '1', 'hide_left_column' => '', 'HOOK_RIGHT_COLUMN' => ''));
     } elseif (Configuration::get('smartshowcolumn') == 2) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => '', 'hide_right_column' => '', 'hide_left_column' => '1', 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     } elseif (Configuration::get('smartshowcolumn') == 3) {
         $this->context->smarty->assign(array('hide_right_column' => $hide_column_right, 'hide_left_column' => $hide_column_left));
     } else {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'hide_right_column' => '', 'hide_left_column' => '', 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     }
 }
Exemplo n.º 15
0
 public function initContent()
 {
     parent::initContent();
     $id = $_GET['id'];
     $id_lang = $this->context->language->id;
     $product = new Product((int) $id);
     $link = new Link();
     $url = $link->getProductLink($product);
     $features = Db::getInstance()->ExecuteS('
 		SELECT fl.name feature_name, fvl.value feature_value
 		FROM ' . _DB_PREFIX_ . 'feature_product fp
 		LEFT JOIN ' . _DB_PREFIX_ . 'feature_lang fl ON (fl.id_feature = fp.id_feature AND fl.id_lang=' . $id_lang . ' )
 		LEFT JOIN ' . _DB_PREFIX_ . 'feature_value_lang fvl ON (fvl.id_feature_value = fp.id_feature_value AND fvl.id_lang=' . $id_lang . ')
 		WHERE fp.id_product=' . $id);
     //	print_r($features);
     $images = Image::getImages((int) $id_lang, (int) $product->id);
     //Limitamos el numero de fotos a cuatro solamente
     while (count($images) > 3) {
         $var = array_pop($images);
     }
     $this->context->smarty->assign(array('product' => $product, 'lang' => $id_lang, 'image' => $images, 'dir' => Tools::getHttpHost(true) . __PS_BASE_URI__ . 'modules/pdfproduct', 'email' => Configuration::get('PS_SHOP_EMAIL'), 'url' => $url, 'address' => Configuration::get('ADDRESS_SHOP'), 'background' => Configuration::get('BACKGROUND')));
     $html = $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'pdfproduct/views/templates/front/custom_template_content.tpl');
     $dompdf = new DOMPDF();
     $dompdf->set_option('enable_remote', TRUE);
     $dompdf->load_html($html);
     $dompdf->set_paper('a4', 'portrait');
     $dompdf->render();
     $dompdf->stream('producto');
     //$this->setTemplate('custom_template_content.tpl');
     //file_put_contents($filename, $dompdf->output());
     //$pdf = new PDF($product, 'CustomPdf', Context::getContext()->smarty);
     //$img_file = Tools::getHttpHost(true).__PS_BASE_URI__. '/modules/pdfproduct/views/images/background.jpg';
     //$pdf->pdf_renderer->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0);
     //$pdf->render();
 }
Exemplo n.º 16
0
 public function initContent()
 {
     parent::initContent();
     // Get class instance
     $su = new Sofortueberweisung();
     $this->setTemplate('tpl-frontend-cancel.tpl');
 }
 public function setMedia()
 {
     if (Tools::getValue("ajax") != "true") {
         parent::setMedia();
     }
     $this->addJqueryPlugin(array("idTabs"));
 }
 /**
  * Displays order confirmation page.
  */
 public function display()
 {
     $cart = $this->context->cart;
     $this->context->smarty->assign(array('order_total' => $cart->getOrderTotal(true, Cart::BOTH), 'is_empty' => $cart->nbProducts() == 0));
     $this->setTemplate('confirmation.tpl');
     parent::display();
 }
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $this->context->smarty->assign(array('payment_link' => '', 'nbProducts' => $cart->nbProducts(), 'cust_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'total' => $cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('redirect.tpl');
 }
Exemplo n.º 20
0
 public function initContent()
 {
     parent::initContent();
     $this->context = Context::getContext();
     $this->context->smarty->assign('version', $this->_whichVersion());
     $this->setTemplate('error.tpl');
 }
Exemplo n.º 21
0
 public function __construct()
 {
     parent::__construct();
     $this->context = Context::getContext();
     $aResponse['error'] = false;
     $aResponse['message'] = '';
     if (isset($_POST['action'])) {
         $id_video = $_POST['idBox'];
         $ratting = $_POST['rate'];
         if (VideosRatting::checkRatting($id_video)) {
             $videosRatting = new VideosRatting();
             $videosRatting->add(array('id_video' => $id_video, 'ratting' => $ratting));
             $aResponse['error'] = FALSE;
             $aResponse['message'] = 'Your rate has been successfuly recorded. Thanks for your rate';
         } else {
             $aResponse['error'] = true;
             $aResponse['message'] = 'Your have rated for images';
         }
     } else {
         $aResponse['error'] = true;
         $aResponse['message'] = 'An error occured during the request. Please retry';
     }
     echo json_encode($aResponse);
     die;
 }
Exemplo n.º 22
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     $this->display_column_center = true;
     $this->display_column_right = false;
     $valid_payments = array();
     if (Configuration::get('PIGMBH_PAYMILL_DEBIT')) {
         $valid_payments[] = 'debit';
     }
     if (Configuration::get('PIGMBH_PAYMILL_CREDITCARD')) {
         $valid_payments[] = 'creditcard';
     }
     if (!in_array(Tools::getValue('payment'), $valid_payments)) {
         Tools::redirectLink($this->context->link->getPageLink('order', true, null, array('step' => '1')));
     }
     $db_data = $this->getPaymillUserData();
     $this->updatePaymillClient($db_data);
     $cart = $this->context->cart;
     foreach ($this->module->getCurrency((int) $cart->id_currency) as $currency) {
         if ($currency['id_currency'] == $cart->id_currency) {
             $iso_currency = $currency['iso_code'];
             break;
         }
     }
     $brands = array();
     foreach (Tools::jsonDecode(Configuration::get('PIGMBH_PAYMILL_ACCEPTED_BRANDS'), true) as $brand_key => $brand_value) {
         $brands[str_replace('-', '', $brand_key)] = $brand_value;
     }
     $data = array('use_backward_compatible_checkout' => _PS_VERSION_ < '1.6', 'nbProducts' => $cart->nbProducts(), 'cust_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'currency_iso' => $iso_currency, 'total' => (int) round($cart->getOrderTotal(true, Cart::BOTH) * 100), 'displayTotal' => $cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'public_key' => Configuration::get('PIGMBH_PAYMILL_PUBLICKEY'), 'payment' => Tools::getValue('payment'), 'paymill_debugging' => (int) Configuration::get('PIGMBH_PAYMILL_DEBUG') == 'on', 'modul_base' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/pigmbhpaymill/', 'customer' => $this->context->customer->firstname . ' ' . $this->context->customer->lastname, 'prefilledFormData' => $this->updatePaymillPayment($db_data), 'acceptedBrands' => Configuration::get('PIGMBH_PAYMILL_ACCEPTED_BRANDS'), 'acceptedBrandsDecoded' => $brands);
     $this->context->smarty->assign($data);
     parent::initContent();
     $this->setTemplate('paymill_checkout.tpl');
 }
Exemplo n.º 23
0
 public function initContent()
 {
     parent::initContent();
     $this->ajax = true;
     $this->context->smarty->assign(array('hello' => 'hello'));
     $this->smartyOutputContent($this->getTemplatePath('default.tpl'));
 }
Exemplo n.º 24
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     parent::initContent();
     if (!$this->isTokenValid()) {
         die($this->module->l($this->module->displayName . ' Error: (invalid token)'));
     }
     $cart = $this->context->cart;
     $address = new Address((int) $cart->id_address_invoice);
     $customer = new Customer((int) $cart->id_customer);
     $currency = $this->context->currency;
     $country = new Country((int) $address->id_country);
     if (!Configuration::get('SOFORTBANKING_USER_ID')) {
         die($this->module->l($this->module->displayName . ' Error: (invalid or undefined userId)'));
     }
     if (!Configuration::get('SOFORTBANKING_PROJECT_ID')) {
         die($this->module->l($this->module->displayName . ' Error: (invalid or undefined projectId)'));
     }
     if (!Validate::isLoadedObject($address) || !Validate::isLoadedObject($customer) || !Validate::isLoadedObject($currency)) {
         die($this->module->l($this->module->displayName . ' Error: (invalid address or customer)'));
     }
     $parameters = array('user_id' => Configuration::get('SOFORTBANKING_USER_ID'), 'project_id' => Configuration::get('SOFORTBANKING_PROJECT_ID'), 'sender_holder' => '', '', '', 'sender_country_id' => $country->iso_code, 'amount' => number_format($cart->getOrderTotal(), 2, '.', ''), 'currency_id' => $currency->iso_code, 'reason_1' => time() . '-' . (int) $cart->id, 'reason_2' => $customer->firstname . ' ' . Tools::ucfirst(Tools::strtolower($customer->lastname)), 'user_variable_0' => $customer->secure_key, 'user_variable_1' => (int) $cart->id, 'user_variable_2' => '', 'user_variable_3' => '', 'user_variable_4' => '', 'user_variable_5' => '', 'project_password' => Configuration::get('SOFORTBANKING_PROJECT_PW'));
     $this->context->smarty->assign(array('this_path' => $this->module->getPathUri(), 'nbProducts' => $cart->nbProducts(), 'total' => $cart->getOrderTotal(), 'version' => _PS_VERSION_, 'hash' => sha1(implode('|', $parameters)), 'gateway' => 'https://www.sofortueberweisung.de/payment/start', 'cprotect' => Configuration::get('SOFORTBANKING_CPROTECT'), 'parameters' => $parameters, 'mod_lang' => $this->isSupportedLang()));
     $this->setTemplate(Configuration::get('SOFORTBANKING_REDIRECT') == 'Y' ? 'payment_redirect.tpl' : 'payment_execution.tpl');
 }
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->paypal_usa = new PayPalUSA();
     if ($this->paypal_usa->active && Configuration::get('PAYPAL_USA_EXPRESS_CHECKOUT') == 1) {
         $pp_exp = 1 * (int) Tools::getValue('pp_exp_initial') + 2 * (int) Tools::getValue('pp_exp_checkout') + 3 * (int) Tools::getValue('pp_exp_payment');
         switch ($pp_exp) {
             /* Step 1 - Called the 1st time customer is clicking on the PayPal Express Checkout button */
             case 1:
                 $this->_expressCheckoutInitial();
                 break;
                 /* Step 2 - Called by PayPal when the customer is redirected back from PayPal to the store (to retrieve the customer address and details) */
             /* Step 2 - Called by PayPal when the customer is redirected back from PayPal to the store (to retrieve the customer address and details) */
             case 2:
                 $this->_expressCheckout();
                 break;
                 /* Step 3 - Called when the customer is placing his/her order / making his payment */
             /* Step 3 - Called when the customer is placing his/her order / making his payment */
             case 3:
                 $this->_expressCheckoutPayment();
                 break;
             default:
                 $this->_expressCheckoutInitial();
         }
     }
 }
Exemplo n.º 26
0
 public function __construct()
 {
     parent::__construct();
     if ($this->ajax) {
         $this->content_only = true;
     }
 }
Exemplo n.º 27
0
 public function initContent()
 {
     parent::initContent();
     $module = new Leotempcp();
     echo $module->renderwidget();
     die;
 }
 public function initContent()
 {
     parent::initContent();
     if ($id_category = Tools::getvalue('id_category') && Tools::getvalue('id_category') != Null) {
         $this->context->smarty->assign(BlogCategory::GetMetaByCategory(Tools::getvalue('id_category')));
     }
     if ($id_post = Tools::getvalue('id_post') && Tools::getvalue('id_post') != Null) {
         $this->context->smarty->assign(SmartBlogPost::GetPostMetaByPost(Tools::getvalue('id_post')));
     }
     if (Tools::getvalue('id_category') == Null && Tools::getvalue('id_post') == Null) {
         $meta['meta_title'] = Configuration::get('smartblogmetatitle');
         $meta['meta_description'] = Configuration::get('smartblogmetadescrip');
         $meta['meta_keywords'] = Configuration::get('smartblogmetakeyword');
         $this->context->smarty->assign($meta);
     }
     if (Configuration::get('smartshowcolumn') == 0) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     } elseif (Configuration::get('smartshowcolumn') == 1) {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft')));
     } elseif (Configuration::get('smartshowcolumn') == 2) {
         $this->context->smarty->assign(array('HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     } elseif (Configuration::get('smartshowcolumn') == 3) {
         $this->context->smarty->assign(array());
     } else {
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displaySmartBlogLeft'), 'HOOK_RIGHT_COLUMN' => Hook::exec('displaySmartBlogRight')));
     }
 }
Exemplo n.º 29
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     $this->display_column_right = false;
     parent::initContent();
     $cart = $this->context->cart;
     $client = $this->context->customer;
     $invoice_address = new Address((int) $cart->id_address_invoice);
     $state = new State((int) $invoice_address->id_state);
     $arreglo_meses = array();
     for ($i = 1; $i <= 12; $i++) {
         $arreglo_meses[] = sprintf("%02s", $i);
     }
     $arreglo_anyos = array();
     $anyo_actual = date("Y", time());
     for ($i = 0; $i < 12; $i++) {
         $arreglo_anyos[] = substr($anyo_actual + $i, -2);
     }
     session_start();
     $arreglo_errores = array();
     if (is_array($_SESSION['errores'])) {
         foreach ($_SESSION['errores'] as $key => $value) {
             $arreglo_errores[$key] = $value;
         }
     }
     unset($_SESSION['errores']);
     $this->context->smarty->assign(array('nbProducts' => $cart->nbProducts(), 'monto' => $cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'nombre' => $client->firstname, 'apellidos' => $client->lastname, 'cp' => $invoice_address->postcode, 'monto' => $cart->getOrderTotal(true, Cart::BOTH), 'email' => $client->email, 'telefono' => $invoice_address->phone, 'celular' => $invoice_address->phone_mobile, 'calleyNumero' => $invoice_address->address1, 'colonia' => '', 'municipio' => $invoice_address->city, 'estado' => $state->name, 'pais' => $invoice_address->country, 'anyos' => $arreglo_anyos, 'meses' => $arreglo_meses, 'errores' => $arreglo_errores));
     $this->setTemplate('payment_execution.tpl');
 }
Exemplo n.º 30
0
 public function initContent()
 {
     $log = null;
     $this->display_header = false;
     $this->display_footer = false;
     parent::initContent();
     $transaction = Tools::getValue('transaction');
     if (Tools::isEmpty($transaction)) {
         die(Tools::displayError('Wrong use of the HTTP notifications. Please set up your sofortüberweisung.de notification to call this URL only with POST method.'));
     }
     $orderState = _PS_OS_PAYMENT_;
     $baseDir = dirname(__FILE__);
     $useSSL = true;
     // Get class instance
     $su = new Sofortueberweisung();
     // Set order state to "awaiting payment"
     $orderState = Configuration::get('_SU_OS_OK_');
     $cartId = 0;
     // Check incoming response
     if ($su->checkResponse($_POST, $log)) {
         // Get cartId from the response
         $cartId = (int) Tools::getValue('user_variable_0');
         // Get the cart object
         $cart = new Cart($cartId);
         // Get the customer object
         $customer = new Customer((int) $cart->id_customer);
         // Get order sum
         $orderSum = (double) Tools::getValue('amount');
         $currency_special = $cart->id_currency;
         $message = 'Payment through Sofortüberweisung.de - Transaction-ID: ' . $transaction . ' ';
         $secure_key = $customer->secure_key;
         // Create order
         $su->updateOrder($cartId, $orderState, $orderSum, $message, $currency_special, $secure_key);
     }
 }