public function registerDiscount($id_customer, $register = false, $id_currency = 0)
 {
     $configurations = Configuration::getMultiple(array('REFERRAL_DISCOUNT_TYPE', 'REFERRAL_PERCENTAGE', 'REFERRAL_DISCOUNT_VALUE_' . (int) $id_currency));
     $cartRule = new CartRule();
     if ($configurations['REFERRAL_DISCOUNT_TYPE'] == Discount::PERCENT) {
         $cartRule->reduction_percent = (double) $configurations['REFERRAL_PERCENTAGE'];
     } elseif ($configurations['REFERRAL_DISCOUNT_TYPE'] == Discount::AMOUNT and isset($configurations['REFERRAL_DISCOUNT_VALUE_' . (int) $id_currency])) {
         $cartRule->reduction_amount = (double) $configurations['REFERRAL_DISCOUNT_VALUE_' . (int) $id_currency];
     }
     $cartRule->quantity = 1;
     $cartRule->quantity_per_user = 1;
     $cartRule->date_from = date('Y-m-d H:i:s', time());
     $cartRule->date_to = date('Y-m-d H:i:s', time() + 31536000);
     // + 1 year
     $cartRule->code = $this->getDiscountPrefix() . Tools::passwdGen(6);
     $cartRule->name = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION');
     $cartRule->id_customer = (int) $id_customer;
     $cartRule->id_currency = (int) $id_currency;
     if ($cartRule->add()) {
         if ($register != false) {
             if ($register == 'sponsor') {
                 $this->id_cart_rule_sponsor = (int) $cartRule->id;
             } elseif ($register == 'sponsored') {
                 $this->id_cart_rule = (int) $cartRule->id;
             }
             return $this->save();
         }
         return true;
     }
     return false;
 }
Example #2
0
 /**
  * Costructor
  *
  * @return Liqpay
  */
 public function __construct()
 {
     $this->name = 'liqpay';
     $this->tab = 'payments_gateways';
     $this->version = '0.1';
     $this->author = 'Liqpay';
     $this->need_instance = 0;
     $params = array('LIQPAY_PUBLIC_KEY', 'LIQPAY_PRIVATE_KEY');
     $config = Configuration::getMultiple($params);
     if (isset($config['LIQPAY_PUBLIC_KEY']) && $config['LIQPAY_PUBLIC_KEY']) {
         $this->liqpay_public_key = $config['LIQPAY_PUBLIC_KEY'];
     }
     if (isset($config['LIQPAY_PRIVATE_KEY']) && $config['LIQPAY_PRIVATE_KEY']) {
         $this->liqpay_private_key = $config['LIQPAY_PRIVATE_KEY'];
     }
     parent::__construct();
     $this->page = basename(__FILE__, '.php');
     $this->displayName = 'Liqpay';
     $this->description = $this->l('Accept payments with Liqpay');
     $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
     $correctly = !isset($this->liqpay_public_key) or !isset($this->liqpay_private_key);
     if ($correctly) {
         $this->warning = $this->l('Your Liqpay account must be set correctly');
     }
 }
    function getContent()
    {
        $configKeys = array('EBAY_SECURITY_TOKEN', 'PS_LANG_DEFAULT');
        // Load prestashop ebay's configuration
        $configs = Configuration::getMultiple($configKeys);
        $profile_configs = $this->ebay_profile->getMultiple(array('EBAY_DELIVERY_TIME', 'EBAY_ZONE_NATIONAL', 'EBAY_ZONE_INTERNATIONAL'));
        // Check if the module is configured
        if (!$this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL')) {
            $template_vars = array('error_form_shipping' => 'true');
            return $this->display('error_paypal_email.tpl', $template_vars);
        }
        $nb_shipping_zones_excluded = DB::getInstance()->getValue('SELECT COUNT(*) 
			FROM ' . _DB_PREFIX_ . 'ebay_shipping_zone_excluded
			WHERE `id_ebay_profile` = ' . (int) $this->ebay_profile->id);
        if (!$nb_shipping_zones_excluded) {
            EbayShippingZoneExcluded::loadEbayExcludedLocations($this->ebay_profile->id);
        }
        $module_filters = version_compare(_PS_VERSION_, '1.4.5', '>=') ? Carrier::CARRIERS_MODULE : 2;
        //INITIALIZE CACHE
        $psCarrierModule = $this->ebay_profile->getCarriers($configs['PS_LANG_DEFAULT'], false, false, false, null, $module_filters);
        $url_vars = array('id_tab' => '3', 'section' => 'shipping');
        if (version_compare(_PS_VERSION_, '1.5', '>')) {
            $url_vars['controller'] = Tools::getValue('controller');
        } else {
            $url_vars['tab'] = Tools::getValue('tab');
        }
        $zones = Zone::getZones(true);
        foreach ($zones as &$zone) {
            $zone['carriers'] = Carrier::getCarriers($this->context->language->id, false, false, $zone['id_zone']);
        }
        $template_vars = array('eBayCarrier' => EbayShippingService::getCarriers($this->ebay_profile->ebay_site_id), 'psCarrier' => $this->ebay_profile->getCarriers($configs['PS_LANG_DEFAULT']), 'psCarrierModule' => $psCarrierModule, 'existingNationalCarrier' => EbayShipping::getNationalShippings($this->ebay_profile->id), 'existingInternationalCarrier' => EbayShippingInternationalZone::getExistingInternationalCarrier($this->ebay_profile->id), 'deliveryTime' => $profile_configs['EBAY_DELIVERY_TIME'], 'prestashopZone' => Zone::getZones(), 'excludeShippingLocation' => EbayShippingZoneExcluded::cacheEbayExcludedLocation($this->ebay_profile->id), 'internationalShippingLocations' => EbayShippingLocation::getInternationalShippingLocations(), 'deliveryTimeOptions' => EbayDeliveryTimeOptions::getDeliveryTimeOptions(), 'formUrl' => $this->_getUrl($url_vars), 'ebayZoneNational' => isset($profile_configs['EBAY_ZONE_NATIONAL']) ? $profile_configs['EBAY_ZONE_NATIONAL'] : false, 'ebayZoneInternational' => isset($profile_configs['EBAY_ZONE_INTERNATIONAL']) ? $profile_configs['EBAY_ZONE_INTERNATIONAL'] : false, 'ebay_token' => $configs['EBAY_SECURITY_TOKEN'], 'id_ebay_profile' => $this->ebay_profile->id, 'newPrestashopZone' => $zones);
        return $this->display('shipping.tpl', $template_vars);
    }
 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');
 }
Example #5
0
 protected function _init()
 {
     $config = Configuration::getMultiple(array('PAYPAL_HEADER', 'PAYPAL_SANDBOX', 'PAYPAL_API_USER', 'PAYPAL_API_PASSWORD', 'PAYPAL_API_SIGNATURE', 'PAYPAL_EXPRESS_CHECKOUT', 'PAYPAL_INTEGRAL', 'PAYPAL_OPTION_PLUS'));
     if (isset($config['PAYPAL_HEADER'])) {
         $this->_header = $config['PAYPAL_HEADER'];
     }
     if (isset($config['PAYPAL_SANDBOX'])) {
         $this->_sandbox = $config['PAYPAL_SANDBOX'];
     }
     if (isset($config['PAYPAL_API_USER'])) {
         $this->_apiUser = $config['PAYPAL_API_USER'];
     }
     if (isset($config['PAYPAL_API_PASSWORD'])) {
         $this->_apiPassword = $config['PAYPAL_API_PASSWORD'];
     }
     if (isset($config['PAYPAL_API_SIGNATURE'])) {
         $this->_apiSignature = $config['PAYPAL_API_SIGNATURE'];
     }
     if (isset($config['PAYPAL_EXPRESS_CHECKOUT'])) {
         $this->_expressCheckout = $config['PAYPAL_EXPRESS_CHECKOUT'];
     }
     if (isset($config['PAYPAL_INTEGRAL'])) {
         $this->_pp_integral = $config['PAYPAL_INTEGRAL'];
     }
 }
Example #6
0
 public function __construct()
 {
     $this->name = 'eko_ctt';
     $this->tab = 'shipping_logistics';
     $this->version = '0.2.0';
     $this->author = 'ekosshop';
     $this->ctt_URL = "http://www.ctt.pt/feapl_2/app/open/objectSearch/objectSearch.jspx";
     $config = Configuration::getMultiple(array('EKO_CTT_CRON', 'EKO_CTT_CHANGE_STATS', 'EKO_CTT_OS_0', 'EKO_CTT_OS_1', 'EKO_CTT_TR_0', 'EKO_CTT_TR_1'));
     if (isset($config['EKO_CTT_CRON'])) {
         $this->ctt_cron = $config['EKO_CTT_CRON'];
     }
     if (isset($config['EKO_CTT_CHANGE_STATS'])) {
         $this->ctt_change = $config['EKO_CTT_CHANGE_STATS'];
     }
     if (isset($config['EKO_CTT_OS_0'])) {
         $this->ctt_os_0 = $config['EKO_CTT_OS_0'];
     }
     if (isset($config['EKO_CTT_OS_1'])) {
         $this->ctt_os_1 = $config['EKO_CTT_OS_1'];
     }
     if (isset($config['EKO_CTT_TR_0'])) {
         $this->ctt_tr_0 = $config['EKO_CTT_TR_0'];
     }
     if (isset($config['EKO_CTT_TR_1'])) {
         $this->ctt_tr_1 = $config['EKO_CTT_TR_1'];
     }
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->l('CTT Tracking');
     $this->description = $this->l('Tracking CTT Shipment');
     $this->confirmUninstall = $this->l('Are you sure about removing this module?');
     $this->ctt_Status = array(0 => array('id' => 999001, 'name' => $this->l('Delivered')), 1 => array('id' => 999002, 'name' => $this->l('Available for Pickup')), 2 => array('id' => 999003, 'name' => $this->l('Shipment address incomplete')), 3 => array('id' => 999004, 'name' => $this->l('Not Delivered')), 4 => array('id' => 999005, 'name' => $this->l('In Transit')), 5 => array('id' => 999006, 'name' => $this->l('Shipment')), 6 => array('id' => 999007, 'name' => $this->l('Pickup')), 7 => array('id' => 999008, 'name' => $this->l('Create New Label')), 8 => array('id' => 999009, 'name' => $this->l('International delivery')), 9 => array('id' => 999010, 'name' => $this->l('International Shipment')), 10 => array('id' => 999011, 'name' => $this->l('Waiting for legal procedure.')), 11 => array('id' => 999012, 'name' => $this->l('Release through customs')), 12 => array('id' => 999013, 'name' => $this->l('For customs presentation')), 13 => array('id' => 999014, 'name' => $this->l('Object unclaimed, returned')));
 }
Example #7
0
 public function __construct()
 {
     $this->name = 'bankwire';
     $this->tab = 'payments_gateways';
     $this->version = '1.0.8';
     $this->author = 'PrestaShop';
     $this->controllers = array('payment', 'validation');
     $this->is_eu_compatible = 1;
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS'));
     if (!empty($config['BANK_WIRE_OWNER'])) {
         $this->owner = $config['BANK_WIRE_OWNER'];
     }
     if (!empty($config['BANK_WIRE_DETAILS'])) {
         $this->details = $config['BANK_WIRE_DETAILS'];
     }
     if (!empty($config['BANK_WIRE_ADDRESS'])) {
         $this->address = $config['BANK_WIRE_ADDRESS'];
     }
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->l('Bank wire');
     $this->description = $this->l('Accept payments for your products via bank wire transfer.');
     $this->confirmUninstall = $this->l('Are you sure about removing these details?');
     if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) {
         $this->warning = $this->l('Account owner and account details must be configured before using this module.');
     }
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     $this->extra_mail_vars = array('{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')));
 }
 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');
 }
Example #9
0
 public static function disableUsesAddress($order)
 {
     if (Validate::isLoadedObject($order)) {
         $address = new Address((int) $order->id_address_delivery);
         if (Validate::isLoadedObject($address)) {
             $default_address = Configuration::getMultiple(array('SHIPTOMYID_DEFAULT_ADDR_ADDRESS', 'SHIPTOMYID_DEFAULT_ADDR_ADDRESS2', 'SHIPTOMYID_DEFAULT_ADDR_CITY', 'SHIPTOMYID_DEFAULT_ADDR_POSTCODE', 'SHIPTOMYID_DEFAULT_ADDR_COUNTRY', 'SHIPTOMYID_DEFAULT_ADDR_STATE', 'SHIPTOMYID_DEFAULT_ADDR_PHONE', 'SHIPTOMYID_DEFAULT_ADDR_ALIAS'));
             if (Validate::isAddress($default_address['SHIPTOMYID_DEFAULT_ADDR_ADDRESS'])) {
                 $address->address1 = Tools::substr($default_address['SHIPTOMYID_DEFAULT_ADDR_ADDRESS'], 0, 128);
             }
             if (Validate::isAddress($default_address['SHIPTOMYID_DEFAULT_ADDR_ADDRESS2'])) {
                 $address->address2 = Tools::substr($default_address['SHIPTOMYID_DEFAULT_ADDR_ADDRESS2'], 0, 128);
             }
             if (Validate::isCityName($default_address['SHIPTOMYID_DEFAULT_ADDR_CITY'])) {
                 $address->city = Tools::substr($default_address['SHIPTOMYID_DEFAULT_ADDR_CITY'], 0, 64);
             }
             if (Validate::isPostCode($default_address['SHIPTOMYID_DEFAULT_ADDR_POSTCODE'])) {
                 $address->postcode = Tools::substr($default_address['SHIPTOMYID_DEFAULT_ADDR_POSTCODE'], 0, 12);
             }
             if (Validate::isPhoneNumber($default_address['SHIPTOMYID_DEFAULT_ADDR_PHONE'])) {
                 $address->phone = Tools::substr($default_address['SHIPTOMYID_DEFAULT_ADDR_PHONE'], 0, 32);
             }
             $address->id_country = (int) $default_address['SHIPTOMYID_DEFAULT_ADDR_COUNTRY'];
             $address->id_state = (int) $default_address['SHIPTOMYID_DEFAULT_ADDR_STATE'];
             $address->update();
         }
     }
     Db::getInstance()->Execute('UPDATE ' . _DB_PREFIX_ . 'address SET deleted = 1 WHERE id_address = ' . (int) $order->id_address_delivery);
 }
 public function registerDiscount($id_customer, $register = false)
 {
     $configurations = Configuration::getMultiple(array('REFERRAL_DISCOUNT_TYPE', 'REFERRAL_DISCOUNT_VALUE'));
     $discount = new Discount();
     $discount->id_discount_type = intval($configurations['REFERRAL_DISCOUNT_TYPE']);
     $discount->value = floatval($configurations['REFERRAL_DISCOUNT_VALUE']);
     $discount->quantity = 1;
     $discount->quantity_per_user = 1;
     $discount->date_from = date('Y-m-d H:i:s', time());
     $discount->date_to = date('Y-m-d H:i:s', time() + 31536000);
     // + 1 year
     $discount->name = $this->getDiscountPrefix() . Tools::passwdGen(6);
     $discount->description = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION');
     $discount->id_customer = intval($id_customer);
     if ($discount->add()) {
         if ($register != false) {
             if ($register == 'sponsor') {
                 $this->id_discount_sponsor = $discount->id;
             } elseif ($register == 'sponsored') {
                 $this->id_discount = $discount->id;
             }
             return $this->save();
         }
         return true;
     }
     return false;
 }
Example #11
0
 public function __construct()
 {
     $this->name = 'cheque';
     $this->tab = 'payments_gateways';
     $this->version = '2.3';
     $this->author = 'PrestaShop';
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
     if (isset($config['CHEQUE_NAME'])) {
         $this->chequeName = $config['CHEQUE_NAME'];
     }
     if (isset($config['CHEQUE_ADDRESS'])) {
         $this->address = $config['CHEQUE_ADDRESS'];
     }
     parent::__construct();
     $this->displayName = $this->l('Check');
     $this->description = $this->l('Module for accepting payments by check.');
     $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
     if ($this->active && (!isset($this->chequeName) || !isset($this->address) || empty($this->chequeName) || empty($this->address))) {
         $this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly.');
     }
     if ($this->active && !count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency set for this module');
     }
     $this->extra_mail_vars = array('{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
 }
 public function __construct()
 {
     $this->name = 'sign2pay';
     $this->tab = 'payments_gateways';
     $this->version = '0.1.0';
     $this->author = 'Berkan Düzgün';
     $this->controllers = array('payment', 'validation');
     $this->availableCurrencies = array('EUR');
     $config = Configuration::getMultiple(array('SIGN2PAY_APPLICATION_TOKEN', 'SIGN2PAY_MERCHANT_ID', 'SIGN2PAY_API_TOKEN'));
     if (!empty($config['SIGN2PAY_MERCHANT_ID'])) {
         $this->merchandId = $config['SIGN2PAY_MERCHANT_ID'];
     }
     if (!empty($config['SIGN2PAY_APPLICATION_TOKEN'])) {
         $this->applicationToken = $config['SIGN2PAY_APPLICATION_TOKEN'];
     }
     if (!empty($config['SIGN2PAY_API_TOKEN'])) {
         $this->apiToken = $config['SIGN2PAY_API_TOKEN'];
     }
     parent::__construct();
     $this->displayName = $this->l('Sign2Pay');
     $this->description = $this->l('Sign2Pay payment method.');
     $this->confirmUninstall = $this->l('Are you sure about removing these details?');
     if (!isset($this->merchandId) || !isset($this->applicationToken) || !isset($this->apiToken)) {
         $this->warning = $this->l('API credentials must be configured before using this module.');
     }
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     $this->extra_mail_vars = array('{sign2pay_merchant_id}' => Configuration::get('SIGN2PAY_MERCHANT_ID'), '{sign2pay_application_token}' => nl2br(Configuration::get('SIGN2PAY_APPLICATION_TOKEN')), '{sign2pay_api_token}' => nl2br(Configuration::get('SIGN2PAY_API_TOKEN')));
 }
 public function init()
 {
     ${"GLOBALS"}["pcwndnxzm"] = "isoTinyMCE";
     parent::init();
     ${"GLOBALS"}["akprgggjmj"] = "languages";
     ${"GLOBALS"}["tbvspw"] = "deflang";
     ${"GLOBALS"}["vhicmlpg"] = "custom_labels";
     ${${"GLOBALS"}["tbvspw"]} = new Language(self::$cookie->id_lang);
     $tmulinwrlntj = "str_custom_multi_lang_fields";
     ${"GLOBALS"}["ktemnns"] = "custom_multi_lang_fields";
     ${${"GLOBALS"}["gdwbgebyw"]} = file_exists(_PS_ROOT_DIR_ . "/js/tiny_mce/langs/" . $deflang->iso_code . ".js") ? $deflang->iso_code : "en";
     ${${"GLOBALS"}["iffkuw"]} = str_replace("\\", "\\\\", dirname($_SERVER["PHP_SELF"]));
     ${${"GLOBALS"}["akprgggjmj"]} = Language::getLanguages(false);
     ${"GLOBALS"}["aecuqgnp"] = "custom_multi_lang_fields";
     ${${"GLOBALS"}["ijwyqrvm"]} = new AgileMultipleSeller();
     ${${"GLOBALS"}["iqpxuil"]} = Configuration::getMultiple($sellermodule->getCustomFields());
     ${${"GLOBALS"}["vhicmlpg"]} = $sellermodule->getCustomLabels(":");
     ${"GLOBALS"}["ppyvhso"] = "custom_labels";
     ${${"GLOBALS"}["aecuqgnp"]} = SellerInfo::getCustomMultiLanguageFields();
     ${$tmulinwrlntj} = "";
     ${"GLOBALS"}["wsahmoa"] = "isoTinyMCE";
     foreach (${${"GLOBALS"}["ktemnns"]} as ${${"GLOBALS"}["jbuucd"]}) {
         ${"GLOBALS"}["krcvdjennfj"] = "custom_multi_lang_field";
         ${${"GLOBALS"}["lkuqcxcngl"]} .= "&curren;" . ${${"GLOBALS"}["krcvdjennfj"]};
     }
     self::$smarty->assign(array("seller_tab_id" => 2, "ad" => ${${"GLOBALS"}["iffkuw"]}, "isoTinyMCE" => ${${"GLOBALS"}["pcwndnxzm"]}, "theme_css_dir" => _THEME_CSS_DIR_, "languages" => ${${"GLOBALS"}["tgpizrhrpccv"]}, "current_id_lang" => self::$cookie->id_lang, "conf" => ${${"GLOBALS"}["iqpxuil"]}, "custom_labels" => ${${"GLOBALS"}["ppyvhso"]}, "str_custom_multi_lang_fields" => ${${"GLOBALS"}["lkuqcxcngl"]}, "shop_url_mode" => (int) Configuration::get("ASP_SHOP_URL_MODE"), "iso_code" => ${${"GLOBALS"}["wsahmoa"]}));
 }
 public function __construct()
 {
     $this->name = 'cashondelivery';
     $this->tab = 'payments_gateways';
     $this->version = '0.7.5';
     $this->author = 'PrestaShop';
     $this->need_instance = 1;
     $this->controllers = array('validation');
     $this->is_eu_compatible = 1;
     $this->currencies = false;
     $config = Configuration::getMultiple(array('COD_CARRIERS', 'COD_FEE', 'COD_FEEFREE', 'COD_FEEMIN', 'COD_FEEMAX'));
     $this->fee = floatval($config['COD_FEE']);
     $this->feefree = floatval($config['COD_FEEFREE']);
     $this->feemin = floatval($config['COD_FEEMIN']);
     $this->feemax = floatval($config['COD_FEEMAX']);
     if (!empty($config['COD_CARRIERS'])) {
         $this->allowed_carriers = unserialize($config['COD_CARRIERS']);
     }
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->l('Cash on delivery (COD)');
     $this->description = $this->l('Accept cash on delivery payments');
     /* For 1.4.3 and less compatibility */
     $updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT');
     if (!Configuration::get('PS_OS_PAYMENT')) {
         foreach ($updateConfig as $u) {
             if (!Configuration::get($u) && defined('_' . $u . '_')) {
                 Configuration::updateValue($u, constant('_' . $u . '_'));
             }
         }
     }
 }
Example #15
0
 function getContent()
 {
     $is_one_dot_five = version_compare(_PS_VERSION_, '1.5', '>');
     // Load prestashop ebay's configuration
     $configs = Configuration::getMultiple(array('EBAY_CATEGORY_LOADED_' . $this->ebay_profile->ebay_site_id, 'EBAY_SECURITY_TOKEN'));
     // Check if the module is configured
     if (!$this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL')) {
         return $this->display('error_paypal_email.tpl', array('error_form_category', 'true'));
     }
     // Load categories only if necessary
     if (EbayCategoryConfiguration::getTotalCategoryConfigurations($this->ebay_profile->id) && Tools::getValue('section') != 'category') {
         $template_vars = array('isOneDotFive' => $is_one_dot_five, 'controller' => Tools::getValue('controller'), 'tab' => Tools::getValue('tab'), 'configure' => Tools::getValue('configure'), 'token' => Tools::getValue('token'), 'tab_module' => Tools::getValue('tab_module'), 'module_name' => Tools::getValue('module_name'), 'form_categories' => EbaySynchronizer::getNbSynchronizableEbayCategorie($this->ebay_profile->id));
         return $this->display('pre_form_categories.tpl', $template_vars);
     }
     // Display eBay Categories
     $ebay_site_id = $this->ebay_profile->ebay_site_id;
     if (!isset($configs['EBAY_CATEGORY_LOADED_' . $ebay_site_id]) || !$configs['EBAY_CATEGORY_LOADED_' . $ebay_site_id] || !EbayCategory::areCategoryLoaded($ebay_site_id)) {
         $ebay_request = new EbayRequest();
         EbayCategory::insertCategories($ebay_site_id, $ebay_request->getCategories(), $ebay_request->getCategoriesSkuCompliancy());
         Configuration::updateValue('EBAY_CATEGORY_LOADED_' . $ebay_site_id, 1);
     }
     // Smarty
     $template_vars = array('alerts' => $this->_getAlertCategories(), 'tabHelp' => '&id_tab=7', 'id_lang' => $this->context->cookie->id_lang, 'id_ebay_profile' => $this->ebay_profile->id, '_path' => $this->path, 'configs' => $configs, '_module_dir_' => _MODULE_DIR_, 'isOneDotFive' => $is_one_dot_five, 'request_uri' => $_SERVER['REQUEST_URI'], 'controller' => Tools::getValue('controller'), 'tab' => Tools::getValue('tab'), 'configure' => Tools::getValue('configure'), 'token' => Tools::getValue('token'), 'tab_module' => Tools::getValue('tab_module'), 'module_name' => Tools::getValue('module_name'), 'date' => pSQL(date('Ymdhis')), 'form_categories' => EbaySynchronizer::getNbSynchronizableEbayCategorie($this->ebay_profile->id), 'nb_categorie' => count(Category::getCategories($this->context->cookie->id_lang, true, false)));
     return $this->display('form_categories.tpl', $template_vars);
 }
 public static function getMultiple($keys, $id_lang = null, $id_shop_group = null, $id_shop = null)
 {
     ConfigurationKPI::setKpiDefinition();
     $r = parent::getMultiple($keys, $id_lang, $id_shop_group, $id_shop);
     ConfigurationKPI::unsetKpiDefinition();
     return $r;
 }
Example #17
0
 function __construct()
 {
     $this->name = 'cheque';
     $this->tab = 'Payment';
     $this->version = 2.2;
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
     if (isset($config['CHEQUE_NAME'])) {
         $this->chequeName = $config['CHEQUE_NAME'];
     }
     if (isset($config['CHEQUE_ADDRESS'])) {
         $this->address = $config['CHEQUE_ADDRESS'];
     }
     parent::__construct();
     $this->displayName = $this->l('Cheque');
     $this->description = $this->l('Module for accepting payments by cheque');
     $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
     if (!isset($this->chequeName) or !isset($this->address)) {
         $this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly');
     }
     if (!sizeof(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency set for this module');
     }
 }
 public function registerDiscount($id_customer, $register = false, $id_currency = 0)
 {
     $configurations = Configuration::getMultiple(array('REFERRAL_DISCOUNT_TYPE', 'REFERRAL_PERCENTAGE', 'REFERRAL_DISCOUNT_VALUE_' . (int) $id_currency));
     $discount = new Discount();
     $discount->id_discount_type = (int) $configurations['REFERRAL_DISCOUNT_TYPE'];
     /* % */
     if ($configurations['REFERRAL_DISCOUNT_TYPE'] == 1) {
         $discount->value = (double) $configurations['REFERRAL_PERCENTAGE'];
     } elseif ($configurations['REFERRAL_DISCOUNT_TYPE'] == 2 and isset($configurations['REFERRAL_DISCOUNT_VALUE_' . (int) $id_currency])) {
         $discount->value = (double) $configurations['REFERRAL_DISCOUNT_VALUE_' . (int) $id_currency];
     } else {
         $discount->value = 0;
     }
     $discount->quantity = 1;
     $discount->quantity_per_user = 1;
     $discount->date_from = date('Y-m-d H:i:s', time());
     $discount->date_to = date('Y-m-d H:i:s', time() + 31536000);
     // + 1 year
     $discount->name = $this->getDiscountPrefix() . Tools::passwdGen(6);
     $discount->description = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION');
     $discount->id_customer = (int) $id_customer;
     $discount->id_currency = (int) $id_currency;
     if ($discount->add()) {
         if ($register != false) {
             if ($register == 'sponsor') {
                 $this->id_discount_sponsor = (int) $discount->id;
             } elseif ($register == 'sponsored') {
                 $this->id_discount = (int) $discount->id;
             }
             return $this->save();
         }
         return true;
     }
     return false;
 }
 public function __construct()
 {
     $this->name = 'ps_checkpayment';
     $this->tab = 'payments_gateways';
     $this->version = '1.0.8';
     $this->author = 'PrestaShop';
     $this->controllers = array('payment', 'validation');
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
     if (isset($config['CHEQUE_NAME'])) {
         $this->checkName = $config['CHEQUE_NAME'];
     }
     if (isset($config['CHEQUE_ADDRESS'])) {
         $this->address = $config['CHEQUE_ADDRESS'];
     }
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->trans('Payments by check', array(), 'Modules.CheckPayment.Admin');
     $this->description = $this->trans('This module allows you to accept payments by check.', array(), 'Modules.CheckPayment.Admin');
     $this->confirmUninstall = $this->trans('Are you sure you want to delete these details?', array(), 'Modules.CheckPayment.Admin');
     $this->ps_versions_compliancy = array('min' => '1.7.0.0', 'max' => _PS_VERSION_);
     if (!isset($this->checkName) || !isset($this->address) || empty($this->checkName) || empty($this->address)) {
         $this->warning = $this->trans('The "Payee" and "Address" fields must be configured before using this module.', array(), 'Modules.CheckPayment.Admin');
     }
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->trans('No currency has been set for this module.', array(), 'Modules.CheckPayment.Admin');
     }
     $this->extra_mail_vars = array('{check_name}' => Configuration::get('CHEQUE_NAME'), '{check_address}' => Configuration::get('CHEQUE_ADDRESS'), '{check_address_html}' => Tools::nl2br(Configuration::get('CHEQUE_ADDRESS')));
 }
Example #20
0
 public function __construct()
 {
     $this->name = 'bankwire';
     $this->tab = 'payments_gateways';
     $this->version = '0.5';
     $this->author = 'PrestaShop';
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS'));
     if (isset($config['BANK_WIRE_OWNER'])) {
         $this->owner = $config['BANK_WIRE_OWNER'];
     }
     if (isset($config['BANK_WIRE_DETAILS'])) {
         $this->details = $config['BANK_WIRE_DETAILS'];
     }
     if (isset($config['BANK_WIRE_ADDRESS'])) {
         $this->address = $config['BANK_WIRE_ADDRESS'];
     }
     parent::__construct();
     $this->displayName = $this->l('Bank Wire');
     $this->description = $this->l('Accept payments by bank wire.');
     $this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
     if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) {
         $this->warning = $this->l('Account owner and details must be configured in order to use this module correctly.');
     }
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency set for this module');
     }
     $this->extra_mail_vars = array('{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')));
 }
Example #21
0
 public function __construct()
 {
     $this->name = 'bankwire';
     $this->tab = 'Payment';
     $this->version = '0.5';
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS'));
     if (isset($config['BANK_WIRE_OWNER'])) {
         $this->owner = $config['BANK_WIRE_OWNER'];
     }
     if (isset($config['BANK_WIRE_DETAILS'])) {
         $this->details = $config['BANK_WIRE_DETAILS'];
     }
     if (isset($config['BANK_WIRE_ADDRESS'])) {
         $this->address = $config['BANK_WIRE_ADDRESS'];
     }
     parent::__construct();
     $this->displayName = $this->l('Bank Wire');
     $this->description = $this->l('Accept payments by bank wire');
     $this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
     if (!isset($this->owner) or !isset($this->details) or !isset($this->address)) {
         $this->warning = $this->l('Account owner and details must be configured in order to use this module correctly');
     }
     if (!sizeof(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency set for this module');
     }
 }
 public function __construct()
 {
     $this->name = 'twocheckoutpp';
     $this->displayName = '2Checkout PayPal Direct';
     $this->tab = 'payments_gateways';
     $this->version = 0.1;
     $config = Configuration::getMultiple(array('TWOCHECKOUTPP_SID', 'TWOCHECKOUTPP_SECRET', 'TWOCHECKOUTPP_CURRENCY', 'TWOCHECKOUTPP_CURRENCIES'));
     if (isset($config['TWOCHECKOUTPP_SID'])) {
         $this->SID = $config['TWOCHECKOUTPP_SID'];
     }
     if (isset($config['TWOCHECKOUTPP_SECRET'])) {
         $this->SECRET = $config['TWOCHECKOUTPP_SECRET'];
     }
     if (isset($config['TWOCHECKOUTPP_CURRENCY'])) {
         $this->CURRENCY = $config['TWOCHECKOUTPP_CURRENCY'];
     }
     if (isset($config['TWOCHECKOUTPP_CURRENCIES'])) {
         $this->currencies = $config['TWOCHECKOUTPP_CURRENCIES'];
     }
     parent::__construct();
     /* The parent construct is required for translations */
     $this->page = basename(__FILE__, '.php');
     $this->description = $this->l('Accept payments with 2Checkout');
     if (!isset($this->SID) or !isset($this->currencies)) {
         $this->warning = $this->l('your 2Checkout Seller ID must be configured in order to use this module correctly');
     }
     if (!Configuration::get('TWOCHECKOUTPP_CURRENCIES')) {
         $currencies = Currency::getCurrencies();
         $authorized_currencies = array();
         foreach ($currencies as $currency) {
             $authorized_currencies[] = $currency['id_currency'];
         }
         Configuration::updateValue('TWOCHECKOUTPP_CURRENCIES', implode(',', $authorized_currencies));
     }
 }
Example #23
0
 public function __construct()
 {
     $this->name = 'watermark';
     $this->tab = 'administration';
     $this->version = '0.3';
     $this->author = 'PrestaShop';
     parent::__construct();
     $config = Configuration::getMultiple(array('WATERMARK_TYPES', 'WATERMARK_Y_ALIGN', 'WATERMARK_X_ALIGN', 'WATERMARK_TRANSPARENCY'));
     if (!isset($config['WATERMARK_TYPES'])) {
         $config['WATERMARK_TYPES'] = '';
     }
     $tmp = explode(',', $config['WATERMARK_TYPES']);
     foreach (ImageType::getImagesTypes('products') as $type) {
         if (in_array($type['id_image_type'], $tmp)) {
             $this->imageTypes[] = $type;
         }
     }
     $this->yAlign = isset($config['WATERMARK_Y_ALIGN']) ? $config['WATERMARK_Y_ALIGN'] : '';
     $this->xAlign = isset($config['WATERMARK_X_ALIGN']) ? $config['WATERMARK_X_ALIGN'] : '';
     $this->transparency = isset($config['WATERMARK_TRANSPARENCY']) ? $config['WATERMARK_TRANSPARENCY'] : 60;
     $this->displayName = $this->l('Watermark');
     $this->description = $this->l('Protect image by watermark.');
     $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
     if (!isset($this->transparency) || !isset($this->xAlign) || !isset($this->yAlign)) {
         $this->warning = $this->l('Watermark image must be uploaded in order for this module to work correctly.');
     }
 }
Example #24
0
 public function __construct()
 {
     $this->name = 'cheque';
     $this->tab = 'payments_gateways';
     $this->version = '2.3';
     $this->author = 'PrestaShop';
     $this->controllers = array('payment', 'validation');
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
     if (isset($config['CHEQUE_NAME'])) {
         $this->chequeName = $config['CHEQUE_NAME'];
     }
     if (isset($config['CHEQUE_ADDRESS'])) {
         $this->address = $config['CHEQUE_ADDRESS'];
     }
     $this->bootstrap = true;
     parent::__construct();
     $this->displayName = $this->l('Payments by check');
     $this->description = $this->l('This module allows you to accept payments by check.');
     $this->confirmUninstall = $this->l('Are you sure you want to delete these details?');
     if (!isset($this->chequeName) || !isset($this->address) || empty($this->chequeName) || empty($this->address)) {
         $this->warning = $this->l('The "Pay to the order of" and "Address" fields must be configured before using this module.');
     }
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     $this->extra_mail_vars = array('{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
 }
Example #25
0
 private function newMessage($phone, $fname, $lname, $message, $context)
 {
     $host = Tools::getHttpHost();
     // insert to DB
     $query = "insert into " . _DB_PREFIX_ . egcallme::INSTALL_SQL_BD1NAME . " \n        (`id_shop`, `host`, `type`, `phone`, `fname`,`lname`, `message`) \n        values ('" . (int) $context->shop->id . "', '" . $host . "', 'callback', '" . $phone . "',\n            '" . $fname . "','" . $lname . "', '" . $message . "')";
     Db::getInstance()->execute(trim($query));
     // notify by email
     $emails_param = Configuration::get('EGCALLME_EMAIL_NOTIFY');
     if (trim($emails_param) != "") {
         $param = array('{phone}' => $phone, '{message}' => $message, '{fname}' => $fname, '{lname}' => $lname, '{host}' => $host);
         $emails = explode(';', $emails_param);
         $dir = egcallme::getModuleDir() . '/mails/';
         foreach ($emails as $email) {
             $email_theme = "email_notify";
             Mail::Send((int) $context->language->id, $email_theme, Mail::l("NEW Callback " . $phone, $this->context->language->id), $param, trim($email), "", null, null, null, null, $dir, false, (int) $context->shop->id);
         }
         $param['{phone}'] = preg_replace('#\\D+#', '', $param['{phone}']);
         $requests = Configuration::getMultiple(array('EGCALLME_HTTPNOT_1', 'EGCALLME_HTTPNOT_2', 'EGCALLME_HTTPNOT_3'));
         $texts = Configuration::getMultiple(array('EGCALLME_HTTPNOT_1_TXT', 'EGCALLME_HTTPNOT_2_TXT', 'EGCALLME_HTTPNOT_3_TXT'));
         foreach ($requests as $key => $request) {
             $request = $this->replaceKeywords($param, $request, $texts[$key . '_TXT']);
             $result = file_get_contents($request);
         }
     }
 }
Example #26
0
    /**
     * 后台配置模块
     * @return string
     */
    public function getContent()
    {
        if (Tools::isSubmit('Submit_Cardpay_CheckOut')) {
            if (empty($_POST['NEWORDER_MERCHANT_NO'])) {
                $this->_postErrors[] = 'Merchant No is required.';
            }
            if (!isset($_POST['NEWORDER_MERCHANT_KEY'])) {
                $this->_postErrors[] = 'Sign Key is required.';
            }
            if (!sizeof($this->_postErrors)) {
                Configuration::updateValue('NEWORDER_MERCHANT_NO', strval($_POST['NEWORDER_MERCHANT_NO']));
                Configuration::updateValue('NEWORDER_MERCHANT_KEY', strval($_POST['NEWORDER_MERCHANT_KEY']));
                Configuration::updateValue('NEWORDER_MERCHANT_LANG', strval($_POST['NEWORDER_MERCHANT_LANG']));
                $this->displayConf();
            } else {
                $this->displayErrors();
            }
        }
        $conf = Configuration::getMultiple(array('NEWORDER_MERCHANT_NO', 'NEWORDER_MERCHANT_KEY', 'NEWORDER_MERCHANT_LANG'));
        $lang = array_key_exists('NEWORDER_MERCHANT_LANG', $_POST) ? $_POST['NEWORDER_MERCHANT_LANG'] : (array_key_exists('NEWORDER_MERCHANT_LANG', $conf) ? $conf['NEWORDER_MERCHANT_LANG'] : '');
        $html = '<h2>Create a new order</h2>
        <form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
            <fieldset>
            <legend><img src="../modules/payment/neworder/logo.png" />Settings</legend>
                <p>First use the sandbox to test out the module then you can use the real mode if everything\'s fine. Don\'t forget to change your merchant key and id according to the mode!</p>
                <label>Merchant No.</label>
                <div class="margin-form">
                    <input type="text" name="NEWORDER_MERCHANT_NO" value="' . Tools::getRequest('NEWORDER_MERCHANT_NO', Configuration::get('NEWORDER_MERCHANT_NO')) . '" size="30" />
                </div>
				<label>Sign Key</label>
                <div class="margin-form">
                    <input type="text" name="NEWORDER_MERCHANT_KEY" value="' . Tools::getRequest('NEWORDER_MERCHANT_KEY', Configuration::get('NEWORDER_MERCHANT_KEY')) . '" size="30"/>
                </div>
				<label>Language</label>
                <div class="margin-form">
                    <input type="radio" name="NEWORDER_MERCHANT_LANG" value="en" ' . ($lang == "en" ? 'checked="checked"' : '') . '/>英国
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="fr" ' . ($lang == "fr" ? 'checked="checked"' : '') . '/>法国
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="de" ' . ($lang == "de" ? 'checked="checked"' : '') . '/>德国
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="it" ' . ($lang == "it" ? 'checked="checked"' : '') . '/>意大利
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="da" ' . ($lang == "da" ? 'checked="checked"' : '') . '/>丹麦
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="es" ' . ($lang == "es" ? 'checked="checked"' : '') . '/>西班牙
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="in" ' . ($lang == "in" ? 'checked="checked"' : '') . '/>印度尼西亚
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="iw" ' . ($lang == "iw" ? 'checked="checked"' : '') . '/>希伯来
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="ja" ' . ($lang == "ja" ? 'checked="checked"' : '') . '/>日本
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="ms" ' . ($lang == "ms" ? 'checked="checked"' : '') . '/>马来西亚
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="nl" ' . ($lang == "nl" ? 'checked="checked"' : '') . '/>荷兰
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="nn" ' . ($lang == "nn" ? 'checked="checked"' : '') . '/>挪威
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="pl" ' . ($lang == "pl" ? 'checked="checked"' : '') . '/>波兰
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="ru" ' . ($lang == "ru" ? 'checked="checked"' : '') . '/>俄罗斯
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="sv" ' . ($lang == "sv" ? 'checked="checked"' : '') . '/>瑞典
					<input type="radio" name="NEWORDER_MERCHANT_LANG" value="tr" ' . ($lang == "tr" ? 'checked="checked"' : '') . '/>土耳其
                </div>
				 <div class="margin-form"><input type="submit" name="Submit_Cardpay_CheckOut" class="button" value="Save And Update" /></div>
            </fieldset>
        </form>';
        return $html;
    }
 /**
  * getConfiguration() method set all constant module in ps_configuration
  *
  * @param int $iShopId
  */
 public static function getConfiguration($iShopId = null)
 {
     // get configuration options
     if (null !== $iShopId && is_numeric($iShopId)) {
         FacebookPsConnect::$aConfiguration = Configuration::getMultiple(array_keys($GLOBALS[_FPC_MODULE_NAME . '_CONFIGURATION']), null, null, $iShopId);
     } else {
         FacebookPsConnect::$aConfiguration = Configuration::getMultiple(array_keys($GLOBALS[_FPC_MODULE_NAME . '_CONFIGURATION']));
     }
 }
 /**
  * Construct
  */
 public function __construct()
 {
     $this->name = 'realexredirect';
     $this->tab = 'payments_gateways';
     $this->version = '1.4';
     $this->author = 'Coccinet';
     $this->bout_valide = $this->l('Validate');
     $this->bout_suppr = $this->l('Do you want to delete your stored card ?');
     $this->currencies = true;
     $this->currencies_mode = 'checkbox';
     $config = Configuration::getMultiple(array('REALEX_REDIRECT_MERCHANT_ID', 'REALEX_REDIRECT_SHARED_SECRET', 'REALEX_REDIRECT_SETTLEMENT', 'REALEX_REDIRECT_SUBACCOUNT', 'REALEX_REDIRECT_REALVAULT', 'REALEX_REDIRECT_CVN', 'REALEX_REDIRECT_LIABILITY'));
     if (isset($config['REALEX_REDIRECT_MERCHANT_ID'])) {
         $this->merchant_id = $config['REALEX_REDIRECT_MERCHANT_ID'];
     }
     if (isset($config['REALEX_REDIRECT_SHARED_SECRET'])) {
         $this->shared_secret = $config['REALEX_REDIRECT_SHARED_SECRET'];
     }
     if (isset($config['REALEX_REDIRECT_SETTLEMENT'])) {
         $this->settlement = $config['REALEX_REDIRECT_SETTLEMENT'];
     }
     if (isset($config['REALEX_REDIRECT_REALVAULT'])) {
         $this->realvault = $config['REALEX_REDIRECT_REALVAULT'];
     }
     if (isset($config['REALEX_REDIRECT_CVN'])) {
         $this->cvn = $config['REALEX_REDIRECT_CVN'];
     }
     if (isset($config['REALEX_REDIRECT_LIABILITY'])) {
         $this->liability = $config['REALEX_REDIRECT_LIABILITY'];
     }
     parent::__construct();
     if (Configuration::get('PS_SSL_ENABLED')) {
         $this->url_validation = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'module/' . $this->name . '/validation';
     } else {
         $this->url_validation = Tools::getShopDomain(true, true) . __PS_BASE_URI__ . 'module/' . $this->name . '/validation';
     }
     $this->displayName = $this->l('Realex Payments');
     $this->description = $this->l('Use Realex Payments as your payments service provider.');
     $this->confirmUninstall = $this->l('Are you sure you want to delete this information?');
     $this->ps_versions_compliancy = array('min' => '1.5', 'max' => _PS_VERSION_);
     if (!function_exists('curl_version')) {
         $this->warning = $this->l('cURL librairy is not available.');
     } elseif (!Configuration::get('PS_REWRITING_SETTINGS')) {
         $this->warning = $this->l('URL Rewriting must be enabled before using this module.');
     } elseif (!isset($this->merchant_id) || empty($this->shared_secret) || !isset($this->settlement) || !isset($this->realvault) || !isset($this->cvn) || !isset($this->liability)) {
         $this->warning = $this->l('Realex Payment details must be configured before using this module.');
     } elseif (!$this->getTableAccount()) {
         $this->warning = $this->l('You have to configure at least one subaccount');
     }
     if (!count(Currency::checkPaymentCurrencies($this->id))) {
         $this->warning = $this->l('No currency has been set for this module.');
     }
     /** Backward compatibility */
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         require _PS_MODULE_DIR_ . $this->name . '/backward_compatibility/backward.php';
     }
 }
Example #29
0
    public function hookNewOrder($params)
    {
        if (!$this->_merchant_order or empty($this->_merchant_mails)) {
            return;
        }
        // Getting differents vars
        $id_lang = intval(Configuration::get('PS_LANG_DEFAULT'));
        $currency = $params['currency'];
        $configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME'));
        $order = $params['order'];
        $customer = $params['customer'];
        $delivery = new Address(intval($order->id_address_delivery));
        $invoice = new Address(intval($order->id_address_invoice));
        $order_date_text = Tools::displayDate($order->date_add, intval($id_lang));
        $carrier = new Carrier(intval($order->id_carrier));
        $message = $order->getFirstMessage();
        if (!$message or empty($message)) {
            $message = $this->l('No message');
        }
        $itemsTable = '';
        foreach ($params['cart']->getProducts() as $key => $product) {
            $unit_price = Product::getPriceStaticLC($product['id_product'], true, $product['id_product_attribute']);
            $price = Product::getPriceStaticLC($product['id_product'], true, $product['id_product_attribute'], 6, NULL, false, true, $product['quantity']);
            $itemsTable .= '<tr style="background-color:' . ($key % 2 ? '#DDE2E6' : '#EBECEE') . ';">
					<td style="padding:0.6em 0.4em;">' . $product['reference'] . '</td>
					<td style="padding:0.6em 0.4em;"><strong>' . $product['name'] . (isset($product['attributes_small']) ? ' ' . $product['attributes_small'] : '') . '</strong></td>
					<td style="padding:0.6em 0.4em; text-align:right;">' . Tools::displayPrice($unit_price, $currency, false, false) . '</td>
					<td style="padding:0.6em 0.4em; text-align:center;">' . intval($product['quantity']) . '</td>
					<td style="padding:0.6em 0.4em; text-align:right;">' . Tools::displayPrice($price * $product['quantity'], $currency, false, false) . '</td>
				</tr>';
        }
        foreach ($params['cart']->getDiscounts() as $discount) {
            $itemsTable .= '<tr style="background-color:#EBECEE;">
					<td colspan="4" style="padding:0.6em 0.4em; text-align:right;">' . $this->l('Voucher code:') . ' ' . $discount['name'] . '</td>
					<td style="padding:0.6em 0.4em; text-align:right;">-' . Tools::displayPrice($discount['value_real'], $currency, false, false) . '</td>
			</tr>';
        }
        if ($delivery->id_state) {
            $delivery_state = new State(intval($delivery->id_state));
        }
        if ($invoice->id_state) {
            $invoice_state = new State(intval($invoice->id_state));
        }
        // Filling-in vars for email
        $template = 'new_order';
        $subject = $this->l('New order');
        $templateVars = array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{delivery_company}' => $delivery->company, '{delivery_firstname}' => $delivery->firstname, '{delivery_lastname}' => $delivery->lastname, '{delivery_address1}' => $delivery->address1, '{delivery_address2}' => $delivery->address2, '{delivery_city}' => $delivery->city, '{delivery_postal_code}' => $delivery->postcode, '{delivery_country}' => $delivery->country, '{delivery_state}' => $delivery->id_state ? $delivery_state->name : '', '{delivery_phone}' => $delivery->phone, '{delivery_other}' => $delivery->other, '{invoice_company}' => $invoice->company, '{invoice_firstname}' => $invoice->firstname, '{invoice_lastname}' => $invoice->lastname, '{invoice_address2}' => $invoice->address2, '{invoice_address1}' => $invoice->address1, '{invoice_city}' => $invoice->city, '{invoice_postal_code}' => $invoice->postcode, '{invoice_country}' => $invoice->country, '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '', '{invoice_phone}' => $invoice->phone, '{invoice_other}' => $invoice->other, '{order_name}' => sprintf("%06d", $order->id), '{shop_name}' => Configuration::get('PS_SHOP_NAME'), '{date}' => $order_date_text, '{carrier}' => $carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name, '{payment}' => $order->payment, '{items}' => $itemsTable, '{total_paid}' => Tools::displayPrice($order->total_paid, $currency), '{total_products}' => Tools::displayPrice($order->getTotalProductsWithTaxes(), $currency), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency), '{currency}' => $currency->sign, '{message}' => $message);
        $iso = Language::getIsoById(intval($id_lang));
        if (file_exists(dirname(__FILE__) . '/mails/' . $iso . '/' . $template . '.txt') and file_exists(dirname(__FILE__) . '/mails/' . $iso . '/' . $template . '.html')) {
            Mail::Send($id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], NULL, NULL, dirname(__FILE__) . '/mails/');
        }
    }
Example #30
0
 public function processData()
 {
     if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) {
         if (!Validate::isLoadedObject($this->seller)) {
             $this->errors[] = Tools::displayError('Seller does not exist');
         } elseif (!$this->seller->active) {
             self::$smarty->assign('seller', $this->seller);
         } else {
             $rewrited_url = self::$link->getAgileSellerLink((int) $this->seller->id, $this->getSellerLinkRwrite());
             $this->seller_info->description = _PS_VERSION_ > '1.5' ? Tools::nl2br($this->seller_info->description) : nl2br2($this->seller_info->description);
             self::$smarty->assign('seller', $this->seller);
             self::$smarty->assign('seller_info', $this->seller_info);
             $sellermodule = new AgileMultipleSeller();
             $conf = Configuration::getMultiple($sellermodule->getCustomFields());
             $custom_labels = $sellermodule->getCustomLabels();
             self::$smarty->assign('conf', $conf);
             self::$smarty->assign('custom_labels', $custom_labels);
             $nbProducts = $this->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
             $this->pagination((int) $nbProducts);
             self::$smarty->assign('nb_products', (int) $nbProducts);
             $seller_products = $this->getProducts((int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay);
             AgileHelper::AssignProductImgs($seller_products);
             $si_1531_later = version_compare(_PS_VERSION_, '1.5.3.1', ">=");
             $HOOK_SELLER_RATINGS = '';
             if (Module::isInstalled('agilesellerratings')) {
                 require_once _PS_ROOT_DIR_ . "/modules/agilesellerratings/agilesellerratings.php";
                 $rmodule = new AgileSellerRatings();
                 $HOOK_SELLER_RATINGS = $rmodule->getAverageRating($this->id_seller, AgileSellerRatings::RATING_TYPE_SELLER);
             }
             self::$smarty->assign(array('products' => (isset($seller_products) and $seller_products) ? $seller_products : NULL, 'id_seller' => (int) $this->seller->id, 'path' => $this->seller_info->company, 'agilesellerproducts_tpl' => _PS_ROOT_DIR_ . "/modules/agilesellerproducts/", 'agilemultipleshop_tpl' => _PS_ROOT_DIR_ . "/modules/agilemultipleshop/", 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('category') : 'category'), 'mediumSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('medium') : 'medium'), 'thumbSceneSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('thumb_scene') : 'thumb_scene'), 'homeSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('home') : 'home'), 'HOOK_SELLER_RATINGS' => $HOOK_SELLER_RATINGS, 'page_name' => 'agileseller'));
             $ver = (int) str_replace(".", "", _PS_VERSION_);
             if ($ver <= 1430) {
             } else {
                 if ($ver <= 1451) {
                     if (isset(self::$cookie->id_customer)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int) self::$cookie->id_customer));
                     } elseif (isset(self::$cookie->id_guest)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int) self::$cookie->id_guest));
                     }
                 } else {
                     if (isset(self::$cookie->id_compare)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) self::$cookie->id_compare));
                     }
                 }
             }
         }
         self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers()));
     }
 }