public function initContent()
 {
     $this->display_column_left = false;
     $this->process();
     if (!isset($this->context->cart)) {
         $this->context->cart = new Cart();
     }
     if (!$this->useMobileTheme()) {
         $this->context->smarty->assign(array('HOOK_HEADER' => Hook::exec('displayHeader'), 'HOOK_LEFT_COLUMN' => $this->display_column_left ? Hook::exec('displayLeftColumn') : '', 'HOOK_RIGHT_COLUMN' => $this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''));
     } else {
         $this->context->smarty->assign('HOOK_MOBILE_HEADER', Hook::exec('displayMobileHeader'));
     }
     $contextLink = $this->context->link;
     $postParameters = $this->getPostParameters();
     try {
         $sid = SkrillPaymentCore::getSid($postParameters);
     } catch (Exception $e) {
         Tools::redirect($contextLink->getPageLink('order', true, null, array('step' => '3', 'skrillerror' => 'ERROR_GENERAL_REDIRECT')));
     }
     if (!$sid) {
         Tools::redirect($contextLink->getPageLink('order', true, null, array('step' => '3', 'skrillerror' => 'ERROR_GENERAL_REDIRECT')));
     }
     $redirectUrl = SkrillPaymentCore::getSkrillRedirectUrl($sid);
     if (Configuration::get('SKRILL_GENERAL_DISPLAY') != "IFRAME") {
         Tools::redirect($redirectUrl);
     }
     $this->context->smarty->assign(array('fullname' => $this->context->customer->firstname . " " . $this->context->customer->lastname, 'lang' => $this->getLang(), 'redirectUrl' => $redirectUrl, '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($this->getTemplateName());
 }
 public function paymentConfiguration($params)
 {
     include_once dirname(__FILE__) . '/../../../../init.php';
     $this->params = $params;
     $this->context = Context::getContext();
     $this->context->smarty->assign(array('version_module' => _PS_VERSION_, 'action_url' => _PS_BASE_URL_ . __PS_BASE_URI__ . 'modules/pagseguro/standard/front/payment.php', 'image' => __PS_BASE_URI__ . 'modules/pagseguro/assets/images/logops_86x49.png', 'this_path' => __PS_BASE_URI__ . 'modules/pagseguro/', 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/pagseguro/'));
 }
 public function __construct()
 {
     global $cookie;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     $max_upload = (int) ini_get('upload_max_filesize');
     $max_post = (int) ini_get('post_max_size');
     $upload_mb = min($max_upload, $max_post);
     $timezones = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT name FROM ' . _DB_PREFIX_ . 'timezone');
     $taxes[] = array('id' => 0, 'name' => $this->l('None'));
     foreach (Tax::getTaxes((int) $cookie->id_lang) as $tax) {
         $taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']);
     }
     $order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (5 steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One page checkout')));
     $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical')));
     $cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None')));
     foreach (CMS::listCms($cookie->id_lang) as $cms_file) {
         $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
     }
     $this->_fieldsGeneral = array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''), 'PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use of CMS page'), 'desc' => $this->l('Choose the Conditions of use of CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'), 'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrap pricing'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'), 'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Maximum attachment size'), 'desc' => $this->l('Set the maximum size of attached files (in Megabytes ).') . ' ' . $this->l('Maximum:') . ' ' . ((int) str_replace('M', '', ini_get('post_max_size')) > (int) str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '2'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CART_FOLLOWING' => array('title' => $this->l('Save cart content and re-display it at login'), 'desc' => $this->l('Recall and display contents of shopping cart following customer login'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_LIMIT_UPLOAD_FILE_VALUE' => array('title' => $this->l('Limit upload file value'), 'desc' => $this->l('Define the limit upload for a downloadable product, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'), 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array('title' => $this->l('Limit upload image value'), 'desc' => $this->l('Define the limit upload for an image, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'));
     if (function_exists('date_default_timezone_set')) {
         $this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name');
     }
     // No HTTPS activation if you haven't already.
     if (!Tools::usingSecureMode() && !_PS_SSL_ENABLED_) {
         $this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled';
         $this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>';
     }
     parent::__construct();
 }
 public function initContent()
 {
     $cart = $this->context->cart;
     $payments = array();
     $payments['message'] = $this->module->l('Заказ в статусе не оплачен! Перейдите в личный кабинет и нажмите перезаказ');
     if ($cart) {
         $total_to_pay = $cart->getOrderTotal(true);
         $rub_currency_id = Currency::getIdByIsoCode('RUB');
         if ($cart->id_currency != $rub_currency_id) {
             $from_currency = new Currency($cart->id_curre1ncy);
             $to_currency = new Currency($rub_currency_id);
             $total_to_pay = Tools::convertPriceFull($total_to_pay, $from_currency, $to_currency);
         }
         $display = '';
         if (Configuration::get('YA_P2P_ACTIVE')) {
             $vars_p2p = Configuration::getMultiple(array('YA_P2P_NUMBER', 'YA_P2P_ACTIVE'));
             $this->context->smarty->assign(array('DATA_P2P' => $vars_p2p, 'price' => number_format($total_to_pay, 2, '.', ''), 'cart' => $this->context->cart));
             $display .= $this->display(__FILE__, 'payment.tpl');
         }
         if (Configuration::get('YA_ORG_ACTIVE')) {
             $vars_org = Configuration::getMultiple(array('YA_ORG_SHOPID', 'YA_ORG_SCID', 'YA_ORG_ACTIVE', 'YA_ORG_TYPE'));
             $this->context->smarty->assign(array('DATA_ORG' => $vars_org, 'id_cart' => $cart->id, 'customer' => new Customer($cart->id_customer), 'address' => new Address($this->context->cart->id_address_delivery), 'total_to_pay' => number_format($total_to_pay, 2, '.', ''), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'shop_name' => Configuration::get('PS_SHOP_NAME')));
             $payments = Configuration::getMultiple(array('YA_ORG_PAYMENT_YANDEX', 'YA_ORG_PAYMENT_CARD', 'YA_ORG_PAYMENT_MOBILE', 'YA_ORG_PAYMENT_WEBMONEY', 'YA_ORG_PAYMENT_TERMINAL', 'YA_ORG_PAYMENT_SBER', 'YA_ORG_PAYMENT_PB', 'YA_ORG_PAYMENT_MA', 'YA_ORG_PAYMENT_ALFA'));
             $payments['pt'] = Tools::getValue('type');
         }
         //$this->module->validateOrder((int)$cart->id, _PS_OS_PREPARATION_, $cart->getOrderTotal(true, Cart::BOTH), $this->module->displayName, NULL, array(), NULL, false, $cart->secure_key);
     }
     $this->context->smarty->assign($payments);
     return $this->setTemplate('redirectk.tpl');
 }
 public function initContent()
 {
     $cart = $this->context->cart;
     $payments = array();
     $payments['message'] = $this->module->l('The order status is not paid! Go to my account and then reorder');
     if ($cart) {
         $total_to_pay = $cart->getOrderTotal(true);
         $rub_currency_id = Currency::getIdByIsoCode('RUB');
         if ($cart->id_currency != $rub_currency_id) {
             $from_currency = new Currency($cart->id_curre1ncy);
             $to_currency = new Currency($rub_currency_id);
             $total_to_pay = Tools::convertPriceFull($total_to_pay, $from_currency, $to_currency);
         }
         $display = '';
         if (Configuration::get('YA_P2P_ACTIVE')) {
             $vars_p2p = Configuration::getMultiple(array('YA_P2P_NUMBER', 'YA_P2P_ACTIVE'));
             $this->context->smarty->assign(array('DATA_P2P' => $vars_p2p, 'price' => number_format($total_to_pay, 2, '.', ''), 'cart' => $this->context->cart));
             $display .= $this->display(__FILE__, 'payment.tpl');
         }
         if (Configuration::get('YA_ORG_ACTIVE')) {
             $vars_org = Configuration::getMultiple(array('YA_ORG_SHOPID', 'YA_ORG_SCID', 'YA_ORG_ACTIVE', 'YA_ORG_TYPE'));
             $this->context->smarty->assign(array('DATA_ORG' => $vars_org, 'id_cart' => $cart->id, 'customer' => new Customer($cart->id_customer), 'address' => new Address($this->context->cart->id_address_delivery), 'total_to_pay' => number_format($total_to_pay, 2, '.', ''), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'shop_name' => Configuration::get('PS_SHOP_NAME')));
             $payments = Configuration::getMultiple(array('YA_ORG_PAYMENT_YANDEX', 'YA_ORG_PAYMENT_CARD', 'YA_ORG_PAYMENT_MOBILE', 'YA_ORG_PAYMENT_WEBMONEY', 'YA_ORG_PAYMENT_TERMINAL', 'YA_ORG_PAYMENT_SBER', 'YA_ORG_PAYMENT_PB', 'YA_ORG_PAYMENT_MA', 'YA_ORG_PAYMENT_ALFA'));
             if (Configuration::get('YA_ORG_INSIDE')) {
                 $payments['pt'] = Tools::getValue('type');
             } else {
                 $payments['pt'] = '';
             }
         }
     }
     $this->context->smarty->assign($payments);
     return $this->setTemplate('redirectk.tpl');
 }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->context = Context::getContext();
     $this->className = 'Configuration';
     $this->table = 'configuration';
     // Prevent classes which extend AdminPreferences to load useless data
     if (get_class($this) == 'AdminPreferencesController') {
         $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical')));
         $activities1 = array(0 => $this->l('-- Please choose your main activity --'), 2 => $this->l('Animals and Pets'), 3 => $this->l('Art and Culture'), 4 => $this->l('Babies'), 5 => $this->l('Beauty and Personal Care'), 6 => $this->l('Cars'), 7 => $this->l('Computer Hardware and Software'), 8 => $this->l('Download'), 9 => $this->l('Fashion and accessories'), 10 => $this->l('Flowers, Gifts and Crafts'), 11 => $this->l('Food and beverage'), 12 => $this->l('HiFi, Photo and Video'), 13 => $this->l('Home and Garden'), 14 => $this->l('Home Appliances'), 15 => $this->l('Jewelry'), 1 => $this->l('Lingerie and Adult'), 16 => $this->l('Mobile and Telecom'), 17 => $this->l('Services'), 18 => $this->l('Shoes and accessories'), 19 => $this->l('Sport and Entertainment'), 20 => $this->l('Travel'));
         $activities2 = array();
         foreach ($activities1 as $value => $name) {
             $activities2[] = array('value' => $value, 'name' => $name);
         }
         $fields = array('PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'));
         if (Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED'))) {
             $fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->l('Force the SSL on all the pages'), 'desc' => $this->l('Force all your store to use SSL.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0');
         }
         $fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token in the Front Office to improve PrestaShop\'s security.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->l('Allow iframes on HTML fields'), 'desc' => $this->l('Allow iframes on text fields like product description. We recommend that you leave this option disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->l('Use HTMLPurifier Library'), 'desc' => $this->l('Clean the HTML content on text fields. We recommend that you leave this option enabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round up, always round down or classic rounding (up if > .5, down if < .5).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Enable suppliers and manufacturers pages on your Front Office even when their respective modules are disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->l('Display best sellers'), 'desc' => $this->l('Enable best sellers page on your Front Office even when it\'s respective module is disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->l('Enable Multistore'), 'desc' => $this->l('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->l('Main Shop Activity'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value')));
         // No HTTPS activation if you haven't already.
         if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) {
             $fields['PS_SSL_ENABLED']['type'] = 'disabled';
             $fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>';
         }
         $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->l('Save'))));
     }
     parent::__construct();
 }
Example #7
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);
     session_start();
     $arreglo_errores = array();
     if (is_array($_SESSION['errores'])) {
         foreach ($_SESSION['errores'] as $key => $value) {
             $arreglo_errores[$key] = $value;
         }
     }
     unset($_SESSION['errores']);
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, "http://api.compropago.com/v1/providers/true");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($ch, CURLOPT_USERPWD, "pk_live_508992456a45414a9");
     curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
     $output = curl_exec($ch);
     curl_close($ch);
     $tmp_store_codes = json_decode($output);
     $store_codes = array();
     foreach ($tmp_store_codes as $store) {
         $store_codes[$store->internal_name] = $store->name;
     }
     $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, 'email' => $client->email, 'errores' => $arreglo_errores, 'store_codes' => $store_codes));
     $this->setTemplate('payment_executions.tpl');
 }
 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');
 }
Example #9
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');
 }
Example #10
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');
 }
Example #11
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');
 }
Example #12
0
 public function initContent()
 {
     if ($id_cart = Tools::getValue('id_cart')) {
         $myCart = new Cart($id_cart);
         if (!Validate::isLoadedObject($myCart)) {
             $myCart = $this->context->cart;
         }
     } else {
         $myCart = $this->context->cart;
     }
     $total_to_pay = $myCart->getOrderTotal(true, Cart::BOTH);
     $currency_rub = new Currency(Currency::getIdByIsoCode('RUB'));
     if ($myCart->id_currency != $currency_rub->id) {
         $currency = new Currency($myCart->id_currency);
         $total_to_pay = $total_to_pay / $currency->conversion_rate * $currency_rub->conversion_rate;
     }
     $total_to_pay = number_format($total_to_pay, 2, '.', '');
     if ($postvalidate = Configuration::get('robokassa_postvalidate')) {
         $order_number = $myCart->id;
     } else {
         if (!($order_number = Order::getOrderByCartId($myCart->id))) {
             $this->module->validateOrder((int) $myCart->id, Configuration::get('PL_OS_WAITPAYMENT'), $myCart->getOrderTotal(true, Cart::BOTH), $this->module->displayName, NULL, array(), NULL, false, $myCart->secure_key);
             $order_number = $this->module->currentOrder;
         }
     }
     $customer = new Customer($myCart->id_customer);
     $signature = md5(Configuration::get('robokassa_login') . ':' . $total_to_pay . ':' . $order_number . ':' . Configuration::get('robokassa_password1'));
     $this->context->smarty->assign(array('robokassa_login' => Configuration::get('robokassa_login'), 'robokassa_demo' => Configuration::get('robokassa_demo'), 'signature' => strtoupper($signature), 'email' => $customer->email, 'postvalidate' => $postvalidate, 'order_number' => $order_number, 'total_to_pay' => $total_to_pay, 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->name . '/'));
     return $this->setTemplate('redirect.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');
 }
Example #14
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;
     }
 }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     parent::__construct();
     // Prevent classes which extend AdminPreferences to load useless data
     if (get_class($this) == 'AdminPreferencesController') {
         $round_mode = array(array('value' => PS_ROUND_HALF_UP, 'name' => $this->trans('Round up away from zero, when it is half way there (recommended)', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_DOWN, 'name' => $this->trans('Round down towards zero, when it is half way there', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_EVEN, 'name' => $this->trans('Round towards the next even value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_ODD, 'name' => $this->trans('Round towards the next odd value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_UP, 'name' => $this->trans('Round up to the nearest value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_DOWN, 'name' => $this->trans('Round down to the nearest value', array(), 'Admin.ShopParameters.Feature')));
         $activities1 = array(0 => $this->trans('-- Please choose your main activity --', array(), 'Install'), 2 => $this->trans('Animals and Pets', array(), 'Install'), 3 => $this->trans('Art and Culture', array(), 'Install'), 4 => $this->trans('Babies', array(), 'Install'), 5 => $this->trans('Beauty and Personal Care', array(), 'Install'), 6 => $this->trans('Cars', array(), 'Install'), 7 => $this->trans('Computer Hardware and Software', array(), 'Install'), 8 => $this->trans('Download', array(), 'Install'), 9 => $this->trans('Fashion and accessories', array(), 'Install'), 10 => $this->trans('Flowers, Gifts and Crafts', array(), 'Install'), 11 => $this->trans('Food and beverage', array(), 'Install'), 12 => $this->trans('HiFi, Photo and Video', array(), 'Install'), 13 => $this->trans('Home and Garden', array(), 'Install'), 14 => $this->trans('Home Appliances', array(), 'Install'), 15 => $this->trans('Jewelry', array(), 'Install'), 1 => $this->trans('Lingerie and Adult', array(), 'Install'), 16 => $this->trans('Mobile and Telecom', array(), 'Install'), 17 => $this->trans('Services', array(), 'Install'), 18 => $this->trans('Shoes and accessories', array(), 'Install'), 19 => $this->trans('Sport and Entertainment', array(), 'Install'), 20 => $this->trans('Travel', array(), 'Install'));
         $activities2 = array();
         foreach ($activities1 as $value => $name) {
             $activities2[] = array('value' => $value, 'name' => $name);
         }
         $fields = array('PS_SSL_ENABLED' => array('title' => $this->trans('Enable SSL', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('If you own an SSL certificate for your shop\'s domain name, you can activate SSL encryption (https://) for customer account identification and order processing.', array(), 'Admin.ShopParameters.Help'), 'hint' => $this->trans('If you want to enable SSL on all the pages of your shop, activate the "Enable on all the pages" option below.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'));
         $fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->trans('Enable SSL on all pages', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('When enabled, all the pages of your shop will be SSL-secured.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'disabled' => Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED')) ? false : true);
         $fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->trans('Increase front office security', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable or disable token in the Front Office to improve PrestaShop\'s security.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->trans('Allow iframes on HTML fields', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Allow iframes on text fields like product description. We recommend that you leave this option disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->trans('Use HTMLPurifier Library', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Clean the HTML content on text fields. We recommend that you leave this option enabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->trans('Round mode', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose among 6 different ways of rounding prices. "Round up away from zero ..." is the recommended behavior.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_ROUND_TYPE' => array('title' => $this->trans('Round type', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose when to round prices: either on each item, each line or the total (of an invoice, for example).', array(), 'Admin.ShopParameters.Help'), 'cast' => 'intval', 'type' => 'select', 'list' => array(array('name' => $this->trans('Round on each item', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_ITEM), array('name' => $this->trans('Round on each line', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_LINE), array('name' => $this->trans('Round on the total', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_TOTAL)), 'identifier' => 'id'), 'PS_PRICE_DISPLAY_PRECISION' => array('title' => $this->trans('Number of decimals', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Choose how many decimals you want to display', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text', 'class' => 'fixed-width-xxl'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->trans('Display brands and suppliers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable brands and suppliers pages on your front office even when their respective modules are disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->trans('Display best sellers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable best sellers page on your front office even when its respective module is disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->trans('Enable Multistore', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->trans('Main Shop Activity', array(), 'Admin.ShopParameters.Feature'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value')));
         // No HTTPS activation if you haven't already.
         if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) {
             $fields['PS_SSL_ENABLED']['type'] = 'disabled';
             $fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->trans('Please click here to check if your shop supports HTTPS.', array(), 'Admin.ShopParameters.Feature') . '</a>';
         }
         $this->fields_options = array('general' => array('title' => $this->trans('General', array(), 'Admin.Global'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))));
     }
 }
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cost = $this->module->getPrice($this->context->cart);
     $total = $this->context->cart->getOrderTotal(true, Cart::BOTH);
     $this->context->smarty->assign(array('cost' => $cost, 'total' => $total + $cost, 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'title' => $this->module->getValue('title'), 'custom_text' => $this->module->getvalue('custom_text')));
     $this->setTemplate('validation.tpl');
 }
Example #17
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $total = $this->context->cart->getOrderTotal(true, Cart::BOTH);
     $total = $total <= Configuration::get('COD_MINIMUM_AMOUNT') ? $total + (double) Configuration::get('COD_FEE') : $total;
     $this->context->smarty->assign(array('total' => $total, 'this_path' => $this->module->getPathUri(), 'this_path_cod' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('validation.tpl');
 }
Example #18
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $total = $this->context->cart->getOrderTotal(true, Cart::BOTH);
     $extrafee = $this->module->getExtraFee($this->context->cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING));
     $this->context->smarty->assign(array('total' => $total + $extrafee, 'total_without_cod' => $total, 'extrafee' => $extrafee, 'this_path' => $this->module->getPathUri(), 'this_path_cod' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('validation.tpl');
 }
 public function hookPayment($params)
 {
     if (!$this->active) {
         return;
     }
     $this->smarty->assign(array('this_path' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->name . '/'));
     return $this->display(__FILE__, 'payment.tpl');
 }
Example #20
0
 private function _getShopURL()
 {
     $host = ((Configuration::get('PS_SSL_ENABLED') or !empty($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) != 'off') ? Tools::getShopDomainSsl() : Tools::getShopDomain()) . __PS_BASE_URI__;
     if (substr($host, 0, 4) != 'http') {
         $host = (Configuration::get('PS_SSL_ENABLED') or !empty($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) != 'off') ? 'https://' . $host : 'http://' . $host;
     }
     return $host;
 }
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     $obj = new Paytm();
     $obj->execPayment($cart);
     $this->context->smarty->assign(array('nbProducts' => $cart->nbProducts(), 'cust_currency' => $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 . '/'));
     $this->setTemplate('payment_execution.tpl');
 }
Example #22
0
 /**
  * Initialize the page
  */
 public function init()
 {
     if (!defined('_PS_BASE_URL_')) {
         define('_PS_BASE_URL_', Tools::getShopDomain(true));
     }
     if (!defined('_PS_BASE_URL_SSL_')) {
         define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true));
     }
 }
 public function getAuthorisation()
 {
     global $cookie;
     // Getting cart informations
     $cart = new Cart((int) $cookie->id_cart);
     if (!Validate::isLoadedObject($cart)) {
         $this->_logs[] = $this->l('Not a valid cart');
     }
     $currency = new Currency((int) $cart->id_currency);
     if (!Validate::isLoadedObject($currency)) {
         $this->_logs[] = $this->l('Not a valid currency');
     }
     if (sizeof($this->_logs)) {
         return false;
     }
     // Making request
     $returnURL = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/paypal/express/submit.php';
     $cancelURL = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'order.php';
     $paymentAmount = (double) $cart->getOrderTotal();
     $currencyCodeType = strval($currency->iso_code);
     $paymentType = Configuration::get('PAYPAL_CAPTURE') == 1 ? 'Authorization' : 'Sale';
     $request = '&Amt=' . urlencode($paymentAmount) . '&PAYMENTACTION=' . urlencode($paymentType) . '&ReturnUrl=' . urlencode($returnURL) . '&CANCELURL=' . urlencode($cancelURL) . '&CURRENCYCODE=' . urlencode($currencyCodeType);
     if ($this->_pp_integral) {
         $request .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing';
     } else {
         $request .= '&SOLUTIONTYPE=Mark&LANDINGPAGE=Login';
     }
     $request .= '&LOCALECODE=' . strtoupper($this->getCountryCode());
     if ($this->_header) {
         $request .= '&HDRIMG=' . urlencode($this->_header);
     }
     // Customer informations
     $customer = new Customer((int) $cart->id_customer);
     $request .= '&EMAIL=' . urlencode($customer->email);
     //customer
     // address of delivery
     $address = new Address((int) $cart->id_address_delivery);
     $country = new Country((int) $address->id_country);
     if ($address->id_state) {
         $state = new State((int) $address->id_state);
     }
     $request .= '&SHIPTONAME=' . urlencode($address->firstname . ' ' . $address->lastname);
     $request .= '&SHIPTOSTREET=' . urlencode($address->address1);
     $request .= '&SHIPTOSTREET2=' . urlencode($address->address2);
     $request .= '&SHIPTOCITY=' . urlencode($address->city);
     $request .= '&SHIPTOSTATE=' . ($address->id_state ? $state->iso_code : $country->iso_code);
     $request .= '&SHIPTOZIP=' . urlencode($address->postcode);
     $request .= '&SHIPTOCOUNTRY=' . urlencode($country->iso_code);
     $request .= '&SHIPTOPHONENUM=' . urlencode($address->phone);
     // Calling PayPal API
     include _PS_MODULE_DIR_ . 'paypal/api/paypallib.php';
     $ppAPI = new PaypalLib();
     $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request);
     $this->_logs = array_merge($this->_logs, $ppAPI->getLogs());
     return $result;
 }
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     if (!$this->module->checkCurrency($cart)) {
         Tools::redirect('index.php?controller=order');
     }
     $this->context->smarty->assign(array('this_path' => $this->module->getPathUri(), 'this_path_bw' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/', 'post' => defined('_PS_MODE_DEV_') && _PS_MODE_DEV_ ? $_POST : array()));
     $this->setTemplate('payment_fail.tpl');
 }
Example #25
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     if (!$this->module->checkCurrency($cart)) {
         Tools::redirect('index.php?controller=order');
     }
     $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), 'this_path' => $this->module->getPathUri(), 'this_path_bw' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('payment_execution.tpl');
 }
Example #26
0
 public function initContent()
 {
     $this->display_column_left = false;
     parent::initContent();
     if (!$this->module->checkCurrency($this->context->cart)) {
         Tools::redirect('index.php?controller=order');
     }
     $this->context->smarty->assign(array('image' => $this->module->getPathUri() . 'assets/images/logops_86x49.png', 'nbProducts' => $this->context->cart->nbProducts(), 'cust_currency' => $this->context->cart->id_currency, 'currencies' => $this->module->getCurrency((int) $this->context->cart->id_currency), 'total' => $this->context->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 . '/'));
     $this->setTemplate('payment_execution.tpl');
 }
Example #27
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     if (!$this->module->checkCurrency($cart)) {
         Tools::redirect('index.php?controller=order');
     }
     $dkkC = new Currency(Currency::getIdByIsoCode('DKK'));
     $this->context->smarty->assign(array('nbProducts' => $cart->nbProducts(), 'cust_currency' => $cart->id_currency, 'name_currency' => $dkkC->name, 'id_currency_accepted' => $dkkC->id, 'id_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'total' => $this->module->__getPriceDkk($cart), 'this_path' => $this->module->getPathUri(), 'this_path_bw' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('payment_execution.tpl');
 }
Example #28
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart = $this->context->cart;
     if (!$this->module->checkCurrency($cart)) {
         Tools::redirect('index.php?controller=order');
     }
     $total = sprintf($this->getTranslator()->trans('%1$s (tax incl.)', array(), 'Modules.BankBCA.Shop'), Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH)));
     $this->context->smarty->assign(array('back_url' => $this->context->link->getPageLink('order', true, NULL, "step=3"), 'confirm_url' => $this->context->link->getModuleLink('bankbca', 'validation', [], true), 'image_url' => $this->module->getPathUri() . 'bankwire.jpg', 'cust_currency' => $cart->id_currency, 'currencies' => $this->module->getCurrency((int) $cart->id_currency), 'total' => $total, 'this_path' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/'));
     $this->setTemplate('payment_execution.tpl');
 }
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $this->display_column_left = false;
     $link = new Link();
     parent::initContent();
     $cart = $this->context->cart;
     if (!$this->module->checkCurrency($cart)) {
         Tools::redirect('index.php?controller=order');
     }
     $this->context->smarty->assign(array('payment_type' => Configuration::get('VT_PAYMENT_TYPE'), 'api_version' => Configuration::get('VT_API_VERSION'), 'error_message' => '', '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('payment_execution.tpl');
 }
Example #30
0
 /**
  * Initialize the page
  */
 public function init()
 {
     if (_PS_MODE_DEV_ && $this->controller_type == 'admin') {
         set_error_handler(array(__CLASS__, 'myErrorHandler'));
     }
     if (!defined('_PS_BASE_URL_')) {
         define('_PS_BASE_URL_', Tools::getShopDomain(true));
     }
     if (!defined('_PS_BASE_URL_SSL_')) {
         define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true));
     }
 }