This commit is contained in:
Serveur preprod 2016-06-01 11:53:40 +02:00
parent 642924ae45
commit be83006fb6
244 changed files with 20210 additions and 1098 deletions

View File

@ -4307,6 +4307,7 @@ class ProductCore extends ObjectModel
false,
false
);
} else {
$row['price'] = Tools::ps_round(
Product::getPriceStatic(

View File

@ -218,8 +218,8 @@ if (!defined('_PS_JQUERY_VERSION_')) {
}
define('ERP_URL', 'http://roykin.julius.fr');
define('ERP_DB', 'TestListePrix');
define('ERP_URL', 'http://roykin.erp-odoo.fr:8069');
define('ERP_DB', 'roykin');
define('ERP_USERNAME', 'admin');
define('ERP_PASSWORD', 'adminroykin123');
define('ERP_SCRIPT_TOKEN', 'Wq56lnviuXAQCMFHV9YHJnGk3RXMLMTkz0xhIu6U');
define('ERP_SCRIPT_TOKEN', 'Wq56lnviuXAQCMFHV9YHJnGk3RXMLMTkz0xhIu6U');

View File

@ -74,6 +74,7 @@ smartyRegisterFunction($smarty, 'function', 'convertPriceWithCurrency', array('P
smartyRegisterFunction($smarty, 'function', 'displayWtPrice', array('Product', 'displayWtPrice'));
smartyRegisterFunction($smarty, 'function', 'displayWtPriceWithCurrency', array('Product', 'displayWtPriceWithCurrency'));
smartyRegisterFunction($smarty, 'function', 'displayPrice', array('Tools', 'displayPriceSmarty'));
smartyRegisterFunction($smarty, 'function', 'displayPriceWithTaxTag', array('Tools', 'displayPriceWithTaxTagSmarty'));
smartyRegisterFunction($smarty, 'modifier', 'convertAndFormatPrice', array('Product', 'convertAndFormatPrice')); // used twice
smartyRegisterFunction($smarty, 'function', 'getAdminToken', array('Tools', 'getAdminTokenLiteSmarty'));
smartyRegisterFunction($smarty, 'function', 'displayAddressDetail', array('AddressFormat', 'generateAddressSmarty'));

View File

@ -117,7 +117,6 @@ class OrderConfirmationControllerCore extends FrontController
$params['currency'] = $currency->sign;
$params['objOrder'] = $order;
$params['currencyObj'] = $currency;
return Hook::exec('displayPaymentReturn', $params, $this->id_module);
}
}

View File

@ -2,8 +2,8 @@
ini_set("memory_limit","256M");
// CONFIGURATION
$url = 'http://roykin.julius.fr';
$db = 'TestListePrix';
$url = 'http://roykin.erp-odoo.fr:8069';
$db = 'roykin';
$username = "admin";
$password = 'adminroykin123';
@ -34,4 +34,4 @@ $assoc_attr = [
44 => 29,
46 => 31,
43 => 28
];
];

View File

@ -75,7 +75,8 @@ foreach ($ids_product as $key => $id) {
date_add,
date_upd,
nb_per_box,
unit_price_ratio)
unit_price_ratio,
unity)
VALUES (
2,
1,
@ -90,7 +91,7 @@ foreach ($ids_product as $key => $id) {
NOW(),
NOW(),
'.pSQL($nb_per_box).',
'.pSQL($nb_per_box).')';
'.pSQL($nb_per_box).', "bouteille")';
$d->execute($sql);
//set in ps_product_lang
@ -129,7 +130,8 @@ foreach ($ids_product as $key => $id) {
redirect_type,
date_add,
date_upd,
unit_price_ratio)
unit_price_ratio,
unity)
VALUES (
'.pSQL($product_id).',
1,
@ -140,7 +142,7 @@ foreach ($ids_product as $key => $id) {
"404",
NOW(),
NOW(),
'.pSQL($nb_per_box).')';
'.pSQL($nb_per_box).', "bouteille")';
$d->execute($sql);
//set in ps_stock_available
@ -208,64 +210,70 @@ foreach ($ids_product as $key => $id) {
$id_product_attribute = $d->Insert_ID();
// set in ps_product_attribute_shop
if ($key == 0) {
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_shop (
id_product,
id_product_attribute,
id_shop,
weight,
default_on)
VALUES(
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
'.pSQL($variant['weight_net']).',
1)';
$d->execute($sql);
} else {
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_shop (
id_product,
id_product_attribute,
id_shop,
weight)
VALUES(
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
'.pSQL($variant['weight']).')';
$d->execute($sql);
}
if ($id_product_attribute && $product_id) {
//set in ps_stock_available
$sql = 'INSERT INTO '._DB_PREFIX_.'stock_available (
id_product,
id_product_attribute,
id_shop,
id_shop_group,
quantity,
out_of_stock)
VALUES (
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
0,
'.pSQL($variant['qty_available']).',
2)';
$d->execute($sql);
// set in ps_product_attribute_shop
if ($key == 0) {
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_shop (
id_product,
id_product_attribute,
id_shop,
weight,
default_on)
VALUES(
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
'.pSQL($variant['weight_net']).',
1)';
$d->execute($sql);
} else {
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_shop (
id_product,
id_product_attribute,
id_shop,
weight)
VALUES(
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
'.pSQL($variant['weight']).')';
$d->execute($sql);
}
//set in ps_stock_available
$sql = 'INSERT INTO '._DB_PREFIX_.'stock_available (
id_product,
id_product_attribute,
id_shop,
id_shop_group,
quantity,
out_of_stock)
VALUES (
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
0,
'.pSQL($variant['qty_available']).',
2)';
$d->execute($sql);
foreach ($attrs as $attr) {
// if (empty($assoc_attr[$attr['id']])) {
// var_dump($attr); die;
// }
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_combination (id_attribute, id_product_attribute) VALUES('.(int)$assoc_attr[$attr['id']].', '.(int)$id_product_attribute.')';
$d->execute($sql);
}
}
foreach ($attrs as $attr) {
// if (empty($assoc_attr[$attr['id']])) {
// var_dump($attr); die;
// }
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_combination (id_attribute, id_product_attribute) VALUES('.(int)$assoc_attr[$attr['id']].', '.(int)$id_product_attribute.')';
$d->execute($sql);
}
}
} catch (Exception $e) {

View File

@ -53,6 +53,7 @@ foreach ($ids_product as $key => $id) {
}
}
// update product
$sql = 'UPDATE '._DB_PREFIX_.'product p, '._DB_PREFIX_.'product_lang pl, '._DB_PREFIX_.'product_shop ps
SET p.ean13 = "'.$record['ean13'].'",
@ -65,6 +66,8 @@ foreach ($ids_product as $key => $id) {
p.reference = "'.$record['default_code'].'",
p.weight = '.(float)$record['weight'].',
name = "'.$record['name'].'",
p.unity = "bouteille",
ps.unity = "bouteille",
description_short = "<p>'.pSQL(trim($record['description_sale'])).'</p>",
link_rewrite = "'.pSQL(Tools::link_rewrite(trim($record['name']))).'"
WHERE id_erp = '.(int)$id.'
@ -84,6 +87,9 @@ foreach ($ids_product as $key => $id) {
$sql = 'DELETE FROM '._DB_PREFIX_.'product_attribute_shop WHERE id_product = '.(int)$product_id;
$d->execute($sql);
$sql = 'DELETE FROM '._DB_PREFIX_.'stock_available WHERE id_product = '.(int)$product_id;
$d->execute($sql);
foreach ($variants as $key => $variant) {
// set in ps_product_attribute
@ -106,58 +112,60 @@ foreach ($ids_product as $key => $id) {
$id_product_attribute = $d->Insert_ID();
// set in ps_product_attribute_shop
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_shop (
id_product,
if ($product_id && $id_product_attribute) {
// set in ps_product_attribute_shop
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_shop (
id_product,
id_product_attribute,
id_shop,
weight,
default_on)
VALUES(
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
'.pSQL($variant['weight_net']).',
'.(($key == 0) ? '1' : 'null').')';
$d->execute($sql);
//set in ps_stock_available
$sql = 'INSERT INTO '._DB_PREFIX_.'stock_available (
id_product,
id_product_attribute,
id_shop,
weight,
default_on)
VALUES(
'.(int)$product_id.',
'.pSQL($id_product_attribute).',
1,
'.pSQL($variant['weight_net']).',
'.(($key == 0) ? '1' : 'null').')';
id_shop_group,
quantity,
out_of_stock)
VALUES (
'.(int)$product_id.',
'.(int)$id_product_attribute.',
1,
0,
'.pSQL($variant['qty_available']).',
2)';
$d->execute($sql);
//set in ps_stock_available
$sql = 'INSERT INTO '._DB_PREFIX_.'stock_available (
id_product,
id_product_attribute,
id_shop,
id_shop_group,
quantity,
out_of_stock)
VALUES (
'.(int)$product_id.',
'.pSQL($id_product_attribute).',
1,
0,
'.pSQL($variant['qty_available']).',
2)';
$d->execute($sql);
$attrs = $models->execute_kw($db, $uid, $password,
'product.attribute.value', 'read', [$variant['attribute_value_ids']]
);
$attrs = $models->execute_kw($db, $uid, $password,
'product.attribute.value', 'read', [$variant['attribute_value_ids']]
);
$sql = 'SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute pa WHERE id_erp = '.(int)$variant['id'];
$id_product_attribute = $d->getRow($sql)['id_product_attribute'];
$sql = 'SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute pa WHERE id_erp = '.(int)$variant['id'];
$id_product_attribute = $d->getRow($sql)['id_product_attribute'];
$sql = 'DELETE FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_product_attribute = '.(int)$id_product_attribute;
$d->execute($sql);
$sql = 'DELETE FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_product_attribute = '.(int)$id_product_attribute;
$d->execute($sql);
foreach ($attrs as $attr) {
foreach ($attrs as $attr) {
if (empty($assoc_attr[$attr['id']])) {
var_dump($attr); die;
}
if (empty($assoc_attr[$attr['id']])) {
var_dump($attr); die;
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_combination (id_attribute, id_product_attribute) VALUES('.(int)$assoc_attr[$attr['id']].', '.(int)$id_product_attribute.')';
$d->execute($sql);
}
}
$sql = 'INSERT INTO '._DB_PREFIX_.'product_attribute_combination (id_attribute, id_product_attribute) VALUES('.(int)$assoc_attr[$attr['id']].', '.(int)$id_product_attribute.')';
$d->execute($sql);
}
}
}
}

View File

@ -37,7 +37,7 @@
<br /><br />- {l s='Do not forget to insert your order reference %s in the subject of your bank wire.' sprintf=$reference mod='bankwire'}
{/if} <br /><br />{l s='An email has been sent with this information.' mod='bankwire'}
<br /><br /> <strong>{l s='Your order will be sent as soon as we receive payment.' mod='bankwire'}</strong>
<br /><br />{l s='If you have questions, comments or concerns, please contact our' mod='bankwire'} <a href="{$link->getPageLink('contact', true)|escape:'html'}">{l s='expert customer support team' mod='bankwire'}</a>.
<br /><br />{l s='If you have questions, comments or concerns, please contact our' mod='bankwire'} {l s='expert customer support team' mod='bankwire'}
</p>
{else}
<p class="warning">

View File

View File

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,53 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Order extends OrderCore
{
/**
* BE2BILL OVERRIDE
* Purpose: Pregenerate a reference for the order
*/
/**
* BE2BILL OVERRIDE
* Create a reference if the cart doesn't have one, else return the reference
* @return string
*/
public static function generateReference()
{
$id_cart = (int)Context::getContext()->cart->id;
$reference = self::getReferenceByCartId($id_cart);
if (empty($reference)) {
$reference = Tools::strtoupper(Tools::passwdGen(9));
}
return $reference;
}
/**
* Retrieve the pregenerate reference
* @return string
*/
public static function getReferenceByCartId($id_cart)
{
if (empty($id_cart)) {
return false;
}
return Db::getInstance()->getValue('SELECT reference
FROM `'._DB_PREFIX_.'b2b_order_reference`
WHERE id_cart ='.pSQL((int)$id_cart));
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

50
modules/be2bill/ajax.php Normal file
View File

@ -0,0 +1,50 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
include_once('../../config/config.inc.php');
include_once('../../init.php');
include_once('../../modules/be2bill/classes/Be2billXml.php');
include_once('../../modules/be2bill/be2bill.php');
$be2bill = new Be2bill();
/* Default answer */
$result = array(
'answer' => true,
'msg' => ''
);
/* need reset tables */
if (Tools::getValue('action') == 'reset_tables') {
Be2billXml::insertXmlToDb();
$result['answer'] = true;
$result['msg'] = $be2bill->l('Reset complete');
}
/* need update tables */
if (Tools::getValue('action') == 'update_tables') {
if (Be2billXml::paymentsNeedUpgrade()) {
Be2billXml::insertXmlToDb();
$result['answer'] = true;
$result['msg'] = $be2bill->l('Update complete');
$result['xml_version'] = (string)Configuration::getGlobalValue('BE2BILL_XML_VERSION');
} else {
$result['answer'] = true;
$result['msg'] = $be2bill->l('Udpate not needed, tables already up to date');
$result['xml_version'] = (string)Configuration::getGlobalValue('BE2BILL_XML_VERSION');
}
}
header('Content-type: application/json');
echo(Tools::jsonEncode($result));

1238
modules/be2bill/be2bill.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,182 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billAlias extends ObjectModel
{
/**
* Be2bill Alias ID
* @var integer
*/
public $id_b2b_alias;
/**
* Customer ID
* @var integer
*/
public $id_customer;
/**
* Merchand account ID
* @var integer
*/
public $id_merchand_account;
/**
* ALIAS parameter send by the payment platform
* @var string
*/
public $alias;
/**
* CARDTYPE parameter send by the payment platform
* @var string
*/
public $card_type;
/**
* CARDCODE parameter send by the payment platform
* @var string
*/
public $card_number;
/**
* Card expiration date calculated with
* CARDVALIDITYDATE parameter send by the payment platform
* @var date
*/
public $date_end;
/**
* Object creation date
* @var date
*/
public $date_add;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'b2b_alias',
'primary' => 'id_b2b_alias',
'fields' => array(
'id_customer' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
'required' => true
),
'id_merchand_account' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
'required' => true
),
'alias' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'card_type' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'card_number' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'date_end' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'date_add' => array(
'type' => self::TYPE_DATE,
'validate' => 'isDate'
)
)
);
/**
* Create Alias table
* @return boolean
*/
public static function createBe2billAliasTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_alias` (
`id_b2b_alias` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_customer` INT(10) UNSIGNED NOT NULL,
`id_merchand_account` INT(10) UNSIGNED NOT NULL,
`alias` VARCHAR(255) NOT NULL,
`card_type` VARCHAR(255) NOT NULL,
`card_number` VARCHAR(255) NOT NULL,
`date_add` DATETIME NOT NULL,
`date_end` DATETIME NOT NULL,
PRIMARY KEY (`id_b2b_alias`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
return Db::getInstance()->execute($sql);
}
/**
* Returns alias row by ID customer if exists or false
* @param int $id_customer, int $id_account
* @return boolean|string
*/
public static function getByIdCustomer($id_customer, $id_account)
{
if (!Validate::isUnsignedId($id_customer) || !Validate::isUnsignedId($id_account)) {
return false;
}
return Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'b2b_alias`
WHERE `id_customer` = '.(int)($id_customer).' AND `id_merchand_account` = '.(int)($id_account));
}
/**
* Returns alias array by ID customer if exists or false
* @param int $id_customer, int $id_account
* @return boolean|string
*/
public static function getAllByIdCustomer($id_customer)
{
if (!Validate::isUnsignedId($id_customer)) {
return false;
}
return Db::getInstance()->executeS('
SELECT *,ac.b2b_xml_account_type_code as code
FROM `'._DB_PREFIX_.'b2b_alias` a
LEFT JOIN `'._DB_PREFIX_.'b2b_merchand_configuration_account` ac
ON a.id_merchand_account = ac.id_b2b_merchand_configuration_account
WHERE `id_customer` = '.(int)($id_customer));
}
/**
* Returns alias array from old tables or false
* @param none
* @return boolean|string
*/
public static function getOldList()
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'be2bill_alias`
');
}
}

View File

@ -0,0 +1,503 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billApi
{
/**
* Create and return the HASH parameter
* @return string|boolean
*/
public static function buildHash($parameters, $id_account, $params_no_hash = null)
{
if (!count($parameters)) {
return false;
}
if (!(int)$id_account) {
return false;
}
#Alpha sort
ksort($parameters);
//$password = html_entity_decode(Configuration::get('BE2BILL_PWD'), ENT_QUOTES);
if (!MerchandConfiguration::getPassword($id_account)) {
return false;
}
$password = html_entity_decode(MerchandConfiguration::getPassword($id_account), ENT_QUOTES);
$clear_string = $password;
/* foreach ($parameters as $key => $value) {
if (is_array($value) == true) {
ksort($value);
foreach ($value as $index => $val) {
$clear_string .= $key.'['.$index.']='.$val.$password;
}
} else {
$clear_string .= $key.'='.$value.$password;
}
} */
foreach ($parameters as $key => $value) {
// if the key in the array when no calc hash
if (in_array($key, $params_no_hash)){
continue;
}
if (is_array($value) == true) {
ksort($value);
foreach ($value as $index => $val) {
if (is_array($val) == true) {
ksort($val);
foreach ($val as $index2 => $val2) {
$clear_string .= $key.'['.$index.']['.$index2.']='.$val2.$password;
}
} else {
$clear_string .= $key.'['.$index.']='.$val.$password;
}
}
} else {
$clear_string .= $key.'='.$value.$password;
}
}
return hash('sha256', $clear_string);
}
/**
* return the url setting
* @return array
*/
public static function getAvailableUrls($server_to_server = true, $is_direct_submit = false)
{
// Get be2bill server URLs
if (Configuration::getGlobalValue('BE2BILL_SANDBOX')) {
$server_urls = array(
'main' => Configuration::getGlobalValue('BE2BILL_SB_MAIN_SERVER'),
'slave' => Configuration::getGlobalValue('BE2BILL_SB_SLAVE_SERVER')
);
} else {
$server_urls = array(
'main' => Configuration::getGlobalValue('BE2BILL_MAIN_SERVER'),
'slave' => Configuration::getGlobalValue('BE2BILL_SLAVE_SERVER')
);
}
$urls = array();
if ($is_direct_submit) {
$path = '/front/direct-submit/process';
} elseif ($server_to_server) {
$path = '/front/service/rest/process';
} else {
$path = '/front/form/process.php';
}
foreach ($server_urls as $type => $host) {
$url = $host.$path;
$result = Tools::file_get_contents($url);
if ($result) {
$urls[$type] = $url;
}
}
return $urls;
}
/**
* Send payment method for directlink - directsubmit mode
* @return array
*/
public static function sendToServer($method, $parameters)
{
$available_urls = self::getAvailableUrls();
$server_url = (isset($available_urls['main'])) ? $available_urls['main'] : $available_urls['slave'];
$options = array(
'http' => array(
'method' => 'POST',
'content' => http_build_query(array(
'method' => $method,
'params' => $parameters))
)
);
$result = Tools::file_get_contents($server_url, false, stream_context_create($options));
return Tools::jsonDecode($result, true);
}
/**
* Send capture method for directlink - directsubmit mode
* @return array
*/
public static function capture($reference, $transaction_id, $id_account, $amount = 0, $extradata = '')
{
// Get first order by reference (ORDERID)
$order = Order::getByReference($reference)->getFirst();
$params_no_hash = array();
// get Be2Bill account paramaters
$parameters = MerchandConfiguration::getDefaultParameters(
$reference,
$id_account,
Be2billTransaction::TYPE_CAPTURE,
$order->id,
$params_no_hash
);
// Set parameters
$parameters['TRANSACTIONID'] = $transaction_id;
$parameters['EXTRADATA'] = 'be2bill-'.$id_account.'-capture';
if ($amount) {
$parameters['AMOUNT'] = $amount * 100;
}
// Get HASH value
$parameters['HASH'] = self::buildHash($parameters, $id_account,$params_no_hash);
ksort($parameters);
return self::sendToServer(Be2billTransaction::TYPE_CAPTURE, $parameters);
}
/**
* Send refund method for directlink - directsubmit mode
* @return array
*/
public static function refund($reference, $transaction_id, $id_account, $amount = 0, $extradata = '')
{
// Get first order by reference (ORDERID)
$order = Order::getByReference($reference)->getFirst();
$params_no_hash = array();
// get Be2Bill account paramaters
$parameters = MerchandConfiguration::getDefaultParameters(
$reference,
$id_account,
Be2billTransaction::TYPE_REFUND,
$order->id,
$params_no_hash
);
// Set parameters
$parameters['TRANSACTIONID'] = $transaction_id;
$parameters['EXTRADATA'] = 'be2bill-'.$id_account.'-refund'.':'.$extradata;
if ($amount) {
$parameters['AMOUNT'] = $amount * 100;
}
// Get HASH value
$parameters['HASH'] = self::buildHash($parameters, $id_account,$params_no_hash);
ksort($parameters);
return self::sendToServer(Be2billTransaction::TYPE_REFUND, $parameters);
}
/**
* Convert order total price in euros
* @param float $price
* @param int $order_currency
* @return float
*/
public static function getConvertedPrice($price, $order_currency)
{
/* not implented yet*/
return $price;
/*$id_currency = Currency::getIdByIsoCode('EUR');
if ($order_currency == $id_currency) {
}
if ($id_currency == (int)Configuration::get('PS_CURRENCY_DEFAULT')) {
return Tools::ps_round(Tools::convertPrice($price, $order_currency, false), 2);
} else {
return Tools::ps_round(Tools::convertPrice($price, $id_currency, true), 2);
}*/
}
/**
* Get an order by its cart id
*
* @param integer $id_cart Cart id
* @return array Order details
*/
public static function getOrderByCartId($id_cart, $id_shop)
{
$sql = 'SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE `id_cart` = '.pSQL((int)$id_cart).'
AND `id_shop` = '.pSQL((int)$id_shop);
$result = Db::getInstance()->getRow($sql);
return isset($result['id_order']) ? $result['id_order'] : false;
}
/**
* Get all available account type for a currency
*
* @param string $currency_iso Currency iso
* @return array Account type list
*/
public static function getAvailableAcountTypeByCurrency($currency_iso)
{
if ($currency_iso) {
$id_lang = Context::getContext()->language->id;
$lang_iso = Language::getIsoById($id_lang);
$sql = 'SELECT ac.b2b_xml_account_type_code as code , acl.name
FROM `'._DB_PREFIX_.'b2b_xml_account_type_currency` ac
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_lang` acl
ON acl.b2b_xml_account_type_code = ac.b2b_xml_account_type_code
WHERE ac.currency_iso IN ("'.pSQL($currency_iso).'", "all")
AND (acl.lang_iso = "'.pSQL($lang_iso).'" OR acl.lang_iso = "en")
GROUP BY ac.b2b_xml_account_type_code';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Get all available Modes for an account type
*
* @param string $account_type_code Account Type CODE
* @return array Modes list
*/
public static function getAvailableModesByAccountType($account_type_code)
{
if ($account_type_code) {
$id_lang = Context::getContext()->language->id;
$lang_iso = Language::getIsoById($id_lang);
$sql = 'SELECT apm.b2b_xml_mode_code as id , apm.b2b_xml_mode_code as value, aml.name as label
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_mode` apm
ON apm.id_b2b_xml_account_type_parameter_set = ap.id_b2b_xml_account_type_parameter_set
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_modes_lang` aml ON aml.b2b_xml_mode_code = apm.b2b_xml_mode_code
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` apo
ON apo.id_b2b_xml_account_type_parameter_set = ap.id_b2b_xml_account_type_parameter_set
WHERE ap.b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND (aml.lang_iso = "'.pSQL($lang_iso).'" OR aml.lang_iso = "en")
AND apo.b2b_xml_operation_code
IN ("'.MerchandConfiguration::TYPE_PAYMENT.'" , "'.MerchandConfiguration::TYPE_AUTHORIZATION.'")
GROUP BY apm.b2b_xml_mode_code
ORDER BY aml.name';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Get all available Options for an account type
*
* @param string $account_type_code Account Type CODE
* @return array options list
*/
public static function getAvailableOptionsByAccountType($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT apo.b2b_xml_option as code_option FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_options` apo
ON apo.id_b2b_xml_account_type_parameter_set = ap.id_b2b_xml_account_type_parameter_set
WHERE ap.b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
GROUP BY apo.b2b_xml_option';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Get all available Options for an account type
*
* @param string $account_type_code Account Type CODE
* @return array options list
*/
public static function getCreateAliasByAccountType($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT apo.b2b_xml_option as code_option FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_options` apo
ON apo.id_b2b_xml_account_type_parameter_set = ap.id_b2b_xml_account_type_parameter_set
WHERE ap.b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND apo.b2b_xml_option = "'.MerchandConfigurationOptions::TYPE_DISPLAYCREATEALIAS.'"
GROUP BY apo.b2b_xml_option';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Get all account type
*
*
* @return array account type list
*/
public static function getAllAccountsType()
{
$id_lang = Context::getContext()->language->id;
$lang_iso = Language::getIsoById($id_lang);
$sql = 'SELECT ac.b2b_xml_account_type_code as id , ac.b2b_xml_account_type_code as value, acl.name as label
FROM `'._DB_PREFIX_.'b2b_xml_account_type_currency` ac
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_lang` acl
ON acl.b2b_xml_account_type_code = ac.b2b_xml_account_type_code
WHERE acl.lang_iso = "'.pSQL($lang_iso).'" OR acl.lang_iso = "en"
GROUP BY ac.b2b_xml_account_type_code';
return Db::getInstance()->executeS($sql);
}
/**
* Get all Modes
*
*
* @return array modes list
*/
public static function getAllModes()
{
$id_lang = Context::getContext()->language->id;
$lang_iso = Language::getIsoById($id_lang);
$sql = 'SELECT b2b_xml_mode_code as id , b2b_xml_mode_code as value, name as label
FROM `'._DB_PREFIX_.'b2b_xml_modes_lang`
WHERE lang_iso = "'.pSQL($lang_iso).'" OR lang_iso = "en"
GROUP BY b2b_xml_mode_code';
return Db::getInstance()->executeS($sql);
}
/**
* Get all Operations
*
*
* @return array Operations list
*/
public static function getAllOperations()
{
$id_lang = Context::getContext()->language->id;
$lang_iso = Language::getIsoById($id_lang);
$sql = 'SELECT b2b_xml_operation_code as id , b2b_xml_operation_code as value, name as label
FROM `'._DB_PREFIX_.'b2b_xml_operation_lang`
WHERE lang_iso = "'.pSQL($lang_iso).'" OR lang_iso = "en"
GROUP BY b2b_xml_operation_code';
return Db::getInstance()->executeS($sql);
}
/**
* Check if account type can do authorization operation
*
*
* @return array if true
*/
public static function hasDefered($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT b2b_xml_operation_code
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` ao
ON ao.`id_b2b_xml_account_type_parameter_set` = ap.`id_b2b_xml_account_type_parameter_set`
WHERE b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND ao.b2b_xml_operation_code = "'.MerchandConfiguration::TYPE_AUTHORIZATION.'"';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Check if account type can do refund operation
*
* @return array if true
*/
public static function hasRefund($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT b2b_xml_operation_code
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` ao
ON ao.`id_b2b_xml_account_type_parameter_set` = ap.`id_b2b_xml_account_type_parameter_set`
WHERE b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND ao.b2b_xml_operation_code = "'.MerchandConfiguration::TYPE_REFUND.'"';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Check if account type can do standard payment
*
* @return array if true
*/
public static function hasStandard($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT b2b_xml_operation_code
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` ao
ON ao.`id_b2b_xml_account_type_parameter_set` = ap.`id_b2b_xml_account_type_parameter_set`
WHERE b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND ao.b2b_xml_operation_code = "'.MerchandConfiguration::TYPE_PAYMENT.'"';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Check if account type can be used for any countries
*
* @return array if true, boolean for false
*/
public static function hasNotCountriesRestriction($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT country_iso
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries` ac
ON ac.`id_b2b_xml_account_type_parameter_set` = ap.`id_b2b_xml_account_type_parameter_set`
WHERE b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND ac.country_iso = "al"
';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* return authorized countries for an account type
*
* @return array if true
*/
public static function getCountriesRestriction($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT co.id_country as id , ac.country_iso as label
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ap
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries` ac
ON ac.`id_b2b_xml_account_type_parameter_set` = ap.`id_b2b_xml_account_type_parameter_set`
LEFT JOIN `'._DB_PREFIX_.'country` co ON co.iso_code = ac.country_iso
WHERE ap.b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND ac.country_iso <> "al"
GROUP BY ac.country_iso';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* return logo url by default for an account type
*
* @return array if true
*/
public static function getLogoUrl($account_type_code)
{
if ($account_type_code) {
$sql = 'SELECT b2b_xml_account_type_logo
FROM `'._DB_PREFIX_.'b2b_xml_account_types`
WHERE b2b_xml_account_type_code = "'.pSQL($account_type_code).'"';
return Db::getInstance()->getRow($sql);
}
return false;
}
}

View File

@ -0,0 +1,146 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billExeccode extends ObjectModel
{
/**
* Be2bill Execcode ID
* Same value as the EXECCODE parameter sent by the payment platform
* @var string
*/
public $id_b2b_execcode;
/**
* Message associated to the EXECCODE parameter sent by
* the payment platform
* @var string
*/
public $message;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'b2b_execcode',
'primary' => 'id_b2b_execcode',
'multilang' => true,
'fields' => array(
'message' => array(
'type' => self::TYPE_STRING,
'lang' => true,
'validate' => 'isString',
'required' => true
)
)
);
/**
* Create Execcode table
* @return boolean
*/
public static function createBe2billExeccodeTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_execcode` (
`id_b2b_execcode` VARCHAR(10) NOT NULL,
`message` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id_b2b_execcode`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
return Db::getInstance()->execute($sql);
}
/**
* Insert in Be2bill Execcode table the default values of EXECCODE
* and messages associated
* @return boolean
*/
public static function insertBe2billExeccodeDefaultValues()
{
$data = array(
'0000' => 'Transaction Successfull',
'0001' => '3DSecure Identification required',
'0002' => 'Redirection to alternative payment required',
'1001' => 'Missing parameters',
'1002' => 'Invalid parameters',
'1003' => 'HASH Error',
'1004' => 'Protocol Not supported',
'1005' => 'REST ERROR',
'1006' => 'GET parameters forbidden',
'2001' => 'ALIAS not found',
'2002' => 'Reference transaction failed',
'2003' => 'Reference transaction not refundable',
'2004' => 'Reference transaction not found',
'2005' => 'Reference transaction not capturable',
'2006' => 'Reference transaction not finished',
'2007' => 'Invalid capture amount',
'2008' => 'The refund amount is invalid',
'2009' => 'The authorization has expired',
'2010' => 'Timetable not found',
'2011' => 'Timetable already interupt',
'2012' => 'Timetable already over',
'3001' => 'Acount disactivated',
'3002' => 'Server IP not known by BE2BILL',
'3003' => 'Transaction not allowed',
'4001' => 'Transaction refused by the banking network',
'4002' => 'insufficient funds',
'4003' => 'Card refused by the banking network',
'4004' => 'Transaction aborted',
'4005' => 'Fraud suspected',
'4006' => 'Card lost',
'4007' => 'Card stolen',
'4008' => '3DSecure Authentication failed',
'4009' => '3DSecure Authentication expired',
'4010' => 'Invalid transaction',
'4011' => 'Transaction duplicated',
'4012' => 'Invalid Card data',
'4013' => 'Transaction unauthorized by the banking network for this person',
'4014' => '3D secure card non enroled',
'4015' => 'Transaction expired',
'4016' => 'Transaction refused by payment terminal',
'4017' => 'Exceeding the expiry date of the form ( filled in by the merchant )',
'5001' => 'Protocol error',
'5002' => 'Banking network error',
'5003' => 'Maintenance active',
'5004' => 'Time out, the response will arrive by the notification url',
'5005' => 'Error displaying 3D Secure Module',
'6001' => 'Transaction declined by merchant',
'6002' => 'Transaction declined',
'6003' => 'Cardholder has already disputed a transaction',
'6004' => 'Transaction declined by merchants rules'
);
foreach ($data as $execcode => $message) {
Db::getInstance()->insert('b2b_execcode', array(
'id_b2b_execcode' => pSQL($execcode),
'message' => pSQL($message)
), false, true, Db::INSERT_IGNORE);
}
return (Db::getInstance()->getValue('SELECT COUNT(*) FROM `'._DB_PREFIX_.'b2b_execcode`') >= count($data));
}
/**
* Return the associated message to the given EXECCODE
* @param string $execcode
* @return string|boolean
*/
public static function getMessageByExeccode($execcode)
{
return Db::getInstance()->getValue('SELECT `message`
FROM `'._DB_PREFIX_.'b2b_execcode`
WHERE `id_b2b_execcode` = \''.pSQL($execcode).'\'');
}
}

View File

@ -0,0 +1,115 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billExeccodeHistory extends ObjectModel
{
/**
* Be2bill Execcode History ID
* @var integer
*/
public $id_b2b_execcode_history;
/**
* Be2bill Execcode ID
* @var string
*/
public $id_b2b_execcode;
/**
* Be2bill Transaction ID
* @var integer
*/
public $id_b2b_transaction;
/**
* Object creation date
* @var date
*/
public $date_add;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'b2b_execcode_history',
'primary' => 'id_b2b_execcode_history',
'fields' => array(
'id_b2b_execcode' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'id_b2b_transaction' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
'required' => true
),
'date_add' => array(
'type' => self::TYPE_DATE,
'validate' => 'isDate'
)
)
);
/**
* Create Execcode History table
* @return boolean
*/
public static function createBe2billExeccodeHistoryTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_execcode_history` (
`id_b2b_execcode_history` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_b2b_execcode` VARCHAR(10) NOT NULL,
`id_b2b_transaction` INT(10) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_b2b_execcode_history`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
return Db::getInstance()->execute($sql);
}
/**
* Get execcode history by be2bill transaction ID
* @param string $transaction_id
* @return array|boolean
*/
public static function getByBe2billTransactionId($transaction_id)
{
if (!Validate::isUnsignedId($transaction_id)) {
return false;
}
return Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'b2b_execcode_history`
WHERE `id_b2b_transaction` = \''.(int)pSQL($transaction_id).'\'
');
}
/**
* Returns execode history array from old tables or false
* @param none
* @return boolean|string
*/
public static function getOldList()
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'be2bill_execcode_history`
');
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,173 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billOrderReference extends ObjectModel
{
/**
* Object Cart ID
* @var integer
*/
public $id_cart;
/**
* Be2bill Order Reference
* @var string
*/
public $reference;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'b2b_order_reference',
'primary' => 'id_cart',
'fields' => array(
'id_cart' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
'required' => true
),
'reference' => array(
'type' => self::TYPE_STRING,
'required' => true
)
)
);
/**
* Create Order Reference table
* @return boolean
*/
public static function createBe2billOrderReferenceTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_order_reference` (
`id_cart` INT(10) NOT NULL,
`reference` VARCHAR(128) NOT NULL,
PRIMARY KEY (`id_cart`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
return Db::getInstance()->execute($sql);
}
/**
* Add the reference at one cart
* @return the reference created
*/
public static function addCartReference($id_cart, $reference)
{
$already_add = self::getReferenceByCartId((int)$id_cart);
if (empty($already_add)) {
Db::getInstance()->insert('b2b_order_reference', array(
'id_cart' => pSQL((int)$id_cart),
'reference' => pSQL($reference)));
return $reference;
} else {
return $already_add;
}
}
/**
* Retrieve the Order Reference
* @return string
*/
public static function getReferenceByCartId($id_cart)
{
return Db::getInstance()->getValue('SELECT reference
FROM `'._DB_PREFIX_.'b2b_order_reference`
WHERE id_cart ='.pSQL((int)$id_cart));
}
/**
* Retrieve the cart id
* @return int
*/
public static function getIdCartByReference($reference)
{
return Db::getInstance()->getValue('SELECT id_cart
FROM `'._DB_PREFIX_.'b2b_order_reference`
WHERE reference="'.pSQL($reference).'"');
}
/**
* Return the reference if the order exist
* @return boolean
*/
public static function isOrderByReference($reference)
{
$result = Db::getInstance()->getValue('SELECT reference
FROM `'._DB_PREFIX_.'orders`
WHERE reference="'.pSQL($reference).'"');
// result_b2b purpose is to do the job even if the override isn't installed
$result_b2b = Db::getInstance()->getValue('SELECT id_cart
FROM `'._DB_PREFIX_.'b2b_order_reference`
WHERE reference="'.pSQL($reference).'"');
if (!empty($result)) {
return true;
} elseif (!empty($result_b2b)) {
$result = Db::getInstance()->getValue('SELECT reference
FROM `'._DB_PREFIX_.'orders`
WHERE id_cart="'.pSQL($result_b2b).'"');
if (!empty($result)) {
return true;
}
}
return false;
}
/**
* Return Prestashop Reference By Be2bill Reference
* It's possible thoses two don't match without the override installed
* @return varchar
*/
public static function getReferenceByBe2billReference($reference)
{
$result = Db::getInstance()->getValue('SELECT reference
FROM `'._DB_PREFIX_.'orders`
WHERE reference="'.pSQL($reference).'"');
// result_b2b purpose is to do the job even if the override isn't installed
$result_b2b = Db::getInstance()->getValue('SELECT id_cart
FROM `'._DB_PREFIX_.'b2b_order_reference`
WHERE reference="'.pSQL($reference).'"');
if (!empty($result)) {
return $result;
} elseif (!empty($result_b2b)) {
$result = Db::getInstance()->getValue(
'SELECT reference FROM `'._DB_PREFIX_.'orders` WHERE id_cart="'.(int)$result_b2b.'"'
);
if (!empty($result)) {
return $result;
}
}
return false;
}
/**
* Returns reference array from old tables or false
* @param none
* @return boolean|string
*/
public static function getOldList()
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'be2bill_order_reference`
');
}
}

View File

@ -0,0 +1,336 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billSchedule extends ObjectModel
{
/**
* Be2bill Schedule ID
* @var integer
*/
public $id_b2b_schedule;
/**
* Order ID
* @var integer
*/
public $id_order;
/**
* TRANSACTIONID parameter send by the payment platform
* @var string
*/
public $transaction_id;
/**
* SCHEDULEID parameter send by the payment platform
* @var string
*/
public $schedule_id;
/**
* Be2bill Alias ID
* @var integer
*/
public $id_b2b_alias;
/**
* Amount to capture
* @var float
*/
public $amount;
/**
* Object creation date
* @var date
*/
public $date_add;
/**
* Date when the capture can be done
* @var date
*/
public $date_scheduled;
/**
* Date when the capture is done
* @var date
*/
public $date_done;
/**
* Is the capture done?
* @var boolean
*/
public $is_done;
/**
* Is the capture done?
* @var boolean
*/
public $option = '';
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'b2b_schedule',
'primary' => 'id_b2b_schedule',
'fields' => array(
'id_order' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
'required' => true
),
'transaction_id' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString'
),
'schedule_id' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString'
),
'id_b2b_alias' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt'
),
'amount' => array(
'type' => self::TYPE_FLOAT,
'validate' => 'isFLoat',
'required' => true
),
'date_add' => array(
'type' => self::TYPE_DATE,
'validate' => 'isDate'
),
'date_scheduled' => array(
'type' => self::TYPE_DATE,
'validate' => 'isDateFormat'
),
'date_done' => array(
'type' => self::TYPE_DATE,
'validate' => 'isDateFormat'
),
'is_done' => array(
'type' => self::TYPE_BOOL,
'validate' => 'isBool'
),
'option' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString'
)
)
);
/**
* Create Schedule table
* @return boolean
*/
public static function createBe2billScheduleTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_schedule` (
`id_b2b_schedule` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_order` INT(10) UNSIGNED NOT NULL,
`transaction_id` VARCHAR(25) NULL DEFAULT NULL,
`schedule_id` VARCHAR(25) NULL DEFAULT NULL,
`id_b2b_alias` INT(10) UNSIGNED NULL DEFAULT NULL,
`amount` DECIMAL(17,2) NOT NULL,
`date_add` DATETIME NOT NULL,
`date_scheduled` DATETIME NULL DEFAULT NULL,
`date_done` DATETIME NULL DEFAULT NULL,
`is_done` INT(1) NOT NULL DEFAULT \'0\',
`option` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id_b2b_schedule`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
return Db::getInstance()->execute($sql);
}
/**
* return schedule for order, argument id_order
* @return array|boolean
*/
public static function getByIdOrder($id_order)
{
if (!Validate::isUnsignedId($id_order)) {
return false;
}
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'b2b_schedule`
WHERE `id_order` = \''.(int)pSQL($id_order).'\'
ORDER BY `date_scheduled` ASC
');
}
/**
* return schedule for order, argument reference
* @return array
*/
public static function getByOrderReference($reference)
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'b2b_schedule`
WHERE `id_order` IN (
SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE `reference` = \''.pSQL($reference).'\'
)
ORDER BY `date_scheduled` ASC
');
}
/**
* return schedule to capture for order, argument reference
* @return array|boolean
*/
public static function getOrderScheduleToCapture($reference)
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'b2b_schedule`
WHERE `id_order` IN (
SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE `reference` = \''.pSQL($reference).'\'
)
AND `is_done` = 0 AND `option` = "'.MerchandConfigurationOptions::TYPE_DELIVERY.'"
');
}
/**
* return next schedule for order, argument reference
* @return array|boolean
*/
public static function getNextOrderIdScheduleToCapture($reference)
{
return Db::getInstance()->getValue('
SELECT id_b2b_schedule
FROM `'._DB_PREFIX_.'b2b_schedule`
WHERE `id_order` IN (
SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE `reference` = \''.pSQL($reference).'\'
)
AND `is_done` = 0
ORDER BY `date_scheduled` ASC
');
}
/**
* return schedule to capture for order, argument type capture(defered, ntimes, delivery)
* @return array|boolean
*/
public static function getSchedulesToCapture($module_name, $option = '')
{
$sql = '
SELECT b.`id_b2b_schedule`, o.`id_order`, o.`reference`, b.`transaction_id`, b.`amount`
FROM `'._DB_PREFIX_.'b2b_schedule` b
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = b.`id_order`)
WHERE DATEDIFF(NOW(), `date_scheduled`) >= 0
AND o.`module` = \''.pSQL($module_name).'\'
AND (o.`valid` = 1 OR current_state = '.pSQL(Configuration::get('BE2BILLDEF_OS_PAYMENT')).')
AND b.`is_done` = 0
';
if ($option) {
$sql .=' AND b.option = "'.pSQL($option).'"';
}
return Db::getInstance()->ExecuteS($sql);
}
/**
* return payment schedule for order
* @return array
*/
public static function getPaymentSchedule($amount, $id_account = 0)
{
$nb_times = (int)MerchandConfigurationOptions::getAccountOptionsParameterValue(
$id_account,
MerchandConfigurationOptions::TYPE_NTIMES
);
$schedule = array();
$splited_amount = $amount/$nb_times;
// if non integer amount
if (!is_int($splited_amount)) {
// first time
$first_amount = (int)$splited_amount + $nb_times * ($splited_amount-(int)$splited_amount);
// other times
$next_amounts = (int)$splited_amount;
} else {
$first_amount = $next_amounts = $splited_amount;
}
/*
* compute dates
*/
for ($i = 0; $i < $nb_times; $i++) {
switch($i) {
case 0:
// date du jour
$o_today = new DateTime();
$schedule[$o_today->format('Y-m-d')] = $first_amount;
break;
case 1:
case 2:
// date of the day
$o_today = new DateTime();
$s_year = $o_today->format('Y');
$s_month = $o_today->format('n');
$s_day = $o_today->format('d');
// calcul
$s_year += floor($i/12);
$i = $i%12;
$s_month += $i;
if ($s_month > 12) {
$s_year ++;
$s_month = $s_month % 12;
if ($s_month === 0) {
$s_month = 12;
}
}
if (!checkdate($s_month, $s_day, $s_year)) {
$o_new_date = DateTime::createFromFormat('Y-n-j', $s_year.'-'.$s_month.'-1');
$o_new_date->modify('last day of');
} else {
$o_new_date = DateTime::createFromFormat('Y-n-d', $s_year.'-'.$s_month.'-'.$s_day);
}
$o_new_date->setTime($o_today->format('H'), $o_today->format('i'), $o_today->format('s'));
$schedule[$o_new_date->format('Y-m-d')] = $next_amounts;
break;
case 3:
// date of the day
$o_today = new DateTime();
$schedule[$o_today->modify('+89 day')->format('Y-m-d')] = $next_amounts;
break;
}
}
return $schedule;
}
/**
* Returns schedule array from old tables or false
* @param none
* @return boolean|string
*/
public static function getOldList()
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'be2bill_schedule`
');
}
}

View File

@ -0,0 +1,279 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billTransaction extends ObjectModel
{
const TYPE_PAYMENT = 'payment';
const TYPE_AUTHORIZATION = 'authorization';
const TYPE_CAPTURE = 'capture';
const TYPE_REFUND = 'refund';
/**
* Be2bill Transaction ID
* @var integer
*/
public $id_b2b_transaction;
/**
* Order ID
* @var integer
*/
public $id_order;
/**
* Order Slip ID
* @var integer
*/
public $id_order_slip;
/**
* TRANSACTIONID parameter send by the payment platform
* @var string
*/
public $transaction_id;
/**
* OPERATIONTYPE parameter send by the payment platform
* @var string
*/
public $transaction_type;
/**
* AMOUNT parameter send by the payment platform
* @var float
*/
public $amount;
/**
* AMOUNT parameter send by the payment platform
* @var float
*/
public $id_merchand_account;
/**
* Object creation date
* @var date
*/
public $date_add;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'b2b_transaction',
'primary' => 'id_b2b_transaction',
'fields' => array(
'id_order' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
'required' => true
),
'id_order_slip' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
),
'transaction_id' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'transaction_type' => array(
'type' => self::TYPE_STRING,
'validate' => 'isString',
'required' => true
),
'amount' => array(
'type' => self::TYPE_FLOAT,
'validate' => 'isFloat',
'required' => true
),
'id_merchand_account' => array(
'type' => self::TYPE_INT,
'validate' => 'isInt',
),
'date_add' => array(
'type' => self::TYPE_DATE,
'validate' => 'isDate')
)
);
/**
* Create Transaction table
* @return boolean
*/
public static function createBe2billTransactionTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_transaction` (
`id_b2b_transaction` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_order` INT(10) UNSIGNED NOT NULL,
`id_order_slip` INT(10) UNSIGNED DEFAULT 0,
`transaction_id` VARCHAR(25) NOT NULL,
`transaction_type` VARCHAR(25) NOT NULL,
`amount` DECIMAL(17,2) NOT NULL,
`id_merchand_account` INT(10) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_b2b_transaction`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
return Db::getInstance()->execute($sql);
}
/**
* Get transaction by TRANSACTIONID parameter
* @param string $transaction_id
* @return array|boolean
*/
public static function getByTransactionId($transaction_id)
{
return Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'b2b_transaction`
WHERE `transaction_id` = \''.pSQL($transaction_id).'\'
');
}
/**
* Get transaction by TRANSACTIONID parameter
* @param string $transaction_id
* @return array|boolean
*/
public static function getMerchandAccountIdByTransactionId($transaction_id)
{
return Db::getInstance()->getValue('
SELECT id_merchand_account
FROM `'._DB_PREFIX_.'b2b_transaction`
WHERE `transaction_id` = \''.pSQL($transaction_id).'\'
');
}
/**
* Get transaction by TRANSACTIONID parameter
* @param string $order_id
* @return array|boolean
*/
public static function getMerchandAccountIdByOrderId($order_id)
{
return Db::getInstance()->getValue('
SELECT id_merchand_account
FROM `'._DB_PREFIX_.'b2b_transaction`
WHERE `id_order` = \''.pSQL($order_id).'\'
');
}
/**
* Get refundable transaction for the order
* @param int $id_order
* @return array|boolean
*/
public static function getOrderRefundableTransaction($reference)
{
return Db::getInstance()->executeS('
SELECT bt.*
FROM `'._DB_PREFIX_.'b2b_transaction` bt
LEFT JOIN `'._DB_PREFIX_.'b2b_execcode_history` beh ON (bt.`id_b2b_transaction` = beh.`id_b2b_transaction`)
WHERE bt.`id_order` IN (
SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE `reference` = \''.pSQL($reference).'\'
)
AND (bt.`transaction_type` = \''.pSQL(self::TYPE_PAYMENT).'\'
OR bt.`transaction_type` = \''.pSQL(self::TYPE_CAPTURE).'\')
AND (beh.`id_b2b_execcode` = \'0000\'
OR beh.`id_b2b_execcode` IS NULL)
');
}
/**
* Get refundable slip for the order
* @param int $id_order, int $id_customer
* @return array|boolean
*/
public static function getOrderRefundableSlip($id_order, $id_customer)
{
if (!Validate::isUnsignedId($id_order) || !Validate::isUnsignedId($id_customer)) {
return false;
}
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'order_slip`
WHERE `id_customer` = '.(int)$id_customer.'
AND `id_order` = '.(int)$id_order.'
AND `id_order_slip` NOT IN (
SELECT bt.`id_order_slip`
FROM `'._DB_PREFIX_.'b2b_transaction` bt
LEFT JOIN `'._DB_PREFIX_.'b2b_execcode_history` beh ON (bt.`id_b2b_transaction` = beh.`id_b2b_transaction`)
WHERE bt.`id_order` = \''.pSQL($id_order).'\'
AND bt.`transaction_type` = \''.pSQL(self::TYPE_REFUND).'\'
AND beh.`id_b2b_execcode` = \'0000\'
)
ORDER BY `date_add` DESC
');
}
/**
* Get transaction by order ID where transaction type is refund
* @param int $id_order
* @return array|boolean
*/
public static function getOrderRefundedTransaction($id_order)
{
if (!Validate::isUnsignedId($id_order)) {
return false;
}
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'b2b_transaction`
WHERE `id_order` = \''.pSQL($id_order).'\'
AND `transaction_type` = \''.pSQL(self::TYPE_REFUND).'\'
');
}
/**
* Get transaction and execcode history by order reference
* @param string $reference
* @return array|boolean
*/
public static function getOrderTransactionHistory($reference)
{
return Db::getInstance()->executeS('
SELECT bt.*, be.`id_b2b_execcode` execcode, be.`message`
FROM `'._DB_PREFIX_.'b2b_transaction` bt
LEFT JOIN `'._DB_PREFIX_.'b2b_execcode_history` beh ON (bt.`id_b2b_transaction` = beh.`id_b2b_transaction`)
LEFT JOIN `'._DB_PREFIX_.'b2b_execcode` be ON (beh.`id_b2b_execcode` = be.`id_b2b_execcode`)
WHERE bt.`id_order` IN (
SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE `reference` = \''.pSQL($reference).'\'
)
ORDER BY beh.`date_add` ASC
');
}
/**
* Returns transaction array from old tables or false
* @param none
* @return boolean|string
*/
public static function getOldList()
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'be2bill_transaction`
');
}
}

View File

@ -0,0 +1,495 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billXml
{
/**
* create xml table for module
* @param int $id_order
* @return boolean
*/
public static function createBe2billXmlTables()
{
/* Table b2b_xml_modes_lang */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_modes_lang` (
`b2b_xml_mode_code` VARCHAR(255) NOT NULL,
`lang_iso` VARCHAR(2) NOT NULL,
`name` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_modes_lang` (`b2b_xml_mode_code` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_operation_lang */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_operation_lang` (
`b2b_xml_operation_code` VARCHAR(255) NOT NULL,
`lang_iso` VARCHAR(2) NOT NULL,
`name` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_operation_lang` (`b2b_xml_operation_code` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_options */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_options` (
`b2b_xml_option_code` VARCHAR(255) NOT NULL,
`b2b_xml_parameter_name` VARCHAR(255) NOT NULL,
`b2b_xml_parameter_type` ENUM("REQUIRED", "ABSENT") NOT NULL,
`b2b_xml_parameter_value` ENUM("YES", "NO", "REQUIRED") NOT NULL,
INDEX `b2b_xml_options` (`b2b_xml_option_code` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_options_lang */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_options_lang` (
`b2b_xml_option_code` VARCHAR(255) NOT NULL,
`lang_iso` VARCHAR(2) NOT NULL,
`name` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_options_lang` (`b2b_xml_option_code` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_types */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_types` (
`b2b_xml_account_type_code` VARCHAR(255) NOT NULL,
`b2b_xml_account_type_logo` VARCHAR(255) NOT NULL,
PRIMARY KEY (`b2b_xml_account_type_code`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_lang */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_lang` (
`b2b_xml_account_type_code` VARCHAR(255) NOT NULL,
`lang_iso` VARCHAR(2) NOT NULL,
`name` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_account_type_lang` (`b2b_xml_account_type_code` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_currency */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_currency` (
`b2b_xml_account_type_code` VARCHAR(255) NOT NULL,
`currency_iso` VARCHAR(3) NOT NULL,
INDEX `idx_b2b_xml_account_type_currency` (`b2b_xml_account_type_code` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_parameter_set */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` (
`id_b2b_xml_account_type_parameter_set` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`b2b_xml_account_type_parameter_set_version` VARCHAR(255) NOT NULL,
`b2b_xml_account_type_parameter_set_logo` VARCHAR(255) NOT NULL,
`b2b_xml_account_type_code` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id_b2b_xml_account_type_parameter_set`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_countries */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries` (
`id_b2b_xml_account_type_parameter_set` INT(10) NOT NULL,
`country_iso` VARCHAR(2) NOT NULL,
INDEX `idx_b2b_xml_account_type_countries` (`id_b2b_xml_account_type_parameter_set` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_mode */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_mode` (
`id_b2b_xml_account_type_parameter_set` INT(10) NOT NULL,
`b2b_xml_mode_code` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_account_type_parameter_set_mode` (`id_b2b_xml_account_type_parameter_set` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_parameter_set_operation */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` (
`id_b2b_xml_account_type_parameter_set` INT(10) NOT NULL,
`b2b_xml_operation_code` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_account_type_parameter_set_operation` (`id_b2b_xml_account_type_parameter_set` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_parameter_set_parameters */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters` (
`id_b2b_xml_account_type_parameter_set` INT(10) NOT NULL,
`b2b_xml_parameter_name` VARCHAR(255) NOT NULL,
`b2b_xml_parameter_type` ENUM("REQUIRED", "ABSENT") NOT NULL,
`b2b_xml_parameter_value` ENUM("YES", "NO", "REQUIRED") NOT NULL,
`b2b_xml_parameter_merchant_hash` varchar(255) NOT NULL DEFAULT "YES",
INDEX `idx_b2b_xml_account_type_parameter_set_parameters` (`id_b2b_xml_account_type_parameter_set` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_xml_account_type_parameter_set_options */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_options` (
`id_b2b_xml_account_type_parameter_set` INT(10) NOT NULL,
`b2b_xml_option` VARCHAR(255) NOT NULL,
INDEX `idx_b2b_xml_account_type_parameter_set_options` (`id_b2b_xml_account_type_parameter_set` ASC))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_merchand_configuration_account */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_merchand_configuration_account` (
`id_b2b_merchand_configuration_account` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`b2b_xml_account_type_code` VARCHAR(255) NOT NULL,
`b2b_xml_mode_code` VARCHAR(255) NOT NULL,
`currency_iso` VARCHAR(3) NOT NULL,
`login_account` VARCHAR(255) NOT NULL,
`logo_url` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`active` TINYINT(1) NOT NULL,
PRIMARY KEY (`id_b2b_merchand_configuration_account`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_merchand_configuration_account_options */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_merchand_configuration_account_options` (
`id_b2b_merchand_configuration_account_options` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_b2b_merchand_configuration_account` INT(10) NOT NULL,
`b2b_xml_option` VARCHAR(255) NOT NULL,
`min_amount` decimal(13,6) NOT NULL DEFAULT "0.000000",
`max_amount` decimal(13,6) NOT NULL DEFAULT "0.000000",
`b2b_xml_option_extra` VARCHAR(255) NOT NULL,
`active` TINYINT(1) NOT NULL,
PRIMARY KEY (`id_b2b_merchand_configuration_account_options`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_merchand_configuration_account_shop */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_merchand_configuration_account_shop` (
`id_b2b_merchand_configuration_account` INT(10) NOT NULL,
`id_shop` INT(11) NOT NULL,
PRIMARY KEY (`id_b2b_merchand_configuration_account`,`id_shop`),
KEY `id_shop` (`id_shop`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_merchand_configuration_account_lang */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_merchand_configuration_account_lang` (
`id_b2b_merchand_configuration_account` INT(10) NOT NULL,
`id_shop` INT(11) NOT NULL,
`id_lang` INT(11) NOT NULL,
`name` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`id_lang`,`id_shop`,`id_b2b_merchand_configuration_account`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
/* Table b2b_account_configuration_countries */
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'b2b_merchand_configuration_account_countries` (
`id_b2b_merchand_configuration_account_countries` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_b2b_merchand_configuration_account` INT(10) NOT NULL,
`country_iso` VARCHAR(2) NOT NULL,
PRIMARY KEY (`id_b2b_merchand_configuration_account_countries`))
ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';
Db::getInstance()->execute($sql);
return true;
}
/**
* insert xml data to xml table
* @return boolean
*/
public static function insertXmlToDb()
{
if (Tools::file_get_contents(Configuration::getGlobalValue('BE2BILL_URL_XML'))) {
self::resetBe2billXmlTables();
$xml_payments = simplexml_load_string(Tools::file_get_contents(Configuration::getGlobalValue('BE2BILL_URL_XML')));
Configuration::updateGlobalValue('BE2BILL_XML_VERSION', $xml_payments->version);
// installing modes
$modes = $xml_payments->modes;
foreach ($modes->mode as $mode) {
$code = $mode->code;
foreach ($mode->labels->children() as $label) {
$name = (string)$label;
$lang_iso = (string)$label['language'];
// insert in db for each language
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_modes_lang`(`b2b_xml_mode_code`,`lang_iso`,`name`)
VALUES("'.pSQL($code).'","'.pSQL($lang_iso).'","'.pSQL($name).'")';
Db::getInstance()->execute($sql);
}
}
// installing operations
$operations = $xml_payments->operations;
foreach ($operations->operation as $operation) {
$code = $operation->code;
foreach ($operation->labels->children() as $label) {
$name = (string)$label;
$lang_iso = (string)$label['language'];
// insert in db for each language
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_operation_lang`
(`b2b_xml_operation_code`,`lang_iso`,`name`)
VALUES("'.pSQL($code).'","'.pSQL($lang_iso).'","'.pSQL($name).'")';
Db::getInstance()->execute($sql);
}
}
// installing options
$options = $xml_payments->options;
foreach ($options->option as $option) {
$code = $option->code;
foreach ($option->labels->children() as $label) {
$name = (string)$label;
$lang_iso = (string)$label['language'];
// insert in db for each language
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_options_lang`(`b2b_xml_option_code`,`lang_iso`,`name`)
VALUES("'.pSQL($code).'","'.pSQL($lang_iso).'","'.pSQL($name).'")';
Db::getInstance()->execute($sql);
}
// setting options parameters
$parameters = $option->parameters;
foreach ($parameters->parameter as $param) {
foreach ($param->children() as $parameter) {
$parameter_name = $parameter->getname();
if ($parameter_name != 'code') {
$type = Tools::strtoupper((string)$parameter_name);
$value = Tools::strtoupper((string)$parameter);
} else {
$code_parameter = (string)$parameter;
}
}
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_options`
(`b2b_xml_option_code`,`b2b_xml_parameter_name`,
`b2b_xml_parameter_type`,`b2b_xml_parameter_value`)
VALUES ("'.pSQL($code).'","'.pSQL($code_parameter).'",
"'.pSQL($type).'","'.pSQL($value).'")';
Db::getInstance()->execute($sql);
}
}
// installing account_types
$account_types = $xml_payments->account_types;
foreach ($account_types->account_type as $account_type) {
$code = $account_type->code;
$logo_url = $account_type->logo_url;
// insert base struture
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_types`
(`b2b_xml_account_type_code`,`b2b_xml_account_type_logo`)
VALUES("'.pSQL($code).'","'.pSQL($logo_url).'")';
Db::getInstance()->execute($sql);
// insert language
foreach ($account_type->labels->children() as $label) {
$name = (string)$label;
$lang_iso = (string)$label['language'];
// insert in db for each language
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_lang`
(`b2b_xml_account_type_code`,`lang_iso`,`name`)
VALUES("'.pSQL($code).'","'.pSQL($lang_iso).'","'.pSQL($name).'")';
Db::getInstance()->execute($sql);
}
// insert currencies allowed
foreach ($account_type->currencies->children() as $currencie) {
$currency_iso = (string)$currencie;
// insert in db for each currency
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_currency`
(`b2b_xml_account_type_code`,`currency_iso`)
VALUES("'.pSQL($code).'","'.pSQL($currency_iso).'")';
Db::getInstance()->execute($sql);
}
// setting options parameters
$parameter_sets = $account_type->parameter_sets;
foreach ($parameter_sets->parameter_set as $parameter_set) {
$api_version = $parameter_set->be2bill_api_version;
$logo_url = $parameter_set->logo_url;
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` (
`b2b_xml_account_type_parameter_set_version`,`b2b_xml_account_type_parameter_set_logo`,
`b2b_xml_account_type_code`)
VALUES ("'.pSQL($api_version).'","'.pSQL($logo_url).'","'.pSQL($code).'")';
Db::getInstance()->execute($sql);
// get parameter_set id
$id_parameter_set = Db::getInstance()->Insert_ID();
// setting parameter set options
$options = $parameter_set->options;
foreach ($options->children() as $option) {
$parameter_option = (string)$option;
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_options`
(`id_b2b_xml_account_type_parameter_set`,
`b2b_xml_option`) VALUES ('.(int)$id_parameter_set.',"'.pSQL($parameter_option).'")';
Db::getInstance()->execute($sql);
}
// setting parameter set operations
$operations = $parameter_set->operations;
foreach ($operations->children() as $operation) {
$parameter_operation = (string)$operation;
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation`
(`id_b2b_xml_account_type_parameter_set`,
`b2b_xml_operation_code`) VALUES ('.(int)$id_parameter_set.',"'.pSQL($parameter_operation).'")';
Db::getInstance()->execute($sql);
}
// insert mode allowed
$modes = $parameter_set->modes;
foreach ($modes->children() as $mode) {
$mode = (string)$mode;
// insert in db for each mode
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_mode`
(`id_b2b_xml_account_type_parameter_set`,`b2b_xml_mode_code`)
VALUES('.(int)$id_parameter_set.',"'.pSQL($mode).'")';
Db::getInstance()->execute($sql);
}
// setting allowed countries for parameter set
$allowed_countries = $parameter_set->countries;
foreach ($allowed_countries->children() as $allowed_country) {
$country = (string)$allowed_country;
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries`
(`id_b2b_xml_account_type_parameter_set`,
`country_iso`) VALUES ('.(int)$id_parameter_set.',"'.pSQL($country).'")';
Db::getInstance()->execute($sql);
}
// setting options parameters
$parameters = $parameter_set->parameters;
foreach ($parameters->parameter as $param) {
foreach ($param->children() as $parameter) {
$merchant_hash = 'YES';
$parameter_name = $parameter->getname();
if ($parameter_name == 'merchant_hash') {
$merchant_hash = Tools::strtoupper((string)$parameter);
}
else if ($parameter_name != 'code') {
$type = Tools::strtoupper((string)$parameter_name);
$value = Tools::strtoupper((string)$parameter);
} else {
$code_parameter = (string)$parameter;
}
}
$sql = 'INSERT INTO `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters`
(`id_b2b_xml_account_type_parameter_set`,
`b2b_xml_parameter_name`,`b2b_xml_parameter_type`,`b2b_xml_parameter_value`,`b2b_xml_parameter_merchant_hash`)
VALUES ('.(int)$id_parameter_set.',"'.pSQL($code_parameter).'","'.pSQL($type).'","'.pSQL($value).'","'.pSQL($merchant_hash).'")';
Db::getInstance()->execute($sql);
}
}
}
return true;
}
return false;
}
/**
* check if xml tables need to be upgraded
* @return boolean
*/
public static function paymentsNeedUpgrade()
{
$xml_payments = simplexml_load_string(Tools::file_get_contents(Configuration::getGlobalValue('BE2BILL_URL_XML')));
$version = $xml_payments->version;
if (Configuration::getGlobalValue('BE2BILL_XML_VERSION') != $version) {
return true;
}
return false;
}
/**
* uninstall xml tables
* @return boolean
*/
public static function uninstallBe2billXmlTables()
{
$sql = 'DROP TABLE `'._DB_PREFIX_.'b2b_merchand_configuration_account_countries`,
`'._DB_PREFIX_.'b2b_merchand_configuration_account`,
`'._DB_PREFIX_.'b2b_merchand_configuration_account_options`, `'._DB_PREFIX_.'b2b_xml_account_types`,
`'._DB_PREFIX_.'b2b_merchand_configuration_account_shop`,`'._DB_PREFIX_.'b2b_merchand_configuration_account_lang`,
`'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries`, `'._DB_PREFIX_.'b2b_xml_account_type_currency`,
`'._DB_PREFIX_.'b2b_xml_account_type_lang`, `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_mode`,
`'._DB_PREFIX_.'b2b_xml_account_type_parameter_set`, `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation`,
`'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_options`,
`'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters`,
`'._DB_PREFIX_.'b2b_xml_modes_lang`, `'._DB_PREFIX_.'b2b_xml_operation_lang`, `'._DB_PREFIX_.'b2b_xml_options`,
`'._DB_PREFIX_.'b2b_xml_options_lang`;';
return Db::getInstance()->execute($sql);
}
/**
* Truncate xml tables
* @return boolean
*/
public static function resetBe2billXmlTables()
{
$sql = 'TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_types`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_currency`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_lang`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_mode`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_options`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_modes_lang`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_operation_lang`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_options`;
TRUNCATE `'._DB_PREFIX_.'b2b_xml_options_lang`;';
return Db::getInstance()->execute($sql);
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2015 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2015 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,81 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billPaymentModuleFrontController extends ModuleFrontController
{
public $ssl = true;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
$this->display_column_left = false;
$this->display_column_right = false;
parent::initContent();
$cart = $this->context->cart;
if (!$this->module->checkCurrency($cart)) {
Tools::redirect('index.php?controller=order');
}
// Get current customer alias object
$alias = Be2billAlias::getByIdCustomer((int)$this->context->customer->id, (int)Tools::getValue('id_account'));
$merchand_account = new MerchandConfiguration((int)Tools::getValue('id_account'));
$has_oneclick = MerchandConfigurationOptions::getOneClick((int)Tools::getValue('id_account'));
$use_oneclick_cvv = MerchandConfigurationOptions::getOneClickCvv((int)Tools::getValue('id_account'));
$has_alias_setting = Be2BillApi::getCreateAliasByAccountType($merchand_account->b2b_xml_account_type_code);
$operation_code = (Tools::getValue('operation_code'));
$has_ident_doc_id = (int) Tools::getValue('has_ident_doc_id') ;
$option_name = (Tools::getValue('option_name'));
$amex = 0;
if ($merchand_account->b2b_xml_account_type_code == "American Express") {
$amex = 1;
}
$this->context->smarty->assign(array(
'module_display_name' => $this->module->displayName,
'has_alias' => ($alias) ? true : false,
'card_number' => ($alias) ? $alias['card_number'] : '',
'nb_products' => $cart->nbProducts(),
'total' => $cart->getOrderTotal(true, Cart::BOTH),
'id_account' => (int)Tools::getValue('id_account'),
'option_code' => Tools::getValue('option_code'),
'has_oneclick' => $has_oneclick,
'use_oneclick_cvv' => $use_oneclick_cvv,
'has_alias_setting' => $has_alias_setting,
'operation_code' => $operation_code,
'option_name' => $option_name,
'amex' => $amex,
'has_ident_doc_id' => $has_ident_doc_id,
));
$this->setTemplate('payment_execution.tpl');
}
public function postProcess()
{
// Is required CVV empty?
if ((int)Tools::getValue('empty_cvv')) {
$this->errors[] = $this->module->l('Card cryptogram is required.');
}
// Is required CVV wrongly formatted?
if ((int)Tools::getValue('false_cvv')) {
$this->errors[] = $this->module->l('Card cryptogram wrongly formatted.');
}
}
}

View File

@ -0,0 +1,140 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
require_once(_PS_MODULE_DIR_.'be2bill/classes/Be2billApi.php');
require_once(_PS_MODULE_DIR_.'be2bill/classes/Be2billTransaction.php');
class Be2billRedirectionModuleFrontController extends ModuleFrontController
{
public $ssl = true;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
$this->display_column_left = false;
$this->display_column_right = false;
$id_account = (int) Tools::getValue('id_account');
$identification = null;
if (Tools::getValue('be2bill_identification')){
$identification = Tools::getValue('be2bill_identification');
}
$option_code = Tools::getValue('option_code');
$display_create_alias = true;
if (Tools::getValue('be2bill_create_alias')) {
$display_create_alias = false;
}
$display_mode = MerchandConfiguration::getDisplayMode($id_account);
$use_iframe = false;
if ($display_mode == MerchandConfiguration::MODE_FORMIFRAME) {
$use_iframe = true;
}
if ($display_mode == MerchandConfiguration::MODE_SUBMIT) {
$server_url = $this->getServerUrl(false, true);
} else {
$server_url = $this->getServerUrl();
}
if ($use_iframe) {
$this->display_column_right = false;
$this->display_header = false;
$this->display_footer = false;
}
parent::initContent();
$this->context->smarty->assign(array(
'module_display_name' => $this->module->displayName,
'server_url' => $server_url,
'form_parameters' => $this->getFormParameters($id_account, $option_code, $display_create_alias, $identification),
'use_iframe' => $use_iframe,
'id_account' => $id_account,
'option_code' => $option_code,
));
$this->setTemplate('redirection.tpl');
}
protected function getFormParameters($id_account, $option_code, $display_create_alias , $identification = null)
{
// Get reference
$reference = Be2billOrderReference::getReferenceByCartId(Context::getContext()->cart->id);
$id_customer = Context::getContext()->cart->id_customer;
$merchand_account = new MerchandConfiguration($id_account);
$params_no_hash = array();
// get Be2Bill account paramaters
$params = MerchandConfiguration::getDefaultParameters($reference, $id_account, $option_code, 0 , $params_no_hash);
if($identification != null){
$params['IDENTIFICATIONDOCID'] = $identification;
}
// get options parameters
$params = MerchandConfigurationOptions::setOptionsParameters($option_code, $params, $id_account);
$extra_options = MerchandConfigurationOptions::getExtraOptions($id_account);
$amount = Context::getContext()->cart->getOrderTotal(true);
if ($extra_options && is_array($extra_options)) {
foreach ($extra_options as $extra) {
$available = true;
if ($extra['b2b_xml_option'] == MerchandConfigurationOptions::TYPE_3DSECURE) {
if ((float)$extra['min_amount'] && $amount < (float)$extra['min_amount']) {
$available = false;
}
if ((float)$extra['max_amount'] && $amount > (float)$extra['max_amount']) {
$available = false;
}
}
if ($available) {
$params = MerchandConfigurationOptions::setOptionsParameters(
$extra['b2b_xml_option'],
$params,
$id_account
);
}
}
}
// need to display create alias ?
if (Be2BillApi::getCreateAliasByAccountType($merchand_account->b2b_xml_account_type_code)) {
if ($display_create_alias || Configuration::getGlobalValue('BE2BILL_REDIRECT_PAYMENT')) {
$params = MerchandConfigurationOptions::setOptionsParameters(
MerchandConfigurationOptions::TYPE_DISPLAYCREATEALIAS,
$params,
$id_account
);
}
}
// Define specific payment parameters
$params['EXTRADATA'] = 'be2bill-'.$id_account.'-'.$option_code;
$params['HASH'] = Be2billApi::buildHash($params, $id_account, $params_no_hash);
ksort($params);
return $params;
}
protected function getServerUrl($arg = false, $is_submit = false)
{
$available_urls = Be2billApi::getAvailableUrls($arg, $is_submit);
$server_url = (isset($available_urls['main'])) ? $available_urls['main'] : $available_urls['slave'];
return $server_url;
}
}

View File

@ -0,0 +1,59 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billReorderModuleFrontController extends ModuleFrontController
{
public $ssl = true;
/**
* @see ModuleFrontController::postProcess()
*/
public function postProcess()
{
// If the cart is not empty, we redirect to order STEP
$products = $this->context->cart->getProducts();
if (!empty($products)) {
Tools::redirect('index.php?controller=order&step=0');
}
// Reorder
$order = new Order((int)Tools::getValue('id_order'));
$this->reorder((int)$order->id, (int)$order->id_customer);
// Redirect into order
Tools::redirect('index.php?controller=order&step=0');
}
protected function reorder($id_order, $id_customer)
{
if (!(bool)$id_order || !(bool)$id_customer) {
return false;
}
$old_cart = new Cart(Order::getCartIdStatic($id_order, $id_customer));
$duplication = $old_cart->duplicate();
if (!$duplication || !Validate::isLoadedObject($duplication['cart'])) {
$this->errors[] = Tools::displayError('Sorry. We cannot renew your order.');
} elseif (!$duplication['success']) {
$this->errors[] = Tools::displayError(
'Some items are no longer available, and we are unable to renew your order.'
);
} else {
$this->context->cookie->id_cart = $duplication['cart']->id;
$this->context->cookie->write();
}
}
}

View File

@ -0,0 +1,301 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
require_once(_PS_MODULE_DIR_.'be2bill/classes/Be2billApi.php');
class Be2billSubmitModuleFrontController extends ModuleFrontController
{
public $ssl = true;
public $available_urls;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
$this->display_column_left = false;
$this->display_column_right = false;
parent::initContent();
$this->context->smarty->assign(array(
'module_name' => $this->module->name,
'module_display_name' => $this->module->displayName,
'url_params' => $this->getRedirectionParameters()
));
$this->setTemplate('order_payment.tpl');
}
public function postProcess()
{
// Is required CVV empty?
if (!(int)Tools::getValue('be2bill_cvv') &&
Tools::getValue('option_code') == 'oneclick' &&
!(int)Tools::getValue('use_oneclick_cvv')) {
$params = array(
'empty_cvv' => true,
'id_account' => (int) Tools::getValue('id_account'),
'option_code' => Tools::getValue('option_code'),
'operation_code' => Tools::getValue('operation_code'),
'option_name' => Tools::getValue('option_name'),
'use_oneclick_cvv' => (int)Tools::getValue('use_oneclick_cvv')
);
$link = new Link();
Tools::redirectLink($link->getModuleLink('be2bill', 'payment', $params, true));
}
// Is required CVV wrongly formatted?
if (Tools::getValue('be2bill_cvv')) {
$value_cvv = (int)Tools::getValue('be2bill_cvv');
$required = 3;
if (Tools::getValue('amex')) {
$required = 4;
}
if (Tools::strlen($value_cvv) != (int)$required) {
$params = array(
'false_cvv' => true,
'id_account' => (int) Tools::getValue('id_account'),
'option_code' => Tools::getValue('option_code'),
'operation_code' => Tools::getValue('operation_code'),
'option_name' => Tools::getValue('option_name'),
'use_oneclick_cvv' => (int)Tools::getValue('use_oneclick_cvv')
);
$link = new Link();
Tools::redirectLink($link->getModuleLink('be2bill', 'payment', $params, true));
}
}
// Is Identification Doc Id required
if (Tools::getValue('be2bill_identification')) {
$value = Tools::getValue('be2bill_identification');
$required = 8;
if (Tools::strlen($value) < $required) {
$params = array(
'id_account' => (int) Tools::getValue('id_account'),
'option_code' => Tools::getValue('option_code'),
'operation_code' => Tools::getValue('operation_code'),
'option_name' => Tools::getValue('option_name'),
'use_oneclick_cvv' => (int)Tools::getValue('use_oneclick_cvv'),
'has_ident_doc_id' => 1
);
$link = new Link();
Tools::redirectLink($link->getModuleLink('be2bill', 'payment', $params, true));
}
}
$cart = $this->context->cart;
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0
|| $cart->id_address_invoice == 0 || !$this->module->active) {
Tools::redirect('index.php?controller=order&step=1');
}
// Check that payment option is available in case the customer changed his address before end of checkout process
$authorized = false;
foreach (Module::getPaymentModules() as $module) {
if ($module['name'] == $this->module->name) {
$authorized = true;
break;
}
}
if (!$authorized) {
die($this->module->l('This payment method is not available.', 'validation'));
}
$customer = new Customer($cart->id_customer);
if (!Validate::isLoadedObject($customer)) {
Tools::redirect('index.php?controller=order&step=1');
}
$this->available_urls = Be2billApi::getAvailableUrls(false);
if (count($this->available_urls)) {
// Generate the futur reference
$reference = Order::generateReference();
if (!empty($reference)) {
$reference = Be2billOrderReference::addCartReference($cart->id, $reference);
}
// Set logged customer by cookie information
$this->context->customer->logged = $this->context->cookie->logged;
$id_account = (int) Tools::getValue('id_account');
$option_code = Tools::getValue('option_code');
// Oneclick payment
if (Tools::getValue('option_code') == 'oneclick') {
$operation = Tools::getValue('operation_code');
$params_no_hash = array();
// get Be2Bill account paramaters
$params = MerchandConfiguration::getDefaultParameters($reference, $id_account, $operation, 0, $params_no_hash);
// get options parameters
$params = MerchandConfigurationOptions::setOptionsParameters($option_code, $params, $id_account);
if (Tools::getValue('be2bill_cvv')) {
$params['CARDCVV'] = Tools::getValue('be2bill_cvv');
}
/* todo put this exlcude in xml */
if (isset($params['CREATEALIAS'])) {
unset($params['CREATEALIAS']);
}
if (isset($params['HIDECLIENTEMAIL'])) {
unset($params['HIDECLIENTEMAIL']);
}
if (isset($params['HIDECARDFULLNAME'])) {
unset($params['HIDECARDFULLNAME']);
}
// Payment transaction
// Define specific payment parameters
if (Tools::getValue('option_name') == MerchandConfigurationOptions::TYPE_DEFERED) {
$params['EXTRADATA'] = 'be2bill-'.$id_account.'-'.MerchandConfigurationOptions::TYPE_DEFERED;
} elseif (Tools::getValue('option_name') == MerchandConfigurationOptions::TYPE_DELIVERY) {
$params['EXTRADATA'] = 'be2bill-'.$id_account.'-'.MerchandConfigurationOptions::TYPE_DELIVERY;
} else {
$params['EXTRADATA'] = 'be2bill-'.$id_account.'-'.$option_code;
}
$params['HASH'] = Be2billApi::buildHash($params, $id_account,$params_no_hash);
ksort($params);
// Send oneclick transaction
$result = Be2billApi::sendToServer($operation, $params);
if (!isset($result['ORDERID'])) {
$result['ORDERID'] = $reference;
}
if (!isset($result['EXTRADATA'])) {
$result['EXTRADATA'] = 'be2bill-'.$id_account.'-'.$option_code;
}
$link = new Link();
Tools::redirectLink($link->getModuleLink('be2bill', 'validation', $result, true));
}
// directlink only mode
if (Tools::getValue('payment_mode') == MerchandConfiguration::MODE_DIRECT) {
switch (Tools::getValue('option_code')) {
case MerchandConfigurationOptions::TYPE_STANDARD:
$operation = MerchandConfiguration::TYPE_PAYMENT;
break;
case MerchandConfigurationOptions::TYPE_DEFERED:
$operation = MerchandConfiguration::TYPE_AUTHORIZATION;
break;
case MerchandConfigurationOptions::TYPE_DELIVERY:
$operation = MerchandConfiguration::TYPE_AUTHORIZATION;
break;
default:
$operation = MerchandConfiguration::TYPE_PAYMENT;
break;
}
// get Be2Bill account paramaters
$params = $this->getAccountParameters($reference, $id_account, $option_code);
// Send oneclick transaction
if ($operation) {
$result = Be2billApi::sendToServer($operation, $params);
}
$link = new Link();
if ($result) {
if (!isset($result['ORDERID'])) {
$result['ORDERID'] = $reference;
}
if (!isset($result['EXTRADATA'])) {
$result['EXTRADATA'] = 'be2bill-'.$id_account.'-'.$option_code;
}
// execode 2 need to display payment page (paypal for example)
if ($result['EXECCODE'] == '0002') {
echo base64_decode($result['REDIRECTHTML']);
die();
}
Tools::redirectLink($link->getModuleLink('be2bill', 'validation', $result, true));
} else {
$params = array(
'empty_cvv' => false,
'id_account' => (int) Tools::getValue('id_account'),
'option_code' => Tools::getValue('option_code'),
'use_oneclick_cvv' => (int)Tools::getValue('use_oneclick_cvv')
);
Tools::redirectLink($link->getModuleLink('be2bill', 'payment', $params, true));
}
}
} else {
$this->context->smarty->assign(array(
'server_unavailable' => true
));
return;
}
// If iFrame not used, redirect to be2bill payment server
$id_account = (int) Tools::getValue('id_account');
$display_mode = MerchandConfiguration::getDisplayMode($id_account);
$use_iframe = false;
if ($display_mode == MerchandConfiguration::MODE_FORMIFRAME) {
$use_iframe = true;
}
if (!$use_iframe) {
$link = new Link();
$params = $this->getRedirectionParameters();
if (Tools::getValue('be2bill_identification')) {
$params['be2bill_identification'] = Tools::getValue('be2bill_identification');
}
Tools::redirectLink($link->getModuleLink($this->module->name, 'redirection', $params, true));
}
}
protected function getRedirectionParameters()
{
$server_url = (isset($this->available_urls['main'])) ? $this->available_urls['main'] : $this->available_urls['slave'];
return array(
'server_url' => urlencode($server_url),
'be2bill_create_alias' => Tools::getValue('be2bill_create_alias'),
'id_account' => (int) Tools::getValue('id_account'),
'option_code' => Tools::getValue('option_code'),
);
}
protected function getAccountParameters($reference, $id_account, $option_code)
{
$params_no_hash = array();
// get Be2Bill account paramaters
$params = MerchandConfiguration::getDefaultParameters($reference, $id_account, $option_code , 0 , $params_no_hash);
// get options parameters
$params = MerchandConfigurationOptions::setOptionsParameters($option_code, $params, $id_account);
$extra_options = MerchandConfigurationOptions::getExtraOptions($id_account);
if ($extra_options && is_array($extra_options)) {
foreach ($extra_options as $extra) {
$params = MerchandConfigurationOptions::setOptionsParameters(
$extra['b2b_xml_option'],
$params,
$id_account
);
}
}
// Define specific payment parameters
$params['EXTRADATA'] = 'be2bill-'.$id_account.'-'.$option_code;
$params['HASH'] = Be2billApi::buildHash($params, $id_account,$params_no_hash);
ksort($params);
return $params;
}
}

View File

@ -0,0 +1,133 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class Be2billValidationModuleFrontController extends ModuleFrontController
{
public $ssl = true;
private $cart_id = 0;
private $order_id = 0;
private $customer_id = 0;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
// Get customer
$customer = new Customer($this->customer_id);
// Set the Link Object
$link = new Link();
$this->context->smarty->assign(array(
'confirmation_parameters' => $this->getOrderConfirmationParameters(
(int)$this->cart_id,
(int)$this->order_id,
$customer
),
'link' => $link,
'id_shop' => $this->id_shop
));
$this->setTemplate('validation.tpl');
}
public function postProcess()
{
// Get first order by reference (ORDERID)
$id_cart = Be2billOrderReference::getIdCartByReference(Tools::getValue('ORDERID'));
if (empty($id_cart)) {
$id_cart = Context::getContext()->cart->id;
}
$cart = new Cart((int)$id_cart);
$id_order = Order::getOrderByCartId((int)$cart->id);
// IMPORTANT FOR MULTISHOP
if (empty($id_order)) {
$order = new Order((int)Be2billApi::getOrderByCartId($id_cart, $cart->id_shop));
} else {
$order = new Order((int)$id_order);
}
$this->order_id = (int)$order->id;
$this->id_shop = (int)$order->id_shop;
$this->customer_id = (int)$cart->id_customer;
$this->cart_id = (int)$id_cart;
// Get customer
$customer = new Customer($this->customer_id);
if (!Validate::isLoadedObject($customer)) {
Tools::redirect('index.php?controller=order&step=1');
}
// Reorder if payment error
if (Tools::getValue('EXECCODE') != '0000') {
$this->reorder((int)$this->order_id, (int)$this->customer_id);
$this->errors[] = Tools::getValue('MESSAGE');
}
$account_info = explode('-', Tools::getValue('EXTRADATA'));
$id_account = (int) $account_info[1];
$display = MerchandConfiguration::getDisplayMode($id_account);
if ($display != 'form-iframe') {
// Link
$link = new Link();
$params = $this->getOrderConfirmationParameters((int)$this->cart_id, (int)$this->order_id, $customer);
Tools::redirectLink($link->getPageLink('order-confirmation', true, null, $params, false, $order->id_shop));
}
}
protected function reorder($id_order, $id_customer)
{
if (!(bool)$id_order || !(bool)$id_customer) {
return false;
}
$old_cart = new Cart(Order::getCartIdStatic($id_order, $id_customer));
$duplication = $old_cart->duplicate();
if (!$duplication || !Validate::isLoadedObject($duplication['cart'])) {
$this->errors[] = Tools::displayError('Sorry. We cannot renew your order.');
} elseif (!$duplication['success']) {
$this->errors[] = Tools::displayError(
'Some items are no longer available, and we are unable to renew your order.'
);
} else {
$this->context->cookie->id_cart = $duplication['cart']->id;
$this->context->cookie->write();
}
}
private function getOrderConfirmationParameters($id_cart, $id_order, $customer)
{
$order = new Order((int)$id_order);
if (preg_match('/\bbe2bill ONECLICK\b/i', Tools::getValue('EXTRADATA')) == 1) {
$module = Module::getInstanceByName('be2bill');
} else {
$module = Module::getInstanceByName($order->module);
}
return array(
'id_cart' => (int)$id_cart,
'id_module' => (int)$module->id,
'id_order' => (int)$id_order,
'key' => $customer->secure_key
);
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

51
modules/be2bill/cron.php Normal file
View File

@ -0,0 +1,51 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
parse_str('id_shop=1', $args);
$_GET = array_merge($args, $_GET);
$_SERVER['QUERY_STRING'] = 'id_shop=1';
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/be2bill.php');
$context = Context::getContext();
$shop = $context->shop;
if (!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST'])) {
$_SERVER['HTTP_HOST'] = $shop->domain;
}
if (!isset($_SERVER['SERVER_NAME']) || empty($_SERVER['SERVER_NAME'])) {
$_SERVER['SERVER_NAME'] = $shop->domain;
}
if (!isset($_SERVER['REMOTE_ADDR']) || empty($_SERVER['REMOTE_ADDR'])) {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
$be2bill = new Be2bill();
foreach (Be2billSchedule::getSchedulesToCapture(
$be2bill->name,
MerchandConfigurationOptions::TYPE_DEFERED
) as $schedule) {
$extradata = '';
$id_account = Be2billTransaction::getMerchandAccountIdByOrderId($schedule['id_order']);
Be2billApi::capture(
$schedule['reference'],
$schedule['transaction_id'],
$id_account,
$schedule['amount'],
$extradata
);
}

25
modules/be2bill/index.php Normal file
View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

BIN
modules/be2bill/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,652 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class MerchandConfiguration extends ObjectModel
{
const TYPE_PAYMENT = 'payment';
const TYPE_AUTHORIZATION = 'authorization';
const TYPE_CAPTURE = 'capture';
const TYPE_REFUND = 'refund';
const MODE_FORM = 'form';
const MODE_FORMIFRAME = 'form-iframe';
const MODE_DIRECT = 'directlink';
const MODE_SUBMIT = 'direct-submit';
const MODE_REDIRECT = 'redirect';
public $id_b2b_merchand_configuration_account;
public $b2b_xml_account_type_code;
public $b2b_xml_mode_code;
public $currency_iso;
public $login_account;
public $password;
public $logo_url;
public $name;
public $active;
public static $definition = array(
'table' => 'b2b_merchand_configuration_account',
'primary' => 'id_b2b_merchand_configuration_account',
'multilang' => true,
'multilang_shop' => true,
'fields' => array(
'b2b_xml_account_type_code' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => true,
),
'b2b_xml_mode_code' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => true,
),
'currency_iso' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => true,
),
'login_account' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => true,
'size' => 256
),
'logo_url' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => false,
'size' => 256
),
'password' => array(
'type' => ObjectModel :: TYPE_HTML,
'lang' => false,
//'validate' => 'isGenericName',
'required' => true,
'size' => 256
),
'active' => array(
'type' => self::TYPE_BOOL,
'validate' => 'isBool',
),
/* Lang fields */
'name' => array(
'type' => self::TYPE_STRING,
'lang' => true,
'validate' => 'isGenericName',
'required' => true,
'size' => 128
),
)
);
/**
* return available payment in front for customer
* @return array|boolean
*/
public static function getAvailablePayments($iso_currency, $iso_country, $amount, $id_customer)
{
if (!$iso_country || !$iso_currency) {
return false;
}
$id_shop = Context::getContext()->shop->id;
$id_lang = Context::getContext()->language->id;
$sql = 'SELECT ma.id_b2b_merchand_configuration_account,ma.login_account,
ma.password, ma.b2b_xml_account_type_code, ma.logo_url, mal.name
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account` ma
LEFT JOIN `'._DB_PREFIX_.'b2b_merchand_configuration_account_shop` mas
ON mas.id_b2b_merchand_configuration_account = ma.id_b2b_merchand_configuration_account
LEFT JOIN `'._DB_PREFIX_.'b2b_merchand_configuration_account_countries` mac
ON mac.id_b2b_merchand_configuration_account = ma.id_b2b_merchand_configuration_account
LEFT JOIN `'._DB_PREFIX_.'b2b_merchand_configuration_account_lang` mal
ON mal.id_b2b_merchand_configuration_account = ma.id_b2b_merchand_configuration_account
AND mal.id_shop = mas.id_shop AND mal.id_lang = '.(int)$id_lang.'
WHERE ma.active = 1 AND mas.id_shop = '.(int)$id_shop.' AND mac.country_iso = "'.pSQL($iso_country).'"
AND ma.currency_iso = "'.pSQL($iso_currency).'"
ORDER BY mal.name';
$result = Db::getInstance()->executeS($sql);
if ($result) {
$i = 0;
foreach ($result as $account) {
/* // if logo has been updated by xml and not by config
$logo = Be2billApi::getLogoUrl($account['b2b_xml_account_type_code']);
if ($logo && isset($logo['b2b_xml_account_type_logo'])) {
$result[$i]['logo_url'] = $logo['b2b_xml_account_type_logo'];
}
if (Tools::file_exists_no_cache(
_PS_MODULE_DIR_.'be2bill/views/img/'.$account['id_b2b_merchand_configuration_account'].'.jpg'
)
) {
$result[$i]['logo_url'] = '';
}
*/
$result[$i]['logo_url'] = '';
$extensions = array('jpg','svg','png');
foreach ($extensions as $extension){
if (Tools::file_exists_no_cache(
_PS_MODULE_DIR_.'be2bill/views/img/'.$account['id_b2b_merchand_configuration_account'].'.'.$extension)
){
$result[$i]['logo_url'] = $account['id_b2b_merchand_configuration_account'].'.'.$extension;
break;
}
}
$result[$i]['has_oneclick'] = 0;
$result[$i]['has_defered'] = 0;
$result[$i]['has_delivery'] = 0;
$result[$i]['has_standard'] = 0;
$result[$i]['has_oneclickcvv'] = MerchandConfigurationOptions::getOneClickCvv(
$account['id_b2b_merchand_configuration_account']
);
$result[$i]['has_alias'] = Be2billAlias::getByIdCustomer(
(int)$id_customer,
$account['id_b2b_merchand_configuration_account']
);
$result[$i]['mode'] = self::getMainMode($account['b2b_xml_account_type_code']);
if (!$account['login_account'] || !$account['password']) {
unset($result[$i]);
} else {
$options = MerchandConfigurationOptions::getFrontOptions(
$account['id_b2b_merchand_configuration_account']
);
if ($options) {
$j = 0;
foreach ($options as $option) {
$available = true;
if ((float)$option['min_amount'] && $amount < (float)$option['min_amount']) {
$available = false;
}
if ((float)$option['max_amount'] && $amount > (float)$option['max_amount']) {
$available = false;
}
if ($available) {
$result[$i]['options'][] = $option;
$operation = self::TYPE_PAYMENT;
if ($option['b2b_xml_option'] == MerchandConfigurationOptions::TYPE_ONECLICK
&& $option['active']) {
$result[$i]['has_oneclick'] = 1;
}
if ($option['b2b_xml_option'] == MerchandConfigurationOptions::TYPE_DEFERED
&& $option['active']) {
$result[$i]['has_defered'] = 1;
$operation = self::TYPE_AUTHORIZATION;
}
if ($option['b2b_xml_option'] == MerchandConfigurationOptions::TYPE_DELIVERY
&& $option['active']) {
$result[$i]['has_delivery'] = 1;
$operation = self::TYPE_AUTHORIZATION;
}
if ($option['b2b_xml_option'] == MerchandConfigurationOptions::TYPE_STANDARD
&& $option['active']) {
$result[$i]['has_standard'] = 1;
}
$result[$i]['options'][$j]['has_ident_doc_id'] = MerchandConfigurationOptions::hasIdentDocId(
$account['b2b_xml_account_type_code'],
$operation,
$iso_country
);
$j++;
}
}
} else {
unset($result[$i]);
}
}
$i++;
}
if (!empty($result)) {
return $result;
}
}
return false;
}
/**
* return default parameters with values for an account type configuration
* @return array|boolean
*/
public static function getDefaultParameters($reference, $id_account, $option, $id_order = 0 , &$params_no_hash = null)
{
// Get first order by reference (ORDERID)
$cart = Context::getContext()->cart;
if (!$cart && $id_order) {
$cart = Cart::getCartByOrderId($id_order);
}
// Get invoice address
$address = new Address($cart->id_address_invoice);
$string_address = '';
if ($address->id) {
$string_address = implode(
' ',
array(
trim($address->address1),
trim($address->postcode),
trim($address->city),
trim($address->country)
)
);
}
$address->address1 = str_replace('"', '', $address->address1);
$country_invoice = new Country($address->id_country);
$formated_invoice_phone = self::getFormatedNumber($address->phone, $country_invoice->call_prefix);
$formated_invoice_mobile = self::getFormatedNumber($address->phone_mobile, $country_invoice->call_prefix);
// Get shipping address
$address_delivery = new Address($cart->id_address_delivery);
$address_delivery->address1 = str_replace('"', '', $address_delivery->address1);
$country_delivery = new Country($address_delivery->id_country);
$formated_delivery_phone = self::getFormatedNumber($address_delivery->phone, $country_delivery->call_prefix);
$formated_delivery_mobile = self::getFormatedNumber($address_delivery->phone_mobile, $country_delivery->call_prefix);
// Get customer
$customer = new Customer($cart->id_customer);
$dob = '';
if ($customer->birthday && $customer->birthday != '0000-00-00') {
$dob = $customer->birthday;
}
$operation = '';
switch ($option) {
case MerchandConfigurationOptions::TYPE_STANDARD:
$operation = self::TYPE_PAYMENT;
break;
case MerchandConfigurationOptions::TYPE_DEFERED:
$operation = self::TYPE_AUTHORIZATION;
break;
case MerchandConfigurationOptions::TYPE_DELIVERY:
$operation = self::TYPE_AUTHORIZATION;
break;
case MerchandConfiguration::TYPE_CAPTURE:
$operation = self::TYPE_CAPTURE;
break;
case MerchandConfiguration::TYPE_REFUND:
$operation = self::TYPE_REFUND;
break;
default:
$operation = self::TYPE_PAYMENT;
break;
}
$shop_iso = Language::getIsoById(Context::getContext()->language->id);
$merchand_account = new MerchandConfiguration((int)$id_account);
$parameters = $merchand_account->getAccountTypeParameters(
$merchand_account->b2b_xml_account_type_code,
$country_invoice->iso_code,
$operation
);
if (!$parameters) {
return false;
}
$default_params = array();
foreach ($parameters as $param) {
$version = $param['b2b_xml_account_type_parameter_set_version'];
$type = Tools::strtoupper($param['b2b_xml_parameter_type']);
$value = Tools::strtoupper($param['b2b_xml_parameter_value']);
$merchant_hash = Tools::strtoupper($param['b2b_xml_parameter_merchant_hash']);
//Update array no hash
if($merchant_hash == 'NO'){
$params_no_hash[] = $param['b2b_xml_parameter_name'];
}
if ($type == 'REQUIRED' && $value == 'YES') {
// todo all set all value possible
switch ($param['b2b_xml_parameter_name']) {
case 'AMOUNT':
$default_params['AMOUNT'] = Be2billApi::getConvertedPrice(
$cart->getOrderTotal(),
$cart->id_currency
) * 100;
break;
/* todo check real gestion */
case 'ASKIBAN':
$default_params['ASKIBAN'] = 'NO';
break;
case 'BILLINGADDRESS':
$default_params['BILLINGADDRESS'] = Tools::substr($address->address1, 0, 44);
break;
case 'BILLINGCITY':
$default_params['BILLINGCITY'] = Tools::substr($address->city, 0, 249);
break;
case 'BILLINGCOUNTRY':
$default_params['BILLINGCOUNTRY'] = $country_invoice->iso_code;
break;
case 'BILLINGFIRSTNAME':
$default_params['BILLINGFIRSTNAME'] = Tools::substr($address->firstname, 0, 9);
break;
case 'BILLINGLASTNAME':
$default_params['BILLINGLASTNAME'] = Tools::substr($address->lastname, 0, 24);
break;
case 'BILLINGMOBILEPHONE':
if ($formated_invoice_mobile) {
$default_params['BILLINGMOBILEPHONE'] = Tools::substr($formated_invoice_mobile, 0, 31);
} else {
$default_params['BILLINGMOBILEPHONE'] = Tools::substr($formated_invoice_phone, 0, 31);
}
break;
case 'BILLINGPHONE':
if ($formated_invoice_phone) {
$default_params['BILLINGPHONE'] = Tools::substr($formated_invoice_phone, 0, 31);
} else {
$default_params['BILLINGPHONE'] = Tools::substr($formated_invoice_mobile, 0, 31);
}
break;
case 'BILLINGPOSTALCODE':
$default_params['BILLINGPOSTALCODE'] = Tools::substr($address->postcode, 0, 8);
break;
case 'CARDFULLNAME':
$default_params['CARDFULLNAME'] = $address->firstname.' '.$address->lastname;
break;
case 'CART[N][DISCOUNT]':
$products = $cart->getProducts();
$i = 0;
foreach ($products as $product) {
// todo meth calcul %
$default_params['CART'][$i]['DISCOUNT'] = '0';
$default_params['CART'][$i]['MERCHANTITEMID'] = $product['id_product'];
$default_params['CART'][$i]['NAME'] = $product['name'];
$default_params['CART'][$i]['PRICE'] = Be2billApi::getConvertedPrice(
number_format($product['price'], 2, '.', ''),
$cart->id_currency
) * 100;
$default_params['CART'][$i]['QUANTITY'] = $product['cart_quantity'];
$default_params['CART'][$i]['TAX'] = $product['rate'];
$i++;
}
break;
case 'CLIENTADDRESS':
$default_params['CLIENTADDRESS'] = str_replace('"', '', $string_address);
$default_params['CLIENTADDRESS'] = Tools::substr($default_params['CLIENTADDRESS'], 0, 509);
break;
case 'CLIENTDOB':
if ($dob) {
$default_params['CLIENTDOB'] = $dob;
} else {
$default_params['CLIENTDOB'] = '1970-01-01';
}
break;
case 'CLIENTEMAIL':
$default_params['CLIENTEMAIL'] = Tools::substr($customer->email, 0, 254);
break;
/* non decrit */
case 'CLIENTGENDER':
$default_params['CLIENTGENDER'] = 'M';
if ($customer->id_gender == 2) {
$default_params['CLIENTGENDER'] = 'F';
}
break;
case 'CLIENTIDENT':
$default_params['CLIENTIDENT'] = (int)$customer->id.'_'.$customer->email;
$default_params['CLIENTIDENT'] = Tools::substr($default_params['CLIENTIDENT'], 0, 254);
break;
case 'CLIENTIP':
$default_params['CLIENTIP'] = Tools::substr($_SERVER['REMOTE_ADDR'], 0, 14);
break;
case 'CLIENTUSERAGENT':
$default_params['CLIENTUSERAGENT'] = Tools::substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
break;
case 'CREATEALIAS':
$default_params['CREATEALIAS'] = 'YES';
break;
case 'DESCRIPTION':
$default_params['DESCRIPTION'] = Tools::ucfirst($operation);
break;
/* setting later */
case 'EXTRADATA':
$default_params['EXTRADATA'] = '';
break;
case 'HIDECARDFULLNAME':
$default_params['HIDECARDFULLNAME'] = 'NO';
break;
case 'HIDECLIENTEMAIL':
$default_params['HIDECLIENTEMAIL'] = 'YES';
break;
case 'IDENTIFICATIONDOCID':
$default_params['IDENTIFICATIONDOCID'] = '';
break;
case 'IDENTIFICATIONDOCTYPE':
$default_params['IDENTIFICATIONDOCTYPE'] = 'TAXSTATEMENT';
break;
case 'IDENTIFIER':
$default_params['IDENTIFIER'] = $merchand_account->login_account;
break;
case 'LANGUAGE':
$default_params['LANGUAGE'] = $shop_iso;
break;
case 'METADATA':
//$default_params['METADATA'] = '';
break;
case 'OPERATIONTYPE':
$default_params['OPERATIONTYPE'] = $operation;
break;
case 'ORDERID':
$default_params['ORDERID'] = $reference;
break;
case 'SHIPTOADDRESS':
$default_params['SHIPTOADDRESS'] = Tools::substr($address_delivery->address1, 0, 44);
break;
case 'SHIPTOCITY':
$default_params['SHIPTOCITY'] = Tools::substr($address_delivery->city, 0, 249);
break;
case 'SHIPTOCOUNTRY':
$default_params['SHIPTOCOUNTRY'] = $country_delivery->iso_code;
break;
case 'SHIPTOFIRSTNAME':
$default_params['SHIPTOFIRSTNAME'] = Tools::substr($address_delivery->firstname, 0, 9);
break;
case 'SHIPTOLASTNAME':
$default_params['SHIPTOLASTNAME'] = Tools::substr($address_delivery->lastname, 0, 24);
break;
case 'SHIPTOPHONE':
if ($formated_delivery_phone) {
$default_params['SHIPTOPHONE'] = Tools::substr($formated_delivery_phone, 0, 31);
} else {
$default_params['SHIPTOPHONE'] = Tools::substr($formated_delivery_mobile, 0, 31);
}
break;
case 'SHIPTOPOSTALCODE':
$default_params['SHIPTOPOSTALCODE'] = Tools::substr($address_delivery->postcode, 0, 8);
break;
case 'TRANSACTIONID':
$default_params['TRANSACTIONID'] = '';
break;
case 'VERSION':
$default_params['VERSION'] = $version;
break;
}
}
}
return $default_params;
}
/**
* Get account type parameters
* @param string $account_type_code, string operation
* @return array|boolean
*/
public static function getAccountTypeParameters($account_type_code, $iso_country, $operation = self::TYPE_PAYMENT)
{
if ($account_type_code) {
$no_restriction = Be2billApi::hasNotCountriesRestriction($account_type_code);
if ($no_restriction) {
$sql = 'SELECT psp.*,ps.b2b_xml_account_type_parameter_set_version
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ps
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` pso
ON ps.id_b2b_xml_account_type_parameter_set = pso.id_b2b_xml_account_type_parameter_set
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters` psp
ON psp.id_b2b_xml_account_type_parameter_set = ps.id_b2b_xml_account_type_parameter_set
WHERE ps.b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND pso.b2b_xml_operation_code = "'.pSQL($operation).'"';
} else {
$sql = 'SELECT psp.*,ps.b2b_xml_account_type_parameter_set_version
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ps
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` pso
ON ps.id_b2b_xml_account_type_parameter_set = pso.id_b2b_xml_account_type_parameter_set
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters` psp
ON psp.id_b2b_xml_account_type_parameter_set = ps.id_b2b_xml_account_type_parameter_set
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries` psc
ON ps.id_b2b_xml_account_type_parameter_set = psc.id_b2b_xml_account_type_parameter_set
WHERE ps.b2b_xml_account_type_code = "'.pSQL($account_type_code).'"
AND pso.b2b_xml_operation_code = "'.pSQL($operation).'"
AND psc.country_iso = "'.pSQL($iso_country).'"';
}
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Get account type display mode
* @param int $id_account
* @return array|boolean
*/
public static function getDisplayMode($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT b2b_xml_mode_code
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->getValue($sql);
}
return false;
}
/**
* Get account type password
* @param int $id_account
* @return array|boolean
*/
public static function getPassword($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT password
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->getValue($sql);
}
return false;
}
/**
* Get account type defered days values
* @param int $id_account
* @return array|boolean
*/
public static function getDeferedDays($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT b2b_xml_option_extra
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account.' AND b2b_xml_option = "defered"';
return Db::getInstance()->getValue($sql);
}
return false;
}
/**
* Get account type display main mode
* @param string $account_type_code
* @return array|boolean
*/
public static function getMainMode($account_type_code)
{
if ($account_type_code) {
$modes = Be2billApi::getAvailableModesByAccountType($account_type_code);
if (is_array($modes)) {
$is_form = false;
$main_mode = '';
foreach ($modes as $mode) {
switch ($mode['id']) {
case self::MODE_DIRECT:
$main_mode = self::MODE_DIRECT;
break;
case self::MODE_FORM:
$is_form = true;
$main_mode = self::MODE_FORM;
break;
case self::MODE_FORMIFRAME:
$is_form = true;
$main_mode = self::MODE_FORMIFRAME;
break;
case self::MODE_REDIRECT:
$main_mode = self::MODE_REDIRECT;
break;
case self::MODE_SUBMIT:
$main_mode = self::MODE_SUBMIT;
break;
}
}
if ($is_form) {
$main_mode = self::MODE_FORM;
}
return $main_mode;
}
}
return false;
}
/**
* return formatted number phone
* @param string $phone_number string $prefix
* @return string
*/
public static function getFormatedNumber($phone_number, $prefix)
{
if ($phone_number) {
if ($prefix) {
$phone_number = Tools::substr($phone_number, 1);
$phone_number = '00'.$prefix.$phone_number;
return $phone_number;
}
return $phone_number;
}
return false;
}
/**
* Get account type id by account
* @param string $login_account
* @return array|boolean
*/
public static function getIdByReference($reference)
{
if ($reference) {
$sql = 'SELECT ma.id_b2b_merchand_configuration_account
FROM `'._DB_PREFIX_.'orders` od
LEFT JOIN `'._DB_PREFIX_.'b2b_transaction` bt ON bt.id_order = od.id_order
LEFT JOIN `'._DB_PREFIX_.'b2b_merchand_configuration_account` ma ON ma.id_b2b_merchand_configuration_account = bt.id_merchand_account
WHERE od.reference = "'.pSQL($reference).'"
LIMIT 1';
$result = Db::getInstance()->executeS($sql);
$id_account = 0;
foreach ($result as $row) {
$id_account = $row['id_b2b_merchand_configuration_account'];
}
return $id_account;
}
return false;
}
}

View File

@ -0,0 +1,72 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class MerchandConfigurationCountries extends ObjectModel
{
public $id_b2b_merchand_configuration_account_countries;
public $id_b2b_merchand_configuration_account;
public $country_iso;
public static $definition = array(
'table' => 'b2b_merchand_configuration_account_countries',
'primary' => 'id_b2b_merchand_configuration_account_countries',
'multilang' => false,
'fields' => array(
'id_b2b_merchand_configuration_account' => array(
'type' => ObjectModel :: TYPE_INT,
'required' => true,
),
'country_iso' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => true,
),
)
);
/**
* Get account type countries list
* @param int $id_account
* @return array|boolean
*/
public static function getAccountCountries($id_account)
{
if ((int)$id_account) {
$id_lang = Context::getContext()->language->id;
$sql = 'SELECT c.id_country as id , acc.country_iso as value, cl.name as label
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_countries` acc
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.iso_code = acc.country_iso
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON cl.id_country = c.id_country AND cl.id_lang = '.(int)$id_lang.'
WHERE id_b2b_merchand_configuration_account = '.(int)($id_account);
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* reset account type countries list
* @param int $id_account
* @return array|boolean
*/
public static function resetAccountCountries($id_account)
{
if ((int)$id_account) {
$sql = 'DELETE FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_countries`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->execute($sql);
}
return false;
}
}

View File

@ -0,0 +1,309 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
class MerchandConfigurationOptions extends ObjectModel
{
const TYPE_STANDARD = 'standard';
const TYPE_DEFERED = 'defered';
const TYPE_DELIVERY = 'delivery';
const TYPE_ONECLICK = 'oneclick';
const TYPE_ONECLICKCVV = 'oneclickcvv';
const TYPE_NTIMES = 'ntimes';
const TYPE_AGEVERIFICATION = 'ageverification';
const TYPE_DISPLAYCREATEALIAS = 'displaycreatealias';
const TYPE_3DSECURE = '3dsecure';
public $id_b2b_merchand_configuration_account_options;
public $id_b2b_merchand_configuration_account;
public $b2b_xml_option;
public $min_amount;
public $max_amount;
public $b2b_xml_option_extra;
public $active;
public static $definition = array(
'table' => 'b2b_merchand_configuration_account_options',
'primary' => 'id_b2b_merchand_configuration_account_options',
'multilang' => false,
'fields' => array(
'id_b2b_merchand_configuration_account' => array(
'type' => ObjectModel :: TYPE_INT,
'required' => true,
),
'b2b_xml_option' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => true,
),
'min_amount' => array(
'type' => self::TYPE_FLOAT,
'validate' => 'isPrice'
),
'max_amount' => array(
'type' => self::TYPE_FLOAT,
'validate' => 'isPrice'
),
'b2b_xml_option_extra' => array(
'type' => ObjectModel :: TYPE_STRING,
'lang' => false,
'validate' => 'isGenericName',
'required' => false,
'size' => 256
),
'active' => array(
'type' => self::TYPE_BOOL,
'validate' => 'isBool',
),
)
);
/**
* Get account type options list
* @param int $id_account
* @return array|boolean
*/
public static function getAccountOptions($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT * FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* Get account type options values
* @param int $id_account string $code_option
* @return array|boolean
*/
public static function getAccountOptionsParameterValue($id_account, $code_option)
{
if ((int)$id_account) {
$sql = 'SELECT b2b_xml_option_extra FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account.'
AND b2b_xml_option = "'.pSQL($code_option).'"';
return Db::getInstance()->getValue($sql);
}
return false;
}
/**
* reset account type options list
* @param int $id_account
* @return array|boolean
*/
public static function resetAccountOptions($id_account)
{
if ((int)$id_account) {
$sql = 'DELETE FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options`
WHERE id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->execute($sql);
}
return false;
}
/**
* check if account type has oneclickcvv
* @param int $id_account
* @return array|boolean
*/
public static function getOneClickCvv($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT active FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options`
WHERE b2b_xml_option = "'.self::TYPE_ONECLICKCVV.'" AND id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->getValue($sql);
}
return false;
}
/**
* check if account type has oneclick
* @param int $id_account
* @return array|boolean
*/
public static function getOneClick($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT active FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options`
WHERE b2b_xml_option = "'.self::TYPE_ONECLICK.'" AND id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->getValue($sql);
}
return false;
}
/**
* get account type options for front display
* @param int $id_account
* @return array|boolean
*/
public static function getFrontOptions($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT *
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options` mc
WHERE active = 1 AND b2b_xml_option NOT IN("'.self::TYPE_ONECLICKCVV.'", "'.self::TYPE_3DSECURE.'",
"'.self::TYPE_AGEVERIFICATION.'","'.self::TYPE_DISPLAYCREATEALIAS.'")
AND id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* check if account has the param IdentificationDocId
* @param int $id_account
* @param string $operation
* @param string $iso_country
* @return boolean
*/
public static function hasIdentDocId($account,$operation,$iso_country)
{
$name = 'IDENTIFICATIONDOCID';
if ($account && $operation && $iso_country) {
$sql = '
SELECT psp.id_b2b_xml_account_type_parameter_set
FROM `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set` ps
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_operation` pso
ON ps.id_b2b_xml_account_type_parameter_set = pso.id_b2b_xml_account_type_parameter_set
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters` psp
ON psp.id_b2b_xml_account_type_parameter_set = ps.id_b2b_xml_account_type_parameter_set
LEFT JOIN `'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_countries` psc
ON psc.id_b2b_xml_account_type_parameter_set = ps.id_b2b_xml_account_type_parameter_set
WHERE ps.b2b_xml_account_type_code = "' .pSQL($account) . '"
AND pso.b2b_xml_operation_code = "' . pSQL($operation) . '"
AND ( psc.country_iso = "'.pSQL($iso_country).'" OR psc.country_iso = "al" )
AND psp.b2b_xml_parameter_name = "'.pSQL($name).'"
';
return Db::getInstance()->executeS($sql) != null ? 1 : 0;
}
return false;
}
/**
* get account type options not displayed in front
* @param int $id_account
* @return array|boolean
*/
public static function getExtraOptions($id_account)
{
if ((int)$id_account) {
$sql = 'SELECT *
FROM `'._DB_PREFIX_.'b2b_merchand_configuration_account_options` mc
WHERE active = 1 AND b2b_xml_option IN("'.self::TYPE_3DSECURE.'","'.self::TYPE_AGEVERIFICATION.'",
"'.self::TYPE_DISPLAYCREATEALIAS.'")
AND id_b2b_merchand_configuration_account = '.(int)$id_account;
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* get account type options parameters
* @param string $code_option
* @return array|boolean
*/
public static function getOptionParameters($code_option)
{
if ($code_option) {
$sql = 'SELECT * FROM `'._DB_PREFIX_.'b2b_xml_options`
WHERE b2b_xml_option_code = "'.pSQL($code_option).'"';
return Db::getInstance()->executeS($sql);
}
return false;
}
/**
* set account type options parameters
* @param string $code_option array $global_params int $id_account
* @return array|boolean
*/
public static function setOptionsParameters($code_option, $global_params, $id_account)
{
$option_params = self::getOptionParameters($code_option);
foreach ($option_params as $params) {
if ($params['b2b_xml_parameter_type'] == 'REQUIRED') {
// todo all set all value possible
switch ($params['b2b_xml_parameter_name']) {
case '3DSECURE':
$global_params['3DSECURE'] = 'YES';
break;
case '3DSECUREDISPLAYMODE':
$global_params['3DSECUREDISPLAYMODE'] = 'MAIN';
break;
case 'AMOUNTS':
$global_params['AMOUNTS'] = array();
$schedule = Be2billSchedule::getPaymentSchedule($global_params['AMOUNT'], $id_account);
foreach ($schedule as $date => $amount) {
$global_params['AMOUNTS'][$date] = $amount;
}
break;
case 'ALIAS':
$cart = Context::getContext()->cart;
$customer = new Customer($cart->id_customer);
$alias = Be2billAlias::getByIdCustomer((int)$customer->id, $id_account);
if ($alias) {
$global_params['ALIAS'] = $alias['alias'];
}
break;
case 'ALIASMODE':
$global_params['ALIASMODE'] = 'oneclick';
break;
case 'CLIENTIP':
$global_params['CLIENTIP'] = $_SERVER['REMOTE_ADDR'];
break;
case 'CLIENTREFERRER':
if (isset($_SERVER['HTTP_REFERER'])) {
$http_referer = $_SERVER['HTTP_REFERER'];
} else {
$id_shop = Context::getContext()->cart->id_shop;
if (empty($id_shop)) {
$id_shop = Configuration::get('PS_SHOP_DEFAULT');
}
$shop_urls = ShopUrl::getShopUrls((int)$id_shop);
foreach ($shop_urls as $url) {
$http_referer = $url->getURL(Configuration::get('PS_SSL_ENABLED'));
}
}
$global_params['CLIENTREFERRER'] = Tools::substr($http_referer, 0, 254);
break;
case 'CLIENTUSERAGENT':
$global_params['CLIENTUSERAGENT'] = Tools::substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
break;
case 'CARDCVV':
break;
case 'DISPLAYCREATEALIAS':
$global_params['DISPLAYCREATEALIAS'] = 'YES';
$one_click_active = self::getOneClick($id_account);
if (!$one_click_active) {
$global_params['DISPLAYCREATEALIAS'] = 'NO';
}
break;
case 'AGEVERIFICATION':
$global_params['AGEVERIFICATION'] = 'YES';
break;
}
}
}
// reloop for unset specific params
foreach ($option_params as $params) {
if ($params['b2b_xml_parameter_type'] == 'ABSENT') {
unset($global_params[$params['b2b_xml_parameter_name']]);
}
}
return $global_params;
}
}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,47 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/classes/Be2billApi.php');
/* Retrieve the classes needed from all modules installed */
require_once(_PS_MODULE_DIR_.'be2bill/classes/Be2billNotification.php');
require_once(_PS_MODULE_DIR_.'be2bill/be2bill.php');
$parameters = $_GET;
/* Extract hash value */
$hash = $parameters['HASH'];
unset($parameters['HASH']);
if (isset($parameters['EXTRADATA'])) {
$account = $parameters['EXTRADATA'];
$account = explode('-', $account);
}
if (!$account) {
$id_account = (int)MerchandConfiguration::getIdByReference($parameters['ORDERID']);
$option = $parameters['OPERATIONTYPE'];
} else {
$id_account = (int) $account[1];
$option = $account[2];
}
/* Validate hash */
if ($hash == Be2billApi::buildHash($parameters, $id_account)) {
$classe = new Be2billNotification();
$classe->notify('be2bill', $id_account, $option);
echo 'OK';
} else {
/* If Bad Hash */
die('Corrupt received data!');
}

View File

@ -0,0 +1,4 @@
<?php
global $_MODULE;
$_MODULE = array();

View File

@ -0,0 +1,226 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{be2bill}prestashop>ajax_2e8fc401858c73d3119a868f4632cbdc'] = 'Réinitialisation terminée.';
$_MODULE['<{be2bill}prestashop>ajax_bd89b5e7445bb941e0e592e33fe59ed1'] = 'Mise à jour terminée.';
$_MODULE['<{be2bill}prestashop>ajax_a232a65bc00628d635cccd1c8c514415'] = 'Mise à jour non nécessaire, les tables sont déjà à jour.';
$_MODULE['<{be2bill}prestashop>be2bill_99de36ac5afb7171a50f8b92f0ef3971'] = 'Be2bill paiement dynamique par internet';
$_MODULE['<{be2bill}prestashop>be2bill_6e338f87b1089ca341792408f688356c'] = 'La solution de paiement des e-commerçants.';
$_MODULE['<{be2bill}prestashop>be2bill_876f23178c29dc2552c0b48bf23cd9bd'] = 'Etes-vous sûr de vouloir désinstaller ?';
$_MODULE['<{be2bill}prestashop>be2bill_aa840e03642d58d310e153751003b39b'] = 'Sélectionner une transaction à rembourser.';
$_MODULE['<{be2bill}prestashop>be2bill_95db96acf465d09bd184573b7a5a3ecb'] = 'Sélectionner un avoir à rembourser.';
$_MODULE['<{be2bill}prestashop>be2bill_26891d89aa15219ccbe386dd11ca81a5'] = 'ID avoir inconnu :';
$_MODULE['<{be2bill}prestashop>be2bill_df3f27895a80076285f3d5268ccdc017'] = 'ID transaction inconnu :';
$_MODULE['<{be2bill}prestashop>be2bill_41b9a3c7038457b3f9dea377f7929061'] = 'L\'url du xml est requise.';
$_MODULE['<{be2bill}prestashop>be2bill_6083b108aac0e3a9d2502ec89343d3df'] = 'L\'URL du serveur principal est requise.';
$_MODULE['<{be2bill}prestashop>be2bill_9ac86f108e2c382679240aa7bc89b93c'] = 'L\'URL du serveur secondaire est requise.';
$_MODULE['<{be2bill}prestashop>be2bill_9709e0463acc198f5181133d4cbba661'] = 'L\'URL du serveur principal sandbox est requise.';
$_MODULE['<{be2bill}prestashop>be2bill_0574e6fbc936005debc2a68e391294aa'] = 'L\'URL du serveur secondaire sandbox est requise.';
$_MODULE['<{be2bill}prestashop>be2bill_c1ad9f0c83cf495b4eb5ea7ce249df5c'] = 'Le contact doit être une adresse e-mail.';
$_MODULE['<{be2bill}prestashop>be2bill_868968a4dd1f7ab0afce174c5c81126a'] = 'Import terminé avec succès, merci de vérifier votre nouveau compte.';
$_MODULE['<{be2bill}prestashop>be2bill_796e68f24f93ffe5381bea9bcd6a828e'] = 'Paramétrage serveur mis à jour';
$_MODULE['<{be2bill}prestashop>be2bill_2e8fc401858c73d3119a868f4632cbdc'] = 'Réinitialisation terminée.';
$_MODULE['<{be2bill}prestashop>be2bill_a232a65bc00628d635cccd1c8c514415'] = 'Mise à jour non nécessaire, la liste des comptes est à niveau.';
$_MODULE['<{be2bill}prestashop>be2bill_bd89b5e7445bb941e0e592e33fe59ed1'] = 'Mise à jour terminée.';
$_MODULE['<{be2bill}prestashop>be2bill_326df12c92fafb18ccb438dccb588146'] = 'Paramètres d\'import';
$_MODULE['<{be2bill}prestashop>be2bill_cccdcfd610b05cd50f72735ba0c3be8d'] = 'Identifier à importer';
$_MODULE['<{be2bill}prestashop>be2bill_a4311d6fbe2a73cbe93c943e8685930d'] = 'Cet identifier sera importé ainsi que toutes vos informations de paiement liées.';
$_MODULE['<{be2bill}prestashop>be2bill_fab97a9a493b43bd1919cd1f905233c5'] = 'Lancer l\'import';
$_MODULE['<{be2bill}prestashop>be2bill_5d1ad37c3dfba35d73aca9a1e26dbd6c'] = 'Paramètres des serveurs';
$_MODULE['<{be2bill}prestashop>be2bill_4a79cbb43e165d8a391078641fd5eee3'] = 'Url de mise à jour du XML';
$_MODULE['<{be2bill}prestashop>be2bill_e945966adb6864a6b9763436cb217069'] = 'Valeur par defaut : https://template.be2bill.com/cms/xml/v1/configuration.xml';
$_MODULE['<{be2bill}prestashop>be2bill_a9d2187c694e12b7690a0a6543b4e215'] = 'Mettre à jour la liste des comptes';
$_MODULE['<{be2bill}prestashop>be2bill_2640992f5de120b684ff68640ebc31c2'] = 'Version actuelle du XML';
$_MODULE['<{be2bill}prestashop>be2bill_e52df4c614633dec7f5aaa9c9259be42'] = 'Utiliser le mode debug';
$_MODULE['<{be2bill}prestashop>be2bill_ccd7961a15c08690da627338ded0decf'] = 'Active ou désactive le mode debug';
$_MODULE['<{be2bill}prestashop>be2bill_93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
$_MODULE['<{be2bill}prestashop>be2bill_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non';
$_MODULE['<{be2bill}prestashop>be2bill_927da63560acfbb0c3c9150299d19fa8'] = 'URL du serveur principal de production';
$_MODULE['<{be2bill}prestashop>be2bill_c45c46ba755d77c603fef93055302517'] = 'Valeur par défaut : https://secure-magenta1.be2bill.com';
$_MODULE['<{be2bill}prestashop>be2bill_8b32a6e4d3f53fbbd3de4082782c9b13'] = 'URL du serveur secondaire de production';
$_MODULE['<{be2bill}prestashop>be2bill_e08ce65da1468dbc855dd29738579323'] = 'Valeur par défaut : https://secure-magenta2.be2bill.com';
$_MODULE['<{be2bill}prestashop>be2bill_d43a46f98b3eee11b6e86c29dff22330'] = 'Utiliser le mode sandbox (test)';
$_MODULE['<{be2bill}prestashop>be2bill_abc24e45d4a25498f536ef773c3b3a29'] = 'Active ou désactive le mode sandbox';
$_MODULE['<{be2bill}prestashop>be2bill_ef46f792c5d70e47a1a6a673b2b83629'] = 'URL du serveur principal sandbox';
$_MODULE['<{be2bill}prestashop>be2bill_54fdf00564ebd7172cc462245bee0206'] = 'Valeur par défaut : https://secure-test.be2bill.com';
$_MODULE['<{be2bill}prestashop>be2bill_bcf5498c3fb32e339d4e31473b2a2e91'] = 'URL du serveur secondaire sandbox';
$_MODULE['<{be2bill}prestashop>be2bill_01ed8a4015b45aa03653c53de46e37ee'] = 'E-mail de contact';
$_MODULE['<{be2bill}prestashop>be2bill_b07dc3c066822e7545ced10db3ede364'] = 'E-mail de contact en cas d\'alerte';
$_MODULE['<{be2bill}prestashop>be2bill_4c2228490d376092b042573c6637a0dc'] = 'Rediriger directement vers le serveur Be2bill';
$_MODULE['<{be2bill}prestashop>be2bill_6aefa346e2ae940c6ff21eee60412608'] = 'Active ou non la redirection automatique vers la page de paiement';
$_MODULE['<{be2bill}prestashop>be2bill_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
$_MODULE['<{be2bill}prestashop>be2bill_630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste';
$_MODULE['<{be2bill}prestashop>be2bill_0b5b31f49cd92c98e9c925e0a84025e4'] = 'Vous devez mettre à jour votre liste de comptes avant de lancer l\'import';
$_MODULE['<{be2bill}prestashop>be2billnotification_e5d5d9f40763cfe6549bef705e3529a7'] = 'Le message de paiement n\'est pas valide, vérifier votre module.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_d3b206d196cd6be3a2764c1fb90b200f'] = 'Supprimer la selection ?';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_e25f0ecd41211b01c83e5fec41df4fe7'] = 'Supprimer les éléments sélectionnés ?';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_490aa6e856ccf208a054389e47ce0d06'] = 'Identifiant';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_51bdfc4588e299668d9478a2293e7eff'] = 'Type de compte';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_b021df6aac4654c454f46c77646e745f'] = 'Libellé';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_386c339d37e737a436499d423a77df0c'] = 'Devise';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_ec53a8c4f07baed5d8825072c89799be'] = 'Statut';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_b5c2325f45a8d60418cf405dbc57114e'] = '2 Fois';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_1c0565a0acaa1ae14127595b3fadcb44'] = '3 Fois';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_5b69cd05bc7c1e5240c81da1109d0148'] = '4 Fois';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_0d730df753ae6a369323fe6dc1641eb2'] = '1 Jour';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_2b5c88bc8c875f79745514e9af2f348f'] = '2 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_14cad5137a2254d53fde198d52e70109'] = '3 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_6c32f983ee38ad5089298aa659cd011c'] = '4 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_6383598717ae8ac458dc988dff77c800'] = '5 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_366adabd6f1babc8138db3063adaf869'] = '6 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_374616a0b786e9bffadc7f28e68d6c59'] = '7 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_79e241fd6b320cbb41d67b028ec6f1c0'] = '8 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_281f41b6564c9e63e16d67b1c07a46e5'] = '9 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_38efedfd69ad005a6e0b0393682636db'] = '10 Jours';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_8272f11f52f69f2a12558c05df3f0580'] = 'Configuration du type de compte ';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_0689f8ebacb89fa3dc1e82f9dd65d1a7'] = 'Devise :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_30c6d662461554a51face49d6285d3e5'] = 'Choisissez une devise.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_a081d6ac849b2d744ff5a48d6f4627ec'] = 'Soyez vigilant quand vous modifiez ce champ, cela impactera toute votre configuration.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_1914257fae5ee312146e96e55f86fe8d'] = 'Type de compte :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_8851bb298e65c77406fd4f7a50d86f5d'] = 'Choisissez un type de compte.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_9928283dc64e6bd3353aa64c16ab32c0'] = 'Identifier :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_27bdb45766bcb2dade2bff8315e77f35'] = 'Mot de passe :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Activé :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Oui';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_b9f5c797ebbf55adccdd8539a65a0241'] = 'Non';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_d7cc725bd9b304498e12fe0ec263f37d'] = 'Activé le paiement en front office.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_a5b2d4ab297946f559384c1a0611d646'] = 'Libellé sur la boutique :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_2d768abe35f11e46217159140a8daeda'] = 'Libellé pour le tunnel d\'achat.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_107caacc31072efdacf85287f61e7f45'] = 'Logo :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_bd1ecb394e0445ae5f4dd2cda499858d'] = 'Télécharger un logo depuis votre ordinateur. Si vous laissez à blanc le logo par défaut sera affiché.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_c9ef7cbfa0dc0bd4bf253916b7525b34'] = 'Cocher pour supprimer le logo personnalisé.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_c9ef7cbfa0dc0bd4bf253916b7525b34'] = 'Cocher pour réinitialiser limage par défaut (fournie par Be2Bill)';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_f81ab71da898f9432c28f3a73d95b2e0'] = 'Mode d\'intégration :';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_f6e311a9ab87979b34e5c66826558d7d'] = 'Choisissez un mode d\'intégration.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_1386a276ff09bcfba39e68ddc40bb18b'] = 'Attention : Cette option requière un certificat SSL valide.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_d6e573b38bc6b9e67719005118f73d51'] = 'Configuration du paiement standard';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_44f34e39ba2e8b49fc26507d6fc2458c'] = 'Active le paiement standard';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_b16854ceee6fb9499c2ad3aac40d539e'] = 'Montant minimum de commande';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_bf8cfcccdd4dada29ca4a35f08c1c494'] = 'Montant minimum de commande pour afficher le paiement. Laissez à 0 pour ne pas avoir de montant minimum';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_abcac9aebb2505b3cf76c42e1bfbe8f7'] = 'Montant maximum de commande';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_50a5178510b6ab846ede2908505c8c1e'] = 'Montant maximum de commande, laissez à 0 pour ne pas fixer de montant maximum.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_7ab7d0e03d06f49475bb2b7b69b2f5ed'] = 'Configuration du paiement différé';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_a345bd7d4661514f16ed70f8eec9b2e8'] = 'Activé le paiement différé.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_e11441da60ee683892036b1423053e40'] = 'Jour(s) à attendre avant la capture.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_eca931beae6bc5a9bb914871505185da'] = 'Configuration du paiement à la livraison';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_7877246c57bbda898c0d210fcb397a65'] = 'Activé le paiement à la livraison.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_6c6ea44e5ec731c894629e74d7ff2570'] = 'Statut de commande déclenchant le paiement';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_34d1944d90212f8309c24f722d99e41b'] = 'Quand une commande passe par l\'un de ces statuts, la capture sexécute automatiquement.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_cf4297ae7679cdfae60baf71461c518b'] = 'Configuration du paiement en plusieurs fois';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_de341655b80f1b2c2fdfbcd8b3aba9d1'] = 'Activé le paiement en plusieurs fois.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_3f62eac6ddc993b6eefa005fe646b2dd'] = 'Nombre d\'occurences.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_2d138c8854915dbad9a643c6c22e3273'] = 'Configuration du 3D secure';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_37daec598473a71184796e8360afb28d'] = 'Activé le 3D secure.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_23a5c1b641d2787d54bfeb6cdba082b7'] = 'Configuration du paiement en 1 click';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_30b4c3d9a7d043724533df1529c634be'] = 'Activé le paiement en 1 click.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_f766bd992d0074624ce4b5209364e918'] = 'Active ou non le paiement en 1 click sans saisie du cryptogramme.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_cc8de66e113696fd7c65c108f878a83c'] = 'Configuration du paiement en 1 click sans saisie du cryptogramme.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_5b4cccaa77895ec81b19013250b48b49'] = 'Configuration des alias';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_22674475121aa1c53d12d4168a76451c'] = 'Laisser le client choisir la sauvegarde de ses données bancaires.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_1a09493663f0db50b1511a9694a093ac'] = 'Configuration de la vérification d\'âge';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_8557254505119f2bdfd5694147485e9b'] = 'Active ou non la vérification d\'âge.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_344f1ee47c885eb15976a7ab4e1bb05d'] = 'Configuration des pays autorisés';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_9a141f9fcc3002a2bfacfde70ee6fdb2'] = 'Pays autorisés à utiliser le mode de paiement';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_fdbe12b385f30ec57a9ecacb8385a14d'] = 'Vous devez également autoriser ces pays dans la configuration des paiements en back office.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_13b032630373c74569a1d1148046ba1c'] = 'Configuration multi-boutique';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_9d55fc80bbb875322aa67fd22fc98469'] = 'Assocation de boutique';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_dae2534a533b5bb9284175bd502cb5ff'] = 'Vous devez selectionner une devise.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_024cad98d58a5d790fd206fd2eeace66'] = 'Le type de compte est obligatoire.';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_a08cf3ccd88cf81bb2026f11eb2ebf58'] = 'Montant minimum doit être un chiffre ou décimal';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_5a90d3937d8e918439f264da4b801eaf'] = 'Montant maximum doit être un chiffre ou décimal';
$_MODULE['<{be2bill}prestashop>adminmanagebe2billconf_4fce9e159bb6a537c4935fc8baed36e9'] = 'Vous devez choisir au moins un status pour le paiement à la livraison.';
$_MODULE['<{be2bill}prestashop>payment_fb9337b746f6da8d914bd1a5bd009d60'] = 'Le cryptogramme de la carte est requis.';
$_MODULE['<{be2bill}prestashop>payment_72ffbb5fe82ed18b0eb601d8e8d41112'] = 'Le cryptogramme de la carte est mal formaté.';
$_MODULE['<{be2bill}prestashop>submit_e2b7dec8fa4b498156dfee6e4c84b156'] = 'La méthode de paiement n\'est pas disponible.';
$_MODULE['<{be2bill}prestashop>form_000df07e0a27b0f4019b639848f587b0'] = 'Informations principales à renseigner dans l\'extranet de la Solution Be2bill';
$_MODULE['<{be2bill}prestashop>form_452a60620a02c8fe05abbb86add561ac'] = 'Connectez-vous à votre extranet be2bill';
$_MODULE['<{be2bill}prestashop>form_23dea4f53b14bd6479aadc6e8e34a9de'] = 'Cliquez sur la liste de comptes puis sur l\'icône de configuration';
$_MODULE['<{be2bill}prestashop>form_7202793a812728805719df2b63b4e584'] = 'Saisissez les champs suivants :';
$_MODULE['<{be2bill}prestashop>form_4a7a4e39839ab737a2337ff04ce5abe7'] = 'Adresse IP locale :';
$_MODULE['<{be2bill}prestashop>form_b16384efe40e265bf174433ab0df4f44'] = 'Attention : si vous utilisez un proxy, cette IP n\'est pas l\'adresse IP publique.';
$_MODULE['<{be2bill}prestashop>form_9ec282e7d71ead8ffc0ab3cd992cd1c4'] = 'URL de notification des transactions:';
$_MODULE['<{be2bill}prestashop>form_79409d7067f434636b5038d0afba85be'] = 'URL de redirection après un traitement formulaire ou 3DSECURE:';
$_MODULE['<{be2bill}prestashop>form_d019a7566ee8fc2519e49bab9b1510a4'] = 'Les autres champs doivent rester vide.';
$_MODULE['<{be2bill}prestashop>form_9b8f6ce8ff54225ee130786f8804be6e'] = 'Vous pouvez reinitialiser vos listes de compte en cliquant sur ce lien :';
$_MODULE['<{be2bill}prestashop>form_48fe8d8db890fb70909c24e9d65b90ea'] = 'Reinitialiser les comptes';
$_MODULE['<{be2bill}prestashop>form_0adcf7dd4ede07d5410f9533cbddc8cd'] = 'Attention : Cette opération videra vos tables en base et les rechargera.';
$_MODULE['<{be2bill}prestashop>form_4f50919d59993e7560445a094e18e822'] = 'Vous pouvez forcer la mise à jour en cliquant sur ce lien :';
$_MODULE['<{be2bill}prestashop>form_38edc54ddf680b1af76f9ccfb48865ca'] = 'Mettre à jour vos moyens de paiement';
$_MODULE['<{be2bill}prestashop>form_8524de963f07201e5c086830d370797f'] = 'Chargement en cours ....';
$_MODULE['<{be2bill}prestashop>form_44749ab7d2f5938ec2ec26c71692522b'] = 'Aucun type compte trouvé, vous devez peut être mettre à jour votre xml dans la configuration du module.';
$_MODULE['<{be2bill}prestashop>form_e9e1cb9020637f079cbd2794de84c402'] = 'Aucun type compte trouvé';
$_MODULE['<{be2bill}prestashop>form_e2e0de44acf533877a436331f783dee0'] = 'Pas de mode intégration trouvé';
$_MODULE['<{be2bill}prestashop>form_09a1a8c1ca63035daaa000d558a869d7'] = 'Pas de pays valable dans votre liste de pays actif sur la boutique.';
$_MODULE['<{be2bill}prestashop>order_payment_c63d3d9600f66933ee10d41ac6728aa9'] = 'n\'est pas disponible.';
$_MODULE['<{be2bill}prestashop>order_payment_6e8598ec83d708b73db6e22ed4d5b484'] = 'Choisissez un autre moyen de paiement.';
$_MODULE['<{be2bill}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de la commande';
$_MODULE['<{be2bill}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide.';
$_MODULE['<{be2bill}prestashop>payment_execution_3de698b39b6630cab6090ff17ecf76a2'] = 'Be2bill';
$_MODULE['<{be2bill}prestashop>payment_execution_521bc8ba97db60153a009c40d2559451'] = 'Vous avez choisi de payer avec Be2bill en un clic.';
$_MODULE['<{be2bill}prestashop>payment_execution_cb2e3b67038ce71767a73253c4479f55'] = 'Vous avez choisi de payer avec Be2bill.';
$_MODULE['<{be2bill}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un bref récapitulatif de votre commande :';
$_MODULE['<{be2bill}prestashop>payment_execution_3b3b41f131194e747489ef93e778ed0d'] = 'Le montant total de votre commande s\'élève à ';
$_MODULE['<{be2bill}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'TTC';
$_MODULE['<{be2bill}prestashop>payment_execution_c5fdaa9dd09a0a29689ed9ed619f7600'] = 'Votre numéro de carte bancaire enregistré :';
$_MODULE['<{be2bill}prestashop>payment_execution_e333c0da44748af0f2dd641757f370ce'] = 'Enregistrez une nouvelle carte bancaire';
$_MODULE['<{be2bill}prestashop>payment_execution_b26093f8d484d67b3ed0f073d62c27b8'] = 'Enregistrez votre carte bancaire pour un prochain achat';
$_MODULE['<{be2bill}prestashop>payment_execution_05cd4cc075e498c919c733f606432e80'] = 'Saisissez les 4 chiffres au dos de votre carte bancaire :';
$_MODULE['<{be2bill}prestashop>payment_execution_fead5f424f632cffaf325a3f978081a4'] = 'Saisissez les 3 chiffres au dos de votre carte bancaire :';
$_MODULE['<{be2bill}prestashop>payment_execution_6817fcdb584942ea837dcc55df771e1a'] = 'Numéro d\'identification :';
$_MODULE['<{be2bill}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"';
$_MODULE['<{be2bill}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande';
$_MODULE['<{be2bill}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement';
$_MODULE['<{be2bill}prestashop>redirection_276c15a908375d890eb75be8509aaaf9'] = 'Vous allez être redirigé vers la plate-forme de paiement dans quelques secondes.';
$_MODULE['<{be2bill}prestashop>redirection_4bd4456e5ef2c9abca46d87a09ea23be'] = 'Cliquez ici si vous n\'êtes pas redirigé automatiquement.';
$_MODULE['<{be2bill}prestashop>admin_customers_df7d7f30a34029b6d1cd6cb31851ccdb'] = 'Be2bill Alias';
$_MODULE['<{be2bill}prestashop>admin_customers_08bd40c7543007ad06e4fce31618f6ec'] = 'Compte';
$_MODULE['<{be2bill}prestashop>admin_customers_effdb9ce6c5d44df31b89d7069c8e0fb'] = 'Alias';
$_MODULE['<{be2bill}prestashop>admin_customers_5735196b42849ae4fe6adac3ae14c3d1'] = 'Type de carte';
$_MODULE['<{be2bill}prestashop>admin_customers_a44217022190f5734b2f72ba1e4f8a79'] = 'Numéro de carte';
$_MODULE['<{be2bill}prestashop>admin_customers_5a787141d53b573ec9b86e900bfe0d79'] = 'Date d\'expiration';
$_MODULE['<{be2bill}prestashop>admin_customers_f92ee7ec445dfc5ccc3a73db4b8613d7'] = 'Aucun alias';
$_MODULE['<{be2bill}prestashop>admin_order_ed431c9f4d10a2ead0eb3643f5e33f33'] = 'Historique des transactions';
$_MODULE['<{be2bill}prestashop>admin_order_44749712dbec183e983dcd78a7736c41'] = 'Date';
$_MODULE['<{be2bill}prestashop>admin_order_88427ec035734b45aae9f7d8859a5008'] = 'ID transaction';
$_MODULE['<{be2bill}prestashop>admin_order_384036f8b0067ec3bb710a92f8734b3b'] = 'Type de transaction';
$_MODULE['<{be2bill}prestashop>admin_order_b2f40690858b404ed10e62bdf422c704'] = 'Montant';
$_MODULE['<{be2bill}prestashop>admin_order_fcc1cc6cbfec637ad3bdb4082f54e122'] = 'EXECCODE';
$_MODULE['<{be2bill}prestashop>admin_order_3462e4acbaa66b4937e0989a3ecb8e04'] = 'Message du serveur';
$_MODULE['<{be2bill}prestashop>admin_order_163acb6b15e31fa15ac1e17521ed9a28'] = 'Aucune transaction';
$_MODULE['<{be2bill}prestashop>admin_order_cb80975111b0b8ffe0189d5349078b23'] = 'Remboursement de transaction';
$_MODULE['<{be2bill}prestashop>admin_order_b3fe28480f76ad7ea0ef213ba3ffe51b'] = 'Sélectionner une transaction et un avoir à rembourser :';
$_MODULE['<{be2bill}prestashop>admin_order_430a0f8c37264be8eac3535f3a5b0a2d'] = 'Sélectionner une transaction';
$_MODULE['<{be2bill}prestashop>admin_order_fc3428c70d6b24532c193e814843a074'] = 'Sélectionner un avoir';
$_MODULE['<{be2bill}prestashop>admin_order_c7d76074f459eaa296d3eb71efc23eba'] = 'Avoir n°';
$_MODULE['<{be2bill}prestashop>admin_order_76f0ed934de85cc7131910b32ede7714'] = 'Rembourser';
$_MODULE['<{be2bill}prestashop>admin_order_da3ccea2742e823d46bc6052793c2515'] = 'Aucune transaction remboursable.';
$_MODULE['<{be2bill}prestashop>admin_order_78981033aa2f32f9376f2df56a975bff'] = 'Créer un remboursement partiel avant de rembourser la transaction.';
$_MODULE['<{be2bill}prestashop>admin_order_25f7347236b51a5eae4ba01a7862cb55'] = 'Echéancier';
$_MODULE['<{be2bill}prestashop>admin_order_ba29c8b1e3ef39b207c9fa45c06704d1'] = 'Date prévisionnelle';
$_MODULE['<{be2bill}prestashop>admin_order_3f8c6ecb084eea3b83d659fab7155e86'] = 'Date de la capture';
$_MODULE['<{be2bill}prestashop>admin_order_81b7215457b60bf2627ddb668f559f96'] = 'Est capturé';
$_MODULE['<{be2bill}prestashop>payment_f063ea64a6637abb70794b25994f0348'] = 'Différé';
$_MODULE['<{be2bill}prestashop>payment_5601ebe625adbbb9b0a51e7ff9e17c32'] = 'Vous serez débité dans';
$_MODULE['<{be2bill}prestashop>payment_225e75c29d32392d311f5dc94c792384'] = 'jour(s)';
$_MODULE['<{be2bill}prestashop>payment_73d4e512ba69106993297f7f1dee3c1e'] = 'à la livraison';
$_MODULE['<{be2bill}prestashop>payment_5871cbb0a915e16ca9ea39d4081a4c6c'] = 'en plusieurs fois';
$_MODULE['<{be2bill}prestashop>payment_317fef6e6f61832145fc8ac212bd1d1e'] = 'en 1 click';
$_MODULE['<{be2bill}prestashop>payment_return_bd9317b7a60e68ad016948c610434536'] = 'Paiement réalisé aves succès';
$_MODULE['<{be2bill}prestashop>payment_return_fbd5abb4f24e294f985ec33747bd96c6'] = 'Montant du paiement :';
$_MODULE['<{be2bill}prestashop>payment_return_63c193f613dd3d9d6c16da7678efda2a'] = 'Référence de la commande :';
$_MODULE['<{be2bill}prestashop>payment_return_ad73ff4385c81d28f050e40d84b83802'] = 'Merci pour votre commande, vous allez rapidement recevoir un e-mail de confirmation à cette adresse :';
$_MODULE['<{be2bill}prestashop>payment_return_d796a541ad881a34c256f2c06554604b'] = 'Votre commande a été partiellement payée';
$_MODULE['<{be2bill}prestashop>payment_return_6eabcefa8c520747ee841c779cb3cebc'] = 'Montant payé:';
$_MODULE['<{be2bill}prestashop>payment_return_88351b40c70839a45707f8f1c917da7a'] = 'Montant de la commande:';
$_MODULE['<{be2bill}prestashop>payment_return_4072a2b167fa064269970f5c0a239d08'] = 'Veuillez nous contacter afin de régulariser votre commande.';
$_MODULE['<{be2bill}prestashop>payment_return_0b22741260d4e9166ce4c9c93bcf09ec'] = 'Paiement en attente du retour de la banque';
$_MODULE['<{be2bill}prestashop>payment_return_ba4bd415372d6b2e2653300e862b15d9'] = 'Le retour du paiement envoyé par la banque n\'a toujours pas été reçu.';
$_MODULE['<{be2bill}prestashop>payment_return_91cb9be76ded8fb309a8461885591267'] = 'Vous pouvez suivre l\'évolution de votre commande sur';
$_MODULE['<{be2bill}prestashop>payment_return_9390390581f54c65d6acfc8da4e17362'] = 'Mes commandes';
$_MODULE['<{be2bill}prestashop>payment_return_55fe965e8e8b0f80673dec66ea56652c'] = 'cette adresse.';
$_MODULE['<{be2bill}prestashop>payment_return_b06c5ecc37b9cd61a0cab0534ed1f15d'] = 'Erreur de paiement';
$_MODULE['<{be2bill}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons remarqué un problème avec votre commande. Si vous pensez qu\'il s\'agit d\'une erreur, vous pouvez contacter notre';
$_MODULE['<{be2bill}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client';
$_MODULE['<{be2bill}prestashop>payment_return_a7ec49d602705b570a98ddbbe036cae1'] = 'Renouveler ma commande';

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,55 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_2_0_0($module)
{
// Install overrides
if (is_writable(_PS_OVERRIDE_DIR_)) {
if (file_exists(_PS_OVERRIDE_DIR_.'classes/order/Order.php')) {
$module->uninstallOverrides();
$module->installOverrides();
}
}
// install new menu
$module->installBackOffice();
// register status
$module->registerOrderStatus();
$module->registerOrderDeferedStatus();
$module->registerOrderNxStatus();
$module->registerOrderShipStatus();
$module->registerHook('actionOrderStatusUpdate');
// create new tables
$module->createTables();
Configuration::updateGlobalValue('BE2BILL_NEED_IMPORT', 1);
Configuration::updateGlobalValue('BE2BILL_LOGS', 0);
Configuration::updateGlobalValue('BE2BILL_SANDBOX', 0);
Configuration::updateGlobalValue('BE2BILL_URL_XML', 'http://maxime.php55.quadra-informatique.fr/dynamicPayments.xml');
Configuration::updateGlobalValue('BE2BILL_MAIN_SERVER', 'https://secure-magenta1.be2bill.com');
Configuration::updateGlobalValue('BE2BILL_SLAVE_SERVER', 'https://secure-magenta2.be2bill.com');
Configuration::updateGlobalValue('BE2BILL_SB_MAIN_SERVER', 'https://secure-test.be2bill.com');
Configuration::updateGlobalValue('BE2BILL_SB_SLAVE_SERVER', 'https://secure-test.be2bill.com');
Configuration::updateGlobalValue('BE2BILL_REDIRECT_PAYMENT', 1);
return true;
}

View File

@ -0,0 +1,49 @@
<?php
/**
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com> Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 2007-2016 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
function upgrade_module_2_0_10($object, $install = false)
{
// add column b2b_xml_parameter_merchant_hash in table b2b_xml_account_type_parameter_set_parameters, checking exitence first
$query = 'SELECT * FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME= "b2b_xml_parameter_merchant_hash"
AND TABLE_NAME= "'._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters"
AND TABLE_SCHEMA = "'._DB_NAME_.'"';
$result = Db::getInstance()->ExecuteS($query);
// adding column lotacheminement
if (!$result)
{
$query = 'ALTER TABLE '._DB_PREFIX_.'b2b_xml_account_type_parameter_set_parameters add `b2b_xml_parameter_merchant_hash` varchar(255) NOT NULL DEFAULT "YES"';
Db::getInstance()->Execute($query);
}
return true;
}

View File

@ -0,0 +1,34 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/classes/Be2billApi.php');
require_once(_PS_MODULE_DIR_.'be2bill/be2bill.php');
$parameters = $_GET;
/* Extract hash value */
$hash = $parameters['HASH'];
unset($parameters['HASH']);
$account = $parameters['EXTRADATA'];
$account = explode('-', $account);
$id_account = (int) $account[1];
/* Validate hash */
if ($hash == Be2billApi::buildHash($parameters, $id_account)) {
$link = new Link();
Tools::redirectLink($link->getModuleLink('be2bill', 'validation', array_merge($_GET, array(
'content_only' => true)), true));
} else {
die('bad hash.');
}

View File

@ -0,0 +1,40 @@
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
#advices ul.square {
list-style: square inside none;
}
#advices span.italic,
form.be2bill span.italic {
font-style:italic;
color: #FF0000;
}
#advices div.hint {
margin: 10px 0;
z-index: 0;
}
.be2bill-admin label.refund {
font-weight: normal;
padding-top: 5px;
text-align: left;
width: 105px;
}
.be2bill-admin-alias {
margin-top: 10px;
}

View File

@ -0,0 +1,123 @@
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
/* Payment */
p.be2bill > a > span:first-child {
background: url('../img/be2bill_btn.png') 0px 0px no-repeat transparent;
display:block;
float:left;
width:31px;
height:28px;
}
p.be2bill > a:hover > span:first-child {
background-position:0px -28px;
}
p.be2bill > a > span.btn_label {
background: url('../img/be2bill_btn.png') 0px -56px repeat-x transparent;
display:block;
float:left;
width:auto;
height:28px;
color: #FFF;
line-height:28px;
text-transform:none;
font-weight: bold;
}
p.be2bill > a:hover > span.btn_label {
background-position:0px -84px;
}
p.be2bill > a > span {
background: url('../img/be2bill_btn.png') -31px 0px no-repeat transparent;
display:block;
float:left;
width:9px;
height:28px;
}
p.be2bill > a:hover > span {
background-position:-31px -28px;
}
/* Payment execution & validation */
#module-be2bill-payment #left_column,
#module-be2bill-redirection #left_column,
#module-be2bill-submit #left_column {
display: none;
}
#module-be2bill-payment #center_column,
#module-be2bill-redirection #center_column,
#module-be2bill-submit #center_column {
width: 100%;
}
#module-be2bill-payment ul.be2bill-payment-description {
margin: 0 0 15px 15px;
}
#module-be2bill-payment form p img {
float:left;
height: 49px;
margin: 0px 20px 5px 0px;
width: 86px;
}
#module-be2bill-submit iframe.be2bill-payment-iframe {
display: block;
min-height: 850px;
width: 100%;
}
.be2bill_link:after{
color: #777777;
display: block;
font-family: "FontAwesome";
font-size: 25px;
height: 22px;
margin-top: -11px;
position: absolute;
right: 15px;
top: 50%;
width: 14px;
}
.be2bill_link, .be2bill_link16{
padding-left:5px !important;
}
.be2bill_link16 img{
margin-right:15px ;
}
.be2bill_link16:after{
color: #777777;
content: "";
display: block;
font-family: "FontAwesome";
font-size: 25px;
height: 22px;
margin-top: -11px;
position: absolute;
right: 15px;
top: 50%;
width: 14px;
}
.logo_be2bill{
height: 45px;
width: 88px;
}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,69 @@
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
$(document).ready(function () {
$('#reset_table').click(function (e) {
$('#loading').show();
e.preventDefault();
var ajax_url = $('#reset_table').attr('href');
$.ajax({
type: 'POST',
async: true,
dataType: "json",
url: ajax_url,
data: {
action: 'reset_tables'
},
success: function (jsonData) {
$('#loading').hide();
if (jsonData && jsonData.answer && typeof jsonData.answer != undefined) {
if (jsonData.msg.length)
showSuccessMessage(jsonData.msg);
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('TECHNICAL ERROR\nDetails:\nError thrown: ' + errorThrown + '\n' + 'Text status: ' + textStatus);
$('#loading').hide();
}
});
});
$('#update_table').click(function (e) {
$('#loading').show();
e.preventDefault();
var ajax_url = $('#update_table').attr('href');
$.ajax({
type: 'POST',
async: true,
dataType: "json",
url: ajax_url,
data: {
action: 'update_tables'
},
success: function (jsonData) {
if (jsonData && jsonData.answer && typeof jsonData.answer != undefined) {
if (jsonData.xml_version.length)
$('#BE2BILL_XML_VERSION').val(jsonData.xml_version);
if (jsonData.msg.length)
showSuccessMessage(jsonData.msg);
}
$('#loading').hide();
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('TECHNICAL ERROR\nDetails:\nError thrown: ' + errorThrown + '\n' + 'Text status: ' + textStatus);
$('#loading').hide();
}
});
});
});

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,64 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
{extends file="helpers/form/form.tpl"}
{** Be2bill standard payment **}
{block name="after"}
<div id="fieldset_advices" class="panel">
<div class="panel-heading">
<img alt="{l s='Main information to set in the extranet of the Be2bill Solution' mod='be2bill'}" src="{$smarty.const._PS_IMG_|escape:'htmlall':'UTF-8'}admin/information.png">
{l s='Main information to set in the extranet of the Be2bill Solution' mod='be2bill'}
</div>
<ul class="square">
<li>{l s='Connect to your be2bill extranet' mod='be2bill'}</li>
<li>{l s='Click on the accounts list then on the configuration icon' mod='be2bill'}</li>
<li>{l s='Fill the following data:' mod='be2bill'}</li>
</ul>
<div class="alert alert-warning" style="display:block;">
<ul class="square">
<li>
<strong>{l s='Local IP address:' mod='be2bill'}</strong> {$server_ip|escape:'htmlall':'UTF-8'}
<span class="italic">({l s='Warning: if you use a proxy, this IP is not the public IP.' mod='be2bill'})</span>
</li>
<li><strong>{l s='URL of notification:' mod='be2bill'}</strong> {$notification_url|escape:'htmlall':'UTF-8'}</li>
<li><strong>{l s='URL of validation:' mod='be2bill'}</strong> {$validation_url|escape:'htmlall':'UTF-8'}</li>
</ul>
<br/>
<span><strong style="text-decoration:underline;">{l s='The rest of the fields have to be empty.' mod='be2bill'}</strong></span>
</div>
<ul class="square" style="display:none;">
<li style="display:none;">{l s='You can reset your account type list by clicking this link:' mod='be2bill'}<br />
<a href="{$ajax_url|escape:'htmlall':'UTF-8'}" id="reset_table">{l s='Reset account types' mod='be2bill'}</a><br />
<span class="italic">{l s='Warning: this operation is gonna truncate your bdd table and reload them.' mod='be2bill'}</span>
</li>
<li style="display:none;">{l s='You can force updating your account type list by clicking this link:' mod='be2bill'}<br />
<a href="{$ajax_url|escape:'htmlall':'UTF-8'}" id="update_table">{l s='Update account types' mod='be2bill'}</a><br />
<span class="italic">{l s='Warning: this operation is gonna truncate your bdd table and reload them.' mod='be2bill'}</span>
</li>
</ul>
<div id="loading" style="display:none;z-index:10001; margin-left:-32px; margin-top:-32px; position:fixed; left:50%; top:50%"><i class="icon-refresh icon-spin" "></i>&nbsp;{l s='Loading...' mod='be2bill'}</div>
</div>
<br />
{/block}
{block name="script"}
function doClick(){};
$(document).ready(function() {
doClick = function(){
$('#loading_container').show();
$('#update_table').click();
$('#loading_container').hide();
}
});
{/block}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,337 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
{extends file="helpers/form/form.tpl"}
{block name="after"}
<div id="loading" style="display:none;z-index:10001; margin-left:-32px; margin-top:-32px; position:fixed; left:50%; top:50%"><i class="icon-refresh icon-spin"></i>&nbsp;{l s='Loading...' mod='be2bill'}</div>
<script type="text/javascript">
$(document).ready(function () {
$('#b2b_xml_mode_code').next('.help-block').hide();
var logo = '{$has_logo|escape:'htmlall':'UTF-8'}';
if(!logo) {
$('#logo_reset_on').prop('disabled', true);
}
// if creation we only display currency select
if (!$('#id_b2b_merchand_configuration_account').length)
{
$('select[name="currency_iso"]').parentsUntil('.form-wrapper').nextAll('.form-group').hide();
resetOptions();
} else {
var pass = '{$pass|escape:'UTF-8'}';
$('#password').val(pass);
$('#loading').show();
updateOptions();
$('.countries').prop('disabled', true);
updateCountries();
showWarningMode();
}
// this function hide all options
function resetOptions() {
$('#fieldset_1_1').hide(); // fieldset standard payment
$('#fieldset_2_2').hide(); // fieldset defered payment
$('#fieldset_3_3').hide(); // fieldset at delivery payment
$('#fieldset_4_4').hide(); // fieldset ntimes payment
$('#fieldset_5_5').hide(); // fieldset 3d secure payment
$('#fieldset_6_6').hide(); // fieldset one click payment
$('#fieldset_7_7').hide(); // fieldset display create alias
$('#fieldset_8_8').hide(); // fieldset age checking option
//$('#fieldset_9_9').hide(); // fieldset age checking option
}
// this function reset options values to off
function resetOptionsValues() {
$('input[name="standard"][value=0]').prop('checked', true);
$('input[name="standard_min"]').val("0");
$('input[name="standard_max"]').val("0");
$('input[name="defered"][value=0]').prop('checked', true);
$('input[name="defered_min"]').val("0");
$('input[name="defered_max"]').val("0");
$('input[name="delivery"][value=0]').prop('checked', true);
$('input[name="delivery_min"]').val("0");
$('input[name="delivery_max"]').val("0");
$('input[name="ntimes"][value=0]').prop('checked', true);
$('input[name="ntimes_min"]').val("0");
$('input[name="ntimes_max"]').val("0");
$('input[name="secure"][value=0]').prop('checked', true);
$('input[name="secure_min"]').val("0");
$('input[name="secure_max"]').val("0");
$('input[name="oneclick"][value=0]').prop('checked', true);
$('input[name="oneclickcvv"][value=0]').prop('checked', true);
$('input[name="displaycreatealias"][value=0]').prop('checked', true);
$('input[name="ageverification"][value=0]').prop('checked', true);
}
function resetCountriesValues() {
$('.countries').prop('checked', false);
$('.countries').prop('disabled', true);
}
/******************/
/* Event watching */
/******************/
$('#b2b_xml_mode_code').change(function () {
showWarningMode();
});
/* if user changing value of currency */
$('#currency_iso').change(function () {
$('#loading').show();
resetOptionsValues();
updatePaymentList();
});
$('#b2b_xml_account_type_code').change(function () {
$('#loading').show();
updateModesList();
resetOptionsValues();
updateOptions();
resetCountriesValues();
updateCountries();
$('#name').val($('#b2b_xml_account_type_code').val());
$('input[name^="name_"]').val($('#b2b_xml_account_type_code option:selected').text());
});
// $('input[name="ntimes"]').parentsUntil('.form-wrapper').hide();
function showWarningMode() {
if ($('#b2b_xml_mode_code').val() != 'form')
$('#b2b_xml_mode_code').next('.help-block').show();
else
$('#b2b_xml_mode_code').next('.help-block').hide();
}
/* this function udpates account type list with selected currency */
function updatePaymentList() {
var selected_currency = $('option:selected', '#currency_iso').attr('value');
$.ajax({
type: "POST",
url: "{$link->getAdminLink('AdminManageBe2billConf')|escape:'htmlall':'UTF-8'}",
async: true,
dataType: "json",
data: {
ajax: "1",
token: "{$token|escape:'htmlall':'UTF-8'}",
tab: "AdminManageBe2billConf",
action: "searchAccountTypeByCurrency",
currency_search: selected_currency},
success: function (res)
{
$('#b2b_xml_account_type_code').find('option').remove();
if (res.found)
{
$.each(res.accounts, function ()
{
$('#b2b_xml_account_type_code').append('<option value="' + this.code + '">' + this.name + '</option>');
});
updateModesList();
$('#b2b_xml_account_type_code').parentsUntil('.form-wrapper').show();
$('#b2b_xml_account_type_code').parentsUntil('.form-wrapper').nextAll('.form-group').show();
updateOptions();
resetCountriesValues();
updateCountries();
$('#name').val($('#b2b_xml_account_type_code').val());
$('input[name^="name_"]').val($('#b2b_xml_account_type_code option:selected').text());
}
else
{
alert('{l s='No account type found, may be you need to upgrade your XML in module configuration' mod='be2bill'}');
$('#b2b_xml_account_type_code').parentsUntil('.form-wrapper').nextAll('.form-group').hide();
$('#b2b_xml_account_type_code').append('<option value="0">{l s='No account type found' mod='be2bill'}</option>');
}
}
});
}
/* this function udpates available modes list with selected account type */
function updateModesList() {
var selected_account = $('option:selected', '#b2b_xml_account_type_code').attr('value');
$.ajax({
type: "POST",
url: "{$link->getAdminLink('AdminManageBe2billConf')|escape:'htmlall':'UTF-8'}",
async: true,
dataType: "json",
data: {
ajax: "1",
token: "{$token|escape:'htmlall':'UTF-8'}",
tab: "AdminManageBe2billConf",
action: "searchModesByAccountType",
account_search: selected_account},
success: function (res)
{
$('#b2b_xml_mode_code').find('option').remove();
if (res.found)
{
$.each(res.modes, function ()
{
$('#b2b_xml_mode_code').append('<option value="' + this.id + '">' + this.label + '</option>');
});
}
else
{
$('#b2b_xml_mode_code').append('<option value="0">{l s='No mode found' mod='be2bill'}</option>');
}
}
});
}
function updateCountries() {
$('#warning_no_country').remove();
var selected_account = $('option:selected', '#b2b_xml_account_type_code').attr('value');
$.ajax({
type: "POST",
url: "{$link->getAdminLink('AdminManageBe2billConf')|escape:'htmlall':'UTF-8'}",
async: true,
dataType: "json",
data: {
ajax: "1",
token: "{$token|escape:'htmlall':'UTF-8'}",
tab: "AdminManageBe2billConf",
action: "searchGetCountriesRestriction",
account_search: selected_account},
success: function (res)
{
if (res.found == 'no-restriction')
{
$('.countries').prop('disabled', false);
}
else if (res.found == true)
{
var has_one_country = false;
$.each(res.countries, function ()
{
if ($('#countries_' + this.id + '').val())
has_one_country = true;
$('#countries_' + this.id + '').prop('disabled', false);
});
if (!has_one_country)
$('#fieldset_90_10').append('<p id="warning_no_country" style="color:red;">{l s='No country available in your shop active countries list' mod='be2bill'}</p>');
}
else
{
$('#fieldset_90_10').append('<p id="warning_no_country" style="color:red;">{l s='No country available in your shop active countries list' mod='be2bill'}</p>');
}
$('#loading').hide();
}
});
}
/* this function udpates available options list with selected account type */
function updateOptions() {
var selected_account = $('option:selected', '#b2b_xml_account_type_code').attr('value');
resetOptions();
/*$.ajax({
type: "POST",
url: "{$link->getAdminLink('AdminManageBe2billConf')|escape:'htmlall':'UTF-8'}",
async: false,
dataType: "json",
data: {
ajax: "1",
token: "{$token|escape:'htmlall':'UTF-8'}",
tab: "AdminManageBe2billConf",
action: "searchHasStandard",
account_search: selected_account},
success: function (res)
{
if (res.found)
{
$('#fieldset_1_1').show();
}
}
});
$.ajax({
type: "POST",
url: "{$link->getAdminLink('AdminManageBe2billConf')|escape:'htmlall':'UTF-8'}",
async: true,
dataType: "json",
data: {
ajax: "1",
token: "{$token|escape:'htmlall':'UTF-8'}",
tab: "AdminManageBe2billConf",
action: "searchHasDefered",
account_search: selected_account},
success: function (res)
{
if (res.found)
{
$('#fieldset_2_2').show();
$('#fieldset_3_3').show();
}
}
});*/
$.ajax({
type: "POST",
url: "{$link->getAdminLink('AdminManageBe2billConf')|escape:'htmlall':'UTF-8'}",
async: true,
dataType: "json",
data: {
ajax: "1",
token: "{$token|escape:'htmlall':'UTF-8'}",
tab: "AdminManageBe2billConf",
action: "searchOptionsByAccountType",
account_search: selected_account},
success: function (res)
{
if (res.found)
{
$.each(res.options, function ()
{
switch (this.code_option) {
case 'standard':
$('#fieldset_1_1').show();
break;
case 'defered':
$('#fieldset_2_2').show();
$('#fieldset_3_3').show();
break;
/*case 'at_delivery':
$('#fieldset_3_3').show();
break;*/
case 'ntimes':
$('#fieldset_4_4').show();
break;
case '3dsecure':
$('#fieldset_5_5').show();
break;
case 'oneclick':
$('#fieldset_6_6').show();
$('input[name="oneclickcvv"]').prop('disabled', true);
break;
case 'oneclickcvv':
//$('#fieldset_7_7').show();
$('input[name="oneclickcvv"]').prop('disabled', false);
break;
//case 'displaycreatealias':
//$('#fieldset_8_8').show();
//break;
case 'ageverification':
$('#fieldset_8_8').show();
break;
}
});
}
}
});
}
});
</script>
{/block}

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,15 @@
{/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
OK

View File

@ -0,0 +1,28 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
{capture name=path}{$module_display_name|escape:'htmlall':'UTF-8'}{/capture}
<h1 class="page-heading">{$module_display_name|escape:'htmlall':'UTF-8'}</h1>
{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}
{if isset($server_unavailable)}
<p><strong>{$module_display_name|escape:'htmlall':'UTF-8'}&nbsp;{l s='is not available.' mod='be2bill'}</strong></p>
<p class="cart_navigation">
<a href="{$link->getPageLink('order', true, null, "step=3")|escape:'htmlall':'UTF-8'}" class="button_large">{l s='Please, select another payment method.' mod='be2bill'}</a>
</p>
{else}
<iframe id="be2bill_iframe" class="be2bill-payment-iframe" src="{$link->getModuleLink($module_name|escape:'htmlall':'UTF-8', 'redirection', $url_params, true)}" scrolling="no" frameborder="0"></iframe>
{/if}

View File

@ -0,0 +1,107 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
{capture name=path}{$module_display_name|escape:'htmlall':'UTF-8'}{/capture}
{include file="$tpl_dir./errors.tpl"}
<h1 class="page-heading">{l s='Order summary' mod='be2bill'}</h1>
{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}
{if isset($nb_products) && $nb_products <= 0}
<p class="warning">{l s='Your shopping cart is empty.' mod='be2bill'}</p>
{else}
<h3>{$module_display_name|escape:'htmlall':'UTF-8'}</h3>
<form action="{$link->getModuleLink('be2bill', 'submit', [], true)|escape:'htmlall':'UTF-8'}" method="post">
<input type="hidden" name="id_account" value="{$id_account|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="option_code" value="{$option_code|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="use_oneclick_cvv" value="{$use_oneclick_cvv|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="operation_code" value="{$operation_code|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="option_name" value="{$option_name|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="amex" value="{$amex|escape:'htmlall':'UTF-8'}" />
<p>
<img src="{$smarty.const._MODULE_DIR_|escape:'htmlall':'UTF-8'}be2bill/views/img/be2bill.jpg" alt="{l s='Be2bill' mod='be2bill'}" width="86" height="49" style="float:left; margin: 0px 10px 5px 0px;" />
<strong>
{if $option_code == 'oneclick'}
{l s='You have chosen to pay with Be2bill in one click.' mod='be2bill'}
{else}
{l s='You have chosen to pay with Be2bill.' mod='be2bill'}
{/if}
</strong>
<br/><br />
{l s='Here is a short summary of your order:' mod='be2bill'}
</p>
<ul class="be2bill-payment-description">
<li>{l s='The total amount of your order comes to:' mod='be2bill'}
<span id="amount" class="price">{displayPrice price=$total}</span>
{if $use_taxes == 1}
{l s='(tax incl.)' mod='be2bill'}
{/if}
</li>
{if $has_alias}
<li>{l s='Your registered bank card number:' mod='be2bill'} {$card_number|escape:'htmlall':'UTF-8'}</li>
{/if}
</ul>
{if $has_oneclick && $has_alias_setting && $option_code != 'oneclick'}
<div class="checkbox">
<input type="checkbox" value="1" name="be2bill_create_alias" id="be2bill_create_alias" autocomplete="off"/>
<label for="be2bill_create_alias">
{if $has_alias}
{l s='Register a new bank card' mod='be2bill'}
{else}
{l s='Register your bank card data for a futur order' mod='be2bill'}
{/if}
</label>
</div>
{else}
<input type="hidden" value="0" name="be2bill_create_alias" id="be2bill_create_alias" />
{/if}
{if $option_code == 'oneclick' && !$use_oneclick_cvv}
{if $amex}
<p class="input-box">
<label class="required" for="be2bill_cvv_setter">{l s='Fill the last 4 numbers at the bottom of your bank card:' mod='be2bill'}</label>
<input type="password" value="" name="be2bill_cvv" size="4" maxlength="4" id="be2bill_cvv_setter" autocomplete="off" />
</p>
{else}
<p class="input-box">
<label class="required" for="be2bill_cvv_setter">{l s='Fill the last 3 numbers at the bottom of your bank card:' mod='be2bill'}</label>
<input type="password" value="" name="be2bill_cvv" size="3" maxlength="3" id="be2bill_cvv_setter" autocomplete="off" />
</p>
{/if}
{/if}
{if $has_ident_doc_id == '1' }
<p class="input-box">
<label class="required" for="be2bill_identification_setter">{l s='Personal id number:' mod='be2bill'}</label>
<input type="text" value="" name="be2bill_identification" size="64" maxlength="64" id="be2bill_identification_setter" autocomplete="off" />
</p>
{/if}
<p>
<b>{l s='Please confirm your order by clicking \'I confirm my order\'' mod='be2bill'}.</b>
</p>
<p class="cart_navigation">
<button type="submit" name="submitBe2billForm" class="button btn btn-default standard-checkout button-medium">
<span>
{l s='I confirm my order' mod='be2bill'}
<i class="icon-chevron-right right"></i>
</span>
</button>
<a href="{$link->getPageLink('order', true, null, "step=3")|escape:'htmlall':'UTF-8'}" class="button-exclusive btn btn-default">
<i class="icon-chevron-left"></i>
{l s='Other payment methods' mod='be2bill'}
</a>
</p>
</form>
{/if}

View File

@ -0,0 +1,53 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
{if !$use_iframe}
{capture name=path}{$module_display_name|escape:'htmlall':'UTF-8'}{/capture}
<h2>{$module_display_name|escape:'htmlall':'UTF-8'}</h2>
{/if}
<p>{l s='You will be redirected to payment platform in a few seconds.' mod='be2bill'}</p>
<p><a href="javascript:void(0)" onclick="document.getElementById('be2bill_form').submit();">{l s='Please click here if you are not automatically redirected.' mod='be2bill'}</a></p>
<form action="{$server_url|escape:'htmlall':'UTF-8'}" method="post" id="be2bill_form" class="hidden">
{*foreach from=$form_parameters key=name item=value}
{if is_array($value)}
{foreach from=$value key=name2 item=value2}
<input type="hidden" name="{$name|escape:'htmlall':'UTF-8'}[{$name2|escape:'htmlall':'UTF-8'}]" value="{$value2|escape:'htmlall':'UTF-8'}" />
{/foreach}
{else}
<input type="hidden" name="{$name|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
{/if}
{/foreach*}
{foreach from=$form_parameters key=name item=value}
{if is_array($value)}
{foreach from=$value key=name2 item=value2}
{if is_array($value2)}
{foreach from=$value2 key=name3 item=value3}
<input type="hidden" name="{$name|escape:'htmlall':'UTF-8'}[{$name2|escape:'htmlall':'UTF-8'}][{$name3|escape:'htmlall':'UTF-8'}]" value="{$value3|escape:'htmlall':'UTF-8'}" />
{/foreach}
{else}
<input type="hidden" name="{$name|escape:'htmlall':'UTF-8'}[{$name2|escape:'htmlall':'UTF-8'}]" value="{$value2|escape:'htmlall':'UTF-8'}" />
{/if}
{/foreach}
{else}
<input type="hidden" name="{$name|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
{/if}
{/foreach}
</form>
<script type="text/javascript">
{literal}
window.onload = function () {
document.getElementById('be2bill_form').submit();
};
{/literal}
</script>

View File

@ -0,0 +1,18 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
<script type="text/javascript">
if (window.top)
window.top.location.href = '{$link->getPageLink('order-confirmation', true, null, $confirmation_parameters, false, $id_shop|escape:'htmlall':'UTF-8')}';
</script>

View File

@ -0,0 +1,52 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
<div class="panel">
<div class="panel-heading">
<img src="{$smarty.const._MODULE_DIR_|escape:'htmlall':'UTF-8'}be2bill/views/img/be2bill.gif">{l s='Be2bill Alias' mod='be2bill'}
</div>
{if $aliases}
<table class="table" width="100%" cellspacing="0" cellpadding="0" id="be2bill_transaction_history_table">
<colgroup>
<col width=""/>
<col width=""/>
<col width=""/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th>{l s='Account' mod='be2bill'}</th>
<th>{l s='Alias' mod='be2bill'}</th>
<th>{l s='Card type' mod='be2bill'}</th>
<th>{l s='Card number' mod='be2bill'}</th>
<th>{l s='Expire Date' mod='be2bill'}</th>
</tr>
</thead>
<tbody>
{foreach from=$aliases key=k item=alias}
<tr>
<td>{$alias.code|escape:'htmlall':'UTF-8'}</td>
<td>{$alias.alias|escape:'htmlall':'UTF-8'}</td>
<td>{$alias.card_type|escape:'htmlall':'UTF-8'}</td>
<td>{$alias.card_number|escape:'htmlall':'UTF-8'}</td>
<td>{dateFormat date=$alias.date_end full=false}</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<p>{l s='No alias found' mod='be2bill'}</p>
{/if}
</div>

View File

@ -0,0 +1,149 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
<br />
<div class="panel">
<fieldset>
<legend><img src="{$smarty.const._MODULE_DIR_|escape:'htmlall':'UTF-8'}be2bill/views/img/be2bill.gif">{$module_name|escape:'htmlall':'UTF-8'}</legend>
{if isset($errors) && $errors}
<p class="error">
{foreach from=$errors key=k item=error}
{$error|escape:'htmlall':'UTF-8'}<br/>
{/foreach}
</p>
{/if}
<div class="be2bill-admin transaction">
<strong>{l s='Transaction history' mod='be2bill'}</strong>
{if $transaction_history}
<table class="table" width="100%" cellspacing="0" cellpadding="0" id="be2bill_transaction_history_table">
<colgroup>
<col width="15%"/>
<col width="12%"/>
<col width="15%"/>
<col width="10%"/>
<col width="10%"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th>{l s='Date' mod='be2bill'}</th>
<th>{l s='Transaction ID' mod='be2bill'}</th>
<th>{l s='Transaction type' mod='be2bill'}</th>
<th>{l s='Amount' mod='be2bill'}</th>
<th>{l s='EXECCODE' mod='be2bill'}</th>
<th>{l s='Server message' mod='be2bill'}</th>
</tr>
</thead>
<tbody>
{foreach from=$transaction_history item=row}
<tr>
<td>{dateFormat date=$row.date_add full=true}</td>
<td>{$row.transaction_id|escape:'htmlall':'UTF-8'}</td>
<td>{$row.transaction_type|escape:'htmlall':'UTF-8'}</td>
<td>{displayPrice price=$row.amount currency=$order->id_currency}</td>
<td>{$row.execcode|escape:'htmlall':'UTF-8'}</td>
<td>{$row.message|escape:'htmlall':'UTF-8'}</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<p>{l s='No transaction found' mod='be2bill'}</p>
{/if}
</div>
{if $transaction_history && $can_refund}
<br />
<div class="be2bill-admin refund">
<strong>{l s='Transaction refund' mod='be2bill'}</strong>
{if $slips}
<form action="{$currentIndex|escape:'htmlall':'UTF-8'}&id_order={$order->id|escape:'htmlall':'UTF-8'}&vieworder&token={$smarty.get.token|escape:'htmlall':'UTF-8'}" method="post" autocomplete="off">
<div style="margin-bottom:5px;">
<ul>
<li>{l s='Select a transaction and a slip to refund:' mod='be2bill'}</li>
</ul>
<p>
{if $refundable_transaction}
<select name="be2bill_refund_transaction" style="width:25%; margin: 1px;">
<option value="">{l s='Select a transaction' mod='be2bill'}</option>
{foreach from=$refundable_transaction item=transaction}
<option value="{$transaction.transaction_id|escape:'htmlall':'UTF-8'}">{$transaction.transaction_id|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
<select name="be2bill_refund_slip" style="width:25%; margin: 1px;">
<option value="">{l s='Select a slip' mod='be2bill'}</option>
{foreach from=$slips item=slip}
<option value="{$slip.id_order_slip|escape:'htmlall':'UTF-8'}">[{l s='Slip #' mod='be2bill'}{$slip.id_order_slip|escape:'htmlall':'UTF-8'}] {displayPrice price=$slip.amount currency=$order->id_currency}</option>
{/foreach}
</select>
<input type="submit" name="submitBe2billRefund" value="{l s='Refund' mod='be2bill'}" class="button" />
{else}
{l s='There is no refundable transaction.' mod='be2bill'}
{/if}
</p>
</div>
</form>
{else}
<ul>
<li>{l s='Please create a refundable slip before refund transaction.' mod='be2bill'}</li>
</ul>
{/if}
</div>
{/if}
{if $schedule}
<br />
<div class="be2bill-admin schedule">
<strong>{l s='Schedule' mod='be2bill'}</strong>
<table class="table" width="100%" cellspacing="0" cellpadding="0" id="be2bill_schedule_table">
<colgroup>
<col width="15%"/>
<col width="15%"/>
<col width="12%"/>
<col width="15%"/>
<col width="15%"/>
<col width=""/>
</colgroup>
<thead>
<tr>
<th>{l s='Date' mod='be2bill'}</th>
<th>{l s='Transaction ID' mod='be2bill'}</th>
<th>{l s='Amount' mod='be2bill'}</th>
<th>{l s='Scheduled date' mod='be2bill'}</th>
<th>{l s='Capture date' mod='be2bill'}</th>
<th>{l s='Is captured' mod='be2bill'}</th>
</tr>
</thead>
<tbody>
{foreach from=$schedule item=row}
<tr>
<td>{dateFormat date=$row.date_add full=true}</td>
<td>{$row.transaction_id|escape:'htmlall':'UTF-8'}</td>
<td>{displayPrice price=$row.amount currency=$order->id_currency}</td>
<td>{dateFormat date=$row.date_scheduled full=true}</td>
<td>{dateFormat date=$row.date_done full=true}</td>
<td>
{if $row.is_done}
<img src="{$smarty.const._PS_ADMIN_IMG_|escape:'htmlall':'UTF-8'}enabled.gif" />
{else}
<img src="{$smarty.const._PS_ADMIN_IMG_|escape:'htmlall':'UTF-8'}disabled.gif" />
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
</fieldset>
</div>

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,125 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
{** Be2bill standard payment **}
{*
* Template for 1.6+
*}
{if isset($available_payments) && $available_payments}
{foreach from=$available_payments item=payment name=payments}
{foreach from=$payment.options item=option}
{if $option.b2b_xml_option != 'oneclick'}
<div class="row">
<div class="col-xs-12">
<p class="payment_module">
<a href="javascript:void(0)" onclick="$('#be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}').submit();" class="be2bill_link16" title="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}">
<img class="logo_be2bill" src="{if $payment.logo_url}{$base_dir|escape:'htmlall':'UTF-8'}modules/be2bill/views/img/{$payment.logo_url|escape:'htmlall':'UTF-8'}{/if}" />{$payment.name|escape:'htmlall':'UTF-8'}
{if $option.b2b_xml_option == 'defered'} - {l s='defered' mod='be2bill'} - {l s='You will be debited in' mod='be2bill'}&nbsp;<strong>{$option.b2b_xml_option_extra|escape:'htmlall':'UTF-8'}&nbsp;{l s='day(s)' mod='be2bill'}</strong>
{/if}
{if $option.b2b_xml_option == 'delivery'} - {l s='at delivery' mod='be2bill'}{/if}
{if $option.b2b_xml_option == 'ntimes'} - {l s='in n times' mod='be2bill'}{/if}
</a>
</p>
</div>
</div>
{if $redirect_auto || $payment.mode != 'form'}
{if $option.has_ident_doc_id == '1'}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" action="{$link->getModuleLink('be2bill', 'payment', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
<input type="hidden" value="1" name="has_ident_doc_id" />
{else}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" action="{$link->getModuleLink('be2bill', 'submit', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
{/if}
{else}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" action="{$link->getModuleLink('be2bill', 'payment', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
{/if}
<input type="hidden" value="{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}" name="id_account" />
<input type="hidden" value="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" name="option_code" />
<input type="hidden" value="{$payment.mode|escape:'htmlall':'UTF-8'}" name="payment_mode" />
</form>
{/if}
{if $option.b2b_xml_option == 'oneclick' && $payment.has_alias}
{if $payment.has_standard}
<div class="row">
<div class="col-xs-12">
<p class="payment_module">
<a href="javascript:void(0)" onclick="$('#be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_standard').submit();" class="be2bill_link16" title="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}">
<img class="logo_be2bill" src="{if $payment.logo_url}{$base_dir|escape:'htmlall':'UTF-8'}modules/be2bill/views/img/{$payment.logo_url|escape:'htmlall':'UTF-8'}{/if}" />
{$payment.name|escape:'htmlall':'UTF-8'} - {l s='in one click' mod='be2bill'}
</a>
</p>
</div>
</div>
{if $payment.has_oneclickcvv}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_standard" action="{$link->getModuleLink('be2bill', 'submit', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
<input type="hidden" name="use_oneclick_cvv" value="1" />
{else}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_standard" action="{$link->getModuleLink('be2bill', 'payment', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
{/if}
<input type="hidden" value="{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}" name="id_account" />
<input type="hidden" value="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" name="option_code" />
<input type="hidden" value="payment" name="operation_code" />
</form>
{/if}
{if $payment.has_defered}
<div class="row">
<div class="col-xs-12">
<p class="payment_module">
<a href="javascript:void(0)" onclick="$('#be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_defered').submit();" class="be2bill_link16" title="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}">
<img class="logo_be2bill" src="{if $payment.logo_url}{$base_dir|escape:'htmlall':'UTF-8'}modules/be2bill/views/img/{$payment.logo_url|escape:'htmlall':'UTF-8'}{/if}" />
{$payment.name|escape:'htmlall':'UTF-8'} - {l s='defered' mod='be2bill'} {l s='in one click' mod='be2bill'}
</a>
</p>
</div>
</div>
{if $payment.has_oneclickcvv}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_defered" action="{$link->getModuleLink('be2bill', 'submit', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
<input type="hidden" name="use_oneclick_cvv" value="1" />
{else}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_defered" action="{$link->getModuleLink('be2bill', 'payment', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
{/if}
<input type="hidden" value="{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}" name="id_account" />
<input type="hidden" value="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" name="option_code" />
<input type="hidden" value="authorization" name="operation_code" />
<input type="hidden" value="defered" name="option_name" />
</form>
{/if}
{if $payment.has_delivery}
<div class="row">
<div class="col-xs-12">
<p class="payment_module">
<a href="javascript:void(0)" onclick="$('#be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_delivery').submit();" class="be2bill_link16" title="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}">
<img class="logo_be2bill" src="{if $payment.logo_url}{$base_dir|escape:'htmlall':'UTF-8'}modules/be2bill/views/img/{$payment.logo_url|escape:'htmlall':'UTF-8'}{/if}" />
{$payment.name|escape:'htmlall':'UTF-8'} - {l s='at delivery' mod='be2bill'} {l s='in one click' mod='be2bill'}
</a>
</p>
</div>
</div>
{if $payment.has_oneclickcvv}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_delivery" action="{$link->getModuleLink('be2bill', 'submit', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
<input type="hidden" name="use_oneclick_cvv" value="1" />
{else}
<form id="be2bill_payment_form_{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}_oneclick_delivery" action="{$link->getModuleLink('be2bill', 'payment', [], true)|escape:'htmlall':'UTF-8'}" title="{$option.b2b_xml_option|cat :'_label'|escape:'htmlall':'UTF-8'}" method="post">
{/if}
<input type="hidden" value="{$payment.id_b2b_merchand_configuration_account|escape:'htmlall':'UTF-8'}" name="id_account" />
<input type="hidden" value="{$option.b2b_xml_option|escape:'htmlall':'UTF-8'}" name="option_code" />
<input type="hidden" value="authorization" name="operation_code" />
<input type="hidden" value="delivery" name="option_name" />
</form>
{/if}
{/if}
{/foreach}
{/foreach}
{/if}

View File

@ -0,0 +1,48 @@
{**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*}
<div id="be2bill_payment_return">
{if $is_payment_ok}
<h2>{l s='Payment successfull' mod='be2bill'}</h2>
<p>
{l s='Payment amount:' mod='be2bill'} <span class="price"><strong>{$total_to_pay|escape:'htmlall':'UTF-8'}</strong></span><br/><br/>
{l s='Order Reference:' mod='be2bill'} <strong>{$order->reference|escape:'htmlall':'UTF-8'}</strong><br/><br/>
{l s='Thank you for this order, you will quickly receive an email confirmation to your address:' mod='be2bill'} <span>{$customer->email|escape:'htmlall':'UTF-8'}</span>
</p>
{elseif $partial_paid}
<h2>{l s='Order amount paid Partially' mod='be2bill'}</h2>
<p class="warning">
{l s='Total paid:' mod='be2bill'} <span class="price"><strong>{$order->total_paid_real|escape:'htmlall':'UTF-8'}</strong></span><br/><br/>
{l s='Order amount:' mod='be2bill'} <span class="price"><strong>{$order->total_paid|escape:'htmlall':'UTF-8'}</strong></span><br/><br/>
{l s='Order Reference:' mod='be2bill'} <strong>{$order->reference|escape:'htmlall':'UTF-8'}</strong><br/><br/>
<b>{l s='Please contact us to regularize your order.' mod='be2bill'}</b>
</p>
{elseif $is_waiting}
<h2>{l s='Payment waiting for bank return' mod='be2bill'}</h2>
<p class="warning">
{l s='The payment return from the bank is still not arrived.' mod='be2bill'}<br />
{l s='You can follow the progress of your order at' mod='be2bill'}
<strong><a href="{$link->getPageLink('history', true)|escape:'htmlall':'UTF-8'}" title="{l s='Back to orders' mod='be2bill'}">{l s='this address.' mod='be2bill'}</a></strong>
</p>
{else}
<h2>{l s='Payment Error' mod='be2bill'}</h2>
<p class="error">
{l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='be2bill'} <strong><a href="{$link->getPageLink('contact', true)|escape:'htmlall':'UTF-8'}">{l s='customer support' mod='be2bill'}</a></strong>.
</p>
<p class="cart_navigation">
<a href="{$link->getModuleLink('be2bill', 'reorder',['id_order' => $order->id], true)|escape:'htmlall':'UTF-8'}" class="button_large">{l s='Order again' mod='be2bill'}</a>
</p>
{/if}
</div>

View File

@ -0,0 +1,25 @@
<?php
/**
* 1997-2016 Quadra Informatique
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0) that is available
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0
* If you are unable to obtain it through the world-wide-web, please send an email
* to modules@quadra-informatique.fr so we can send you a copy immediately.
*
* @author Quadra Informatique <modules@quadra-informatique.fr>
* @copyright 1997-2016 Quadra Informatique
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1 @@
# Paiement Be2Bill

View File

@ -0,0 +1,83 @@
<?php
/**
* Cw06be2billConfirmationModuleFrontController class file
*
* PHP Version 5
*
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe CREAWEB06
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la société CREAWEB06
* est expressement interdite.
* Pour obtenir une licence, veuillez contacter la société CREAWEB06 a l'adresse:
* contact@creaweb06.fr
*
* @category class
* @package cw06be2bill
* @author CREAWEB06
* @copyright CREAWEB06
* @license Commercial License
* @link http://www.creaweb06.fr/
*/
class Cw06be2billConfirmationModuleFrontController extends ModuleFrontController
{
public function postProcess()
{
$params = $_GET;
if (isset($params['module'])) {
unset($params['module']);
}
if (isset($params['controller'])) {
unset($params['controller']);
}
if (isset($params['fc'])) {
unset($params['fc']);
}
// check hash signature
if ($this->module->be2billSignature($params) == $params['HASH']) {
if (Tools::getValue('OPERATIONTYPE') == 'payment') {
$cart_id = (int)Tools::substr(Tools::getValue('ORDERID'), 0, -4);
$amount = (float)Tools::getValue('AMOUNT') / 100;
$cart = new Cart($cart_id);
$extradata = unserialize(base64_decode(Tools::getValue('EXTRADATA')));
$nb_payment = (int)Tools::substr($extradata['TYPE'], 0, 1);
// check if order exist for this cart
$order_id = Order::getOrderByCartId($cart_id);
// redirect to the good store in multistore
if ($cart->id_shop != Context::getContext()->shop->id) {
Tools::redirectLink(Context::getContext()->link->getModuleLink($this->module->name, 'confirmation', array(), null, $cart->id_lang, $cart->id_shop).'?'.getenv('QUERY_STRING'));
}
if ($order_id) {
$module_id = $this->module->id;
$secure_key = Context::getContext()->customer->secure_key;
$return_url = Context::getContext()->link->getPageLink('order-confirmation', null, null, 'id_cart='.$cart_id.'&id_module='.$module_id.'&id_order='.$order_id.'&key='.$secure_key);
Context::getContext()->cookie->__set('cw06be2bill_nb_payments', $nb_payment);
Context::getContext()->cookie->write();
Tools::redirectLink($return_url);
exit;
} else {
$this->errors[] = $this->module->l('An error occured. Please contact us for more informations.');
}
}
} else {
$this->errors[] = $this->module->l('Hacking attempt ! You are not allowed to access to this page !');
}
return $this->setTemplate('error.tpl');
}
}

View File

@ -1,13 +1,13 @@
<?php
/*
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
@ -18,18 +18,18 @@
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header("Location: ../");
header('Location: ../');
exit;

View File

@ -0,0 +1,111 @@
<?php
/**
* Cw06be2billValidationModuleFrontController class file
*
* PHP Version 5
*
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe CREAWEB06
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la société CREAWEB06
* est expressement interdite.
* Pour obtenir une licence, veuillez contacter la société CREAWEB06 a l'adresse:
* contact@creaweb06.fr
*
* @category class
* @package cw06be2bill
* @author CREAWEB06
* @copyright CREAWEB06
* @license Commercial License
* @link http://www.creaweb06.fr/
*/
class Cw06be2billValidationModuleFrontController extends ModuleFrontController
{
/**
* This class should be use by your Instant Payment
* Notification system to validate the order remotely
*/
public function postProcess()
{
if ($this->module->active == false) {
die;
}
/**
* Check hash signature
*/
if ($this->module->be2billSignature($_POST) == Tools::getValue('HASH')) {
// if operation is a payment
if (Tools::getValue('OPERATIONTYPE') == 'payment') {
$cart_id = (int)Tools::substr(Tools::getValue('ORDERID'), 0, -4);
//$amount = (float)Tools::getValue('AMOUNT') / 100;
$extradata = unserialize(base64_decode(Tools::getValue('EXTRADATA')));
$amount = (float)($extradata['INITIAL_AMOUNT'] / 100);
$nb_payment = (int)Tools::substr($extradata['TYPE'], 0, 1);
Context::getContext()->cart = new Cart((int)$cart_id);
Context::getContext()->customer = new Customer((int)Context::getContext()->cart->id_customer);
Context::getContext()->currency = new Currency((int)Context::getContext()->cart->id_currency);
Context::getContext()->language = new Language((int)Context::getContext()->customer->id_lang);
$secure_key = Context::getContext()->customer->secure_key;
// order already exist
$order = Order::getOrderByCartId((int)Context::getContext()->cart->id);
if ($order) {
exit('OK');
}
$validation_on_error = (bool)Configuration::get('CW06BE2BILL_CREATE_ORDER_ERROR');
$to_validate = false;
if (Tools::getValue('EXECCODE') == '0000') {
$payment_status = Configuration::get('PS_OS_PAYMENT');
$to_validate = true;
} else {
$payment_status = Configuration::get('PS_OS_ERROR');
if ($validation_on_error) {
$new_cart = Context::getContext()->cart->duplicate();
if (is_array($new_cart)) {
Context::getContext()->cart = $new_cart['cart'];
$to_validate = true;
}
}
}
$message = Tools::getValue('MESSAGE');
$currency_id = (int)Context::getContext()->currency->id;
$module_name = $this->module->getPaymentName($nb_payment);
if ($to_validate) {
$this->module->validateOrder(
Context::getContext()->cart->id,
$payment_status,
$amount,
$module_name,
$message,
array('transaction_id' => Tools::getValue('TRANSACTIONID')),
$currency_id,
false,
$secure_key
);
}
exit('OK');
}
} else {
exit('Hack attempt !');
}
}
}

View File

@ -1,13 +1,13 @@
<?php
/*
* 2007-2014 PrestaShop
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
@ -18,18 +18,18 @@
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header("Location: ../");
header('Location: ../');
exit;

View File

@ -0,0 +1,601 @@
<?php
/**
* Cw06be2bill class file
*
* PHP Version 5
*
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe CREAWEB06
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL CREAWEB06
* est expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL CREAWEB06 a l'adresse:
* contact@creaweb06.fr
*
* @category class
* @package cw06be2bill
* @author CREAWEB06
* @copyright CREAWEB06
* @license Commercial License
* @link http://www.creaweb06.fr/
*/
if (!defined('_PS_VERSION_')) {
exit;
}
require_once dirname(__FILE__).'/vendors/be2bill/scripts/autoload.php';
class Cw06be2bill extends PaymentModule
{
protected $config_form = false;
public function __construct()
{
$this->name = 'cw06be2bill';
$this->tab = 'payments_gateways';
$this->version = '1.0.7';
$this->author = 'CREAWEB06';
$this->need_instance = 0;
$this->bootstrap = true;
$this->module_key = 'bc8cd642c2f96aa80fa23b463f060aa9';
parent::__construct();
if (Tools::getValue('controller') == 'orderconfirmation') {
$this->displayName = $this->getPaymentName((int)Context::getContext()->cookie->__get('cw06be2bill_nb_payments'));
} else {
$this->displayName = $this->l('Payments with Be2Bill');
}
$this->description = $this->l('Secure payment with be2bill : cash payments and multiple payments');
$this->confirmUninstall = $this->l('Are you sure you want to delete this module ?');
$this->limited_countries = array('FR','EN','DE','ES','IT','NL','CN','RU','PT','CZ');
$this->limited_currencies = array('EUR');
}
public function install()
{
$iso_code = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'));
if (in_array($iso_code, $this->limited_countries) == false) {
$this->_errors[] = $this->l('This module is not available in your country');
return false;
}
Configuration::updateValue('CW06BE2BILL_IDENTIFIER', null);
Configuration::updateValue('CW06BE2BILL_PASSWORD', null);
Configuration::updateValue('CW06BE2BILL_1X_3DS', 0);
return parent::install() &&
$this->registerHook('displayOrderConfirmation') &&
$this->registerHook('displayPayment');
}
public function uninstall()
{
Configuration::deleteByName('CW06BE2BILL_IDENTIFIER');
Configuration::deleteByName('CW06BE2BILL_PASSWORD');
Configuration::deleteByName('CW06BE2BILL_1X_3DS');
return parent::uninstall();
}
public function getContent()
{
if (((bool)Tools::isSubmit('submitCw06be2billModule')) == true) {
$this->postProcess();
}
$this->context->smarty->assign('module_dir', $this->_path);
$this->context->smarty->assign('link', $this->context->link);
return $this->renderForm();
}
protected function renderForm()
{
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$helper->module = $this;
$helper->default_form_language = $this->context->language->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);
$helper->identifier = $this->identifier;
$helper->submit_action = 'submitCw06be2billModule';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)
.'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = array(
'fields_value' => $this->getConfigFormValues(), /* Add values for your inputs */
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id,
);
return $helper->generateForm($this->getConfigForm());
}
protected function getConfigForm()
{
return array(
0 => array(
'form' => array(
'legend' => array(
'title' => $this->l('Settings'),
'icon' => 'icon-cogs',
),
'input' => array(
array(
'type' => (_PS_VERSION_ >= '1.6' ? 'switch' : 'radio'),
'label' => $this->l('Test mode'),
'class' => 't',
'name' => 'CW06BE2BILL_TEST_MODE',
'is_bool' => true,
'desc' => $this->l('Use this module in test mode'),
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-envelope"></i>',
'desc' => $this->l('Enter your Be2Bill identifier'),
'name' => 'CW06BE2BILL_IDENTIFIER',
'label' => $this->l('Identifier'),
),
array(
'type' => 'password',
'name' => 'CW06BE2BILL_PASSWORD',
'desc' => $this->l('Enter your Be2Bill password'),
'label' => $this->l('Password'),
),
array(
'type' => (_PS_VERSION_ >= '1.6' ? 'switch' : 'radio'),
'label' => $this->l('Make an order if payment refused'),
'name' => 'CW06BE2BILL_CREATE_ORDER_ERROR',
'is_bool' => true,
'class' => 't',
'desc' => $this->l('Customer cart is preserved'),
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-envelope"></i>',
'name' => 'NOTIF_URL',
'readonly' => 'readonly',
'label' => $this->l('Notification URL'),
'size' => _PS_VERSION_ < '1.6' ? '100' : null,
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-envelope"></i>',
'name' => 'REDIRECT_URL',
'readonly' => 'readonly',
'label' => $this->l('Redirection URL'),
'size' => _PS_VERSION_ < '1.6' ? '100' : null,
)
),
'submit' => array(
'title' => $this->l('Save'),
),
),
),
1 => array(
'form' => array(
'legend' => array(
'title' => $this->l('Simple payment'),
'icon' => 'icon-cogs',
),
'input' => array(
array(
'type' => (_PS_VERSION_ >= '1.6' ? 'switch' : 'radio'),
'label' => $this->l('Enable this payment mode'),
'name' => 'CW06BE2BILL_1X_ACTIVE',
'is_bool' => true,
'class' => 't',
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-euro"></i>',
'name' => 'CW06BE2BILL_1X_MINIMUM_AMOUNT',
'label' => $this->l('Minimum order'),
'desc' => $this->l('Leave empty or 0 to disable'),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-euro"></i>',
'name' => 'CW06BE2BILL_1X_MAXIMUM_AMOUNT',
'label' => $this->l('Maximum order'),
'desc' => $this->l('Leave empty or 0 to disable'),
),
array(
'type' => (_PS_VERSION_ >= '1.6' ? 'switch' : 'radio'),
'label' => $this->l('Enable 3D-Secure'),
'name' => 'CW06BE2BILL_1X_3DS_ACTIVE',
'class' => 't',
'is_bool' => true,
'class' => 't',
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-euro"></i>',
'name' => 'CW06BE2BILL_1X_3DS_MIN_AMOUNT',
'label' => $this->l('Minimum order amount to active 3D-Secure, if 3D-Secure is enable'),
'desc' => $this->l('Leave empty or 0 to disable'),
),
),
'submit' => array(
'title' => $this->l('Save'),
),
),
),
2 => array(
'form' => array(
'legend' => array(
'title' => $this->l('Multiple payment'),
'icon' => 'icon-cogs',
),
'input' => array(
array(
'type' => (_PS_VERSION_ >= '1.6' ? 'switch' : 'radio'),
'label' => $this->l('Enable this payment mode'),
'name' => 'CW06BE2BILL_NX_ACTIVE',
'is_bool' => true,
'class' => 't',
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '2 ~ 4',
'name' => 'CW06BE2BILL_NX_NB_PAYMENTS',
'label' => $this->l('Number of payments'),
'desc' => $this->l('Between 2 and 4 payments'),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '%',
'name' => 'CW06BE2BILL_NX_PERCENT_F_PAYMENT',
'label' => $this->l('Percent of the first payment'),
'desc' => $this->l('Example : 40 = 40% of total amount for the first payment. 0 make equals payments.'),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-euro"></i>',
'name' => 'CW06BE2BILL_NX_MINIMUM_AMOUNT',
'label' => $this->l('Minimum order'),
'desc' => $this->l('Leave empty or 0 to disable'),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-euro"></i>',
'name' => 'CW06BE2BILL_NX_MAXIMUM_AMOUNT',
'label' => $this->l('Maximum order'),
'desc' => $this->l('Leave empty or 0 to disable'),
),
array(
'type' => (_PS_VERSION_ >= '1.6' ? 'switch' : 'radio'),
'label' => $this->l('Enable 3D-Secure'),
'name' => 'CW06BE2BILL_NX_3DS_ACTIVE',
'desc' => 'Only for the first payment',
'class' => 't',
'is_bool' => true,
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->l('Disabled')
)
),
),
array(
'col' => 3,
'type' => 'text',
'prefix' => '<i class="icon icon-euro"></i>',
'name' => 'CW06BE2BILL_NX_3DS_MIN_AMOUNT',
'label' => $this->l('Minimum order amount to active 3D-Secure, if 3D-Secure is enable'),
'desc' => $this->l('Leave empty or 0 to disable'),
),
),
'submit' => array(
'title' => $this->l('Save'),
),
),
)
);
}
protected function getConfigFormValues()
{
return array(
'CW06BE2BILL_TEST_MODE' => (bool)Configuration::get('CW06BE2BILL_TEST_MODE'),
'CW06BE2BILL_IDENTIFIER' => Configuration::get('CW06BE2BILL_IDENTIFIER'),
'CW06BE2BILL_PASSWORD' => Configuration::get('CW06BE2BILL_PASSWORD'),
'CW06BE2BILL_CREATE_ORDER_ERROR' => Configuration::get('CW06BE2BILL_CREATE_ORDER_ERROR'),
'CW06BE2BILL_1X_ACTIVE' => (bool)Configuration::get('CW06BE2BILL_1X_ACTIVE'),
'CW06BE2BILL_1X_MINIMUM_AMOUNT' => (float)Configuration::get('CW06BE2BILL_1X_MINIMUM_AMOUNT'),
'CW06BE2BILL_1X_MAXIMUM_AMOUNT' => (float)Configuration::get('CW06BE2BILL_1X_MAXIMUM_AMOUNT'),
'CW06BE2BILL_1X_3DS_ACTIVE' => (bool)Configuration::get('CW06BE2BILL_1X_3DS_ACTIVE', false),
'CW06BE2BILL_1X_3DS_MIN_AMOUNT' => (float)Configuration::get('CW06BE2BILL_1X_3DS_MIN_AMOUNT'),
'CW06BE2BILL_NX_ACTIVE' => (bool)Configuration::get('CW06BE2BILL_NX_ACTIVE'),
'CW06BE2BILL_NX_NB_PAYMENTS' => (int)Configuration::get('CW06BE2BILL_NX_NB_PAYMENTS'),
'CW06BE2BILL_NX_PERCENT_F_PAYMENT' => (float)Configuration::get('CW06BE2BILL_NX_PERCENT_F_PAYMENT'),
'CW06BE2BILL_NX_MINIMUM_AMOUNT' => (float)Configuration::get('CW06BE2BILL_NX_MINIMUM_AMOUNT'),
'CW06BE2BILL_NX_MAXIMUM_AMOUNT' => (float)Configuration::get('CW06BE2BILL_NX_MAXIMUM_AMOUNT'),
'CW06BE2BILL_NX_3DS_ACTIVE' => (bool)Configuration::get('CW06BE2BILL_NX_3DS_ACTIVE'),
'CW06BE2BILL_NX_3DS_MIN_AMOUNT' => (float)Configuration::get('CW06BE2BILL_NX_3DS_MIN_AMOUNT'),
'REDIRECT_URL' => $this->context->link->getModuleLink('cw06be2bill', 'confirmation'),
'NOTIF_URL' => $this->context->link->getModuleLink('cw06be2bill', 'validation'),
);
}
protected function postProcess()
{
Configuration::updateValue('CW06BE2BILL_TEST_MODE', (bool)Tools::getValue('CW06BE2BILL_TEST_MODE'));
Configuration::updateValue('CW06BE2BILL_IDENTIFIER', Tools::getValue('CW06BE2BILL_IDENTIFIER'));
if (Tools::getValue('CW06BE2BILL_PASSWORD')) {
Configuration::updateValue('CW06BE2BILL_PASSWORD', Tools::getValue('CW06BE2BILL_PASSWORD'));
}
Configuration::updateValue('CW06BE2BILL_CREATE_ORDER_ERROR', (bool)Tools::getValue('CW06BE2BILL_CREATE_ORDER_ERROR'));
Configuration::updateValue('CW06BE2BILL_1X_ACTIVE', (bool)Tools::getValue('CW06BE2BILL_1X_ACTIVE'));
Configuration::updateValue('CW06BE2BILL_1X_MINIMUM_AMOUNT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_1X_MINIMUM_AMOUNT')));
Configuration::updateValue('CW06BE2BILL_1X_MAXIMUM_AMOUNT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_1X_MAXIMUM_AMOUNT')));
Configuration::updateValue('CW06BE2BILL_1X_3DS_ACTIVE', (bool)Tools::getValue('CW06BE2BILL_1X_3DS_ACTIVE'));
Configuration::updateValue('CW06BE2BILL_1X_3DS_MIN_AMOUNT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_1X_3DS_MIN_AMOUNT')));
Configuration::updateValue('CW06BE2BILL_NX_ACTIVE', (bool)Tools::getValue('CW06BE2BILL_NX_ACTIVE'));
Configuration::updateValue('CW06BE2BILL_NX_NB_PAYMENTS', (int)Tools::getValue('CW06BE2BILL_NX_NB_PAYMENTS'));
Configuration::updateValue('CW06BE2BILL_NX_PERCENT_F_PAYMENT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_NX_PERCENT_F_PAYMENT')));
Configuration::updateValue('CW06BE2BILL_NX_MINIMUM_AMOUNT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_NX_MINIMUM_AMOUNT')));
Configuration::updateValue('CW06BE2BILL_NX_MAXIMUM_AMOUNT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_NX_MAXIMUM_AMOUNT')));
Configuration::updateValue('CW06BE2BILL_NX_3DS_ACTIVE', (bool)Tools::getValue('CW06BE2BILL_NX_3DS_ACTIVE'));
Configuration::updateValue('CW06BE2BILL_NX_3DS_MIN_AMOUNT', (float)str_replace(',', '.', Tools::getValue('CW06BE2BILL_NX_3DS_MIN_AMOUNT')));
}
public function hookDisplayPayment($params)
{
$currency_id = $params['cart']->id_currency;
$currency = new Currency((int)$currency_id);
if (in_array($currency->iso_code, $this->limited_currencies) == false) {
return false;
}
$this->smarty->assign('module_dir', $this->_path);
$config = $this->getConfigFormValues();
if ($config['CW06BE2BILL_TEST_MODE']) {
$be2bill = Be2bill_Api_ClientBuilder::buildSandboxFormClient($config['CW06BE2BILL_IDENTIFIER'], $config['CW06BE2BILL_PASSWORD']);
} else {
$be2bill = Be2bill_Api_ClientBuilder::buildProductionFormClient($config['CW06BE2BILL_IDENTIFIER'], $config['CW06BE2BILL_PASSWORD']);
}
$total_cart = $this->context->cart->getOrderTotal(true, 3);
$total_cart_cts = $total_cart * 100;
if ($config['CW06BE2BILL_1X_ACTIVE']
&& ($config['CW06BE2BILL_1X_MINIMUM_AMOUNT'] == 0 || $config['CW06BE2BILL_1X_MINIMUM_AMOUNT'] <= $total_cart)
&& ($config['CW06BE2BILL_1X_MAXIMUM_AMOUNT'] == 0 || $config['CW06BE2BILL_1X_MAXIMUM_AMOUNT'] >= $total_cart)) {
$payment_1x = $be2bill->buildPaymentFormButton(
$total_cart_cts,
$this->context->cart->id.date('is'),
$this->context->customer->id,
$this->l('Cart ID : ').$this->context->cart->id,
$htmlOptions = array(
'FORM' => array(
'id' => 'cw06be2bill_payment_1x',
'style' => 'display:none;'
)
),
$options = array(
'EXTRADATA' => base64_encode(serialize(array('TYPE'=>'1X','INITIAL_AMOUNT'=>$total_cart_cts))),
'CLIENTEMAIL' => $this->context->customer->email,
'CARDFULLNAME' => $this->context->customer->firstname.' '.$this->context->customer->lastname,
'3DSECURE' => $config['CW06BE2BILL_1X_3DS_ACTIVE'] && $config['CW06BE2BILL_1X_3DS_MIN_AMOUNT'] < $total_cart ? 'yes' : 'no',
'HIDECLIENTEMAIL' => 'yes',
'HIDECARDFULLNAME' => 'yes'
)
);
$this->context->smarty->assign('payment_1x', $payment_1x);
}
if ($config['CW06BE2BILL_NX_ACTIVE']
&& ($config['CW06BE2BILL_NX_MINIMUM_AMOUNT'] == 0 || $config['CW06BE2BILL_NX_MINIMUM_AMOUNT'] <= $total_cart)
&& ($config['CW06BE2BILL_NX_MAXIMUM_AMOUNT'] == 0 || $config['CW06BE2BILL_NX_MAXIMUM_AMOUNT'] >= $total_cart)
&& $config['CW06BE2BILL_NX_NB_PAYMENTS'] >= 2 && $config['CW06BE2BILL_NX_NB_PAYMENTS'] <= 4) {
if ($config['CW06BE2BILL_NX_PERCENT_F_PAYMENT'] > 0) {
$first_payment = round(($total_cart * $config['CW06BE2BILL_NX_PERCENT_F_PAYMENT']) / 100, 2);
$first_payment_cts = $first_payment * 100;
} else {
$first_payment = round($total_cart / $config['CW06BE2BILL_NX_NB_PAYMENTS'], 2);
$first_payment_cts = $first_payment * 100;
}
$amount_residual = $total_cart - $first_payment;
$amounts = array(
date('Y-m-d') => $first_payment_cts
);
for ($i=1; $i<$config['CW06BE2BILL_NX_NB_PAYMENTS']; $i++) {
$month_rest = $config['CW06BE2BILL_NX_NB_PAYMENTS'] - $i;
$amount = round($amount_residual / $month_rest, 2);
$amount_cts = $amount * 100;
$amount_residual = $amount_residual - $amount;
$amounts[date('Y-m-d', strtotime('+'.$i.' month'))] = $amount_cts;
}
$payment_nx = $be2bill->buildPaymentFormButton(
$amounts,
$this->context->cart->id.date('is'),
$this->context->customer->id,
$this->l('Cart ID : ').$this->context->cart->id,
$htmlOptions = array(
'FORM' => array(
'id' => 'cw06be2bill_payment_nx',
'style' => 'display:none;'
)
),
$options = array(
'EXTRADATA' => base64_encode(serialize(array('TYPE'=>$config['CW06BE2BILL_NX_NB_PAYMENTS'].'X','INITIAL_AMOUNT'=>$total_cart_cts))),
'CLIENTEMAIL' => $this->context->customer->email,
'CARDFULLNAME' => $this->context->customer->firstname.' '.$this->context->customer->lastname,
'3DSECURE' => $config['CW06BE2BILL_NX_3DS_ACTIVE'] && $config['CW06BE2BILL_NX_3DS_MIN_AMOUNT'] < $total_cart ? 'yes' : 'no',
'HIDECLIENTEMAIL' => 'yes',
'HIDECARDFULLNAME' => 'yes'
)
);
$this->context->smarty->assign('nb_payments', $config['CW06BE2BILL_NX_NB_PAYMENTS']);
$this->context->smarty->assign('payment_nx', $payment_nx);
}
return $this->display(__FILE__, 'views/templates/hook/payment.tpl');
}
public function hookDisplayOrderConfirmation($params)
{
if ($this->active == false) {
return;
}
$order = $params['objOrder'];
if ($order->getCurrentOrderState()->id != Configuration::get('PS_OS_ERROR')) {
$this->smarty->assign('status', 'ok');
}
$this->smarty->assign(array(
'id_order' => $order->id,
'reference' => $order->reference,
'params' => $params,
'total' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
));
return $this->display(__FILE__, 'views/templates/hook/confirmation.tpl');
}
public function getPaymentName($nb_payment = 1)
{
if ($nb_payment == 1) {
$module_name = $this->l('Cash payment by credit card');
} else {
$module_name = $this->l('Payment ').$nb_payment.$this->l(' times by credit card');
}
return $module_name;
}
public function be2billSignature(Array $data = array())
{
$password = Configuration::get('CW06BE2BILL_PASSWORD');
$clear_string = $password;
ksort($data);
foreach ($data as $key => $value) {
if (is_array($value)) {
ksort($value);
foreach ($value as $index => $val) {
$clear_string .= $key . '[' . $index . ']=' . $val . $password;
}
} else {
if ($key == 'HASH') {
// Skip HASH parameter if supplied
continue;
} else {
$clear_string .= $key . '=' . $value . $password;
}
}
}
return hash('sha256', $clear_string);
}
}

View File

@ -1,13 +1,13 @@
<?php
/*
* 2007-2014 PrestaShop
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
@ -18,18 +18,18 @@
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header("Location: ../");
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,35 @@
<?php
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,58 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_89c5974817d87af5e030b75216043006'] = 'Paiements avec Be2Bill';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_170a004c910abf41a87ab3f1108a048f'] = 'Paiement sécurisé avec Be2Bill : paiements comptants et paiements multiples';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_d6f47e627cb8b9186caa435aba1c32ae'] = 'Voulez-vous vraiment supprimer ce module ?';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_cdbe2f170711683cb6624cf9c509cc99'] = 'Ce module n\'est pas disponible pour votre pays';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_4245499695408b974322be6f01b0d17a'] = 'Mode test';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_1a26f77d23e9f53c173478f95388f85b'] = 'Utiliser le module en mode test';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activer';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactiver';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_c60ddf945d74a351be0c70393863e472'] = 'Entrez votre identifiant Be2Bill';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_29ee5d1ebcc033234938a5234f1f2075'] = 'Identifiant';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_8cc415fbddb1e5cbe53406acc71cd521'] = 'Entre votre mot de passe Be2Bill';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_dc647eb65e6711e155375218212b3964'] = 'Mot de passe';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_027a4f7518a5254102eae0882e42783f'] = 'Créer une commande si paiement refusé';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_d1b8ba163a4a040ce4cb22692ec26313'] = 'Le panier du client est conservé';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_a2b787ad97ab6f553dded04fc19dab01'] = 'Url de notification';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_a282eacea788800f3018222c300893d6'] = 'Url de redirection';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_a0e34976c480bf253e300a9e38088741'] = 'Paiement comptant';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_d1bbd8c4a5880c32f28d96a538a18f36'] = 'Activer ce mode de paiement';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_1f0084a1581c05622120bd827305f173'] = 'Minimum de commande';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_d0a317b798738ade3b81cc92db34b958'] = 'Laisser vide ou 0 pour désactiver';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_be19b1edb888cf57ddbd87eec39e07ba'] = 'Maximum de commande';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_8b8cfbdfbe791e1368da860c845578ce'] = 'Activer le 3D-Secure';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_13f91cd3303d627748ecd88be268a750'] = 'Montant minimum de commande pour activer le 3D-Secure, si le 3D-Secure est activé';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_5792e72d817cc1bf72360dc47c61eeec'] = 'Paiements multiples';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_2fb04ff1f9199724651a3b86162737da'] = 'Nombre de paiements';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_9814e1b66c2f78cab6bc1bb8e407d434'] = 'Entre 2 et 4 paiements';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_d6b641357227328782e39b04db3e0722'] = 'Pourcentage du 1er paiement';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_d54ceb26c0489c51954211d96090ac27'] = 'Exemple : 40 = 40% du montant total de la commande pour le 1er paiement. 0 va couper les paiements à part égale.';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_2257df8fefee3d0b89e5298136169340'] = 'ID Panier :';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_40a426f58f456b3befd2ee53b498ada5'] = 'Paiement cash par carte de paiement';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_79e921804b6ff62b08b2e1f4fcf8d3dc'] = 'Paiement';
$_MODULE['<{cw06be2bill}prestashop>cw06be2bill_74248f775ce8fe823c5a420703dbef58'] = 'Nombre de paiements par carte';
$_MODULE['<{cw06be2bill}prestashop>confirmation_e57e7711d7c314eeb713449f8d151dd3'] = 'Une erreur s\'est produite. Merci de nous contacter pour obtenir plus d\'informations.';
$_MODULE['<{cw06be2bill}prestashop>confirmation_65a03fc51b8d03fec8ff707a01156174'] = 'Tentative de piratage ! Vous n\'êtes pas autorisé à accéder à cette page !';
$_MODULE['<{cw06be2bill}prestashop>validation_40a426f58f456b3befd2ee53b498ada5'] = 'Paiement comptant par carte bancaire';
$_MODULE['<{cw06be2bill}prestashop>validation_79e921804b6ff62b08b2e1f4fcf8d3dc'] = 'Paiement ';
$_MODULE['<{cw06be2bill}prestashop>validation_74248f775ce8fe823c5a420703dbef58'] = ' fois par carte bancaire';
$_MODULE['<{cw06be2bill}prestashop>configure_d38b7b807272622d02ba2c2fa6e262d7'] = 'URLs de validation';
$_MODULE['<{cw06be2bill}prestashop>urls_3ca7ca93df600ffff03ee0e7eac6950f'] = 'URL de redirection';
$_MODULE['<{cw06be2bill}prestashop>urls_a2b787ad97ab6f553dded04fc19dab01'] = 'URL de notification';
$_MODULE['<{cw06be2bill}prestashop>error_1e97d97a923eaddd810e056c828e99ea'] = 'Erreur de paiement';
$_MODULE['<{cw06be2bill}prestashop>confirmation_88526efe38fd18179a127024aba8c1d7'] = 'Votre commande sur %s est terminée.';
$_MODULE['<{cw06be2bill}prestashop>confirmation_b2f40690858b404ed10e62bdf422c704'] = 'Montant';
$_MODULE['<{cw06be2bill}prestashop>confirmation_63d5049791d9d79d86e9a108b0a999ca'] = 'Référence';
$_MODULE['<{cw06be2bill}prestashop>confirmation_19c419a8a4f1cd621853376a930a2e24'] = 'Un email vous a été envoyé avec ces informations.';
$_MODULE['<{cw06be2bill}prestashop>confirmation_ca7e41a658753c87973936d7ce2429a8'] = 'Si vous avez des questions, merci de contacter';
$_MODULE['<{cw06be2bill}prestashop>confirmation_cd430c2eb4b87fb3b49320bd21af074e'] = 'notre support client.';
$_MODULE['<{cw06be2bill}prestashop>confirmation_7569ab9b5973795ce8c9fc870d38d8e1'] = 'Votre commande sur %s n\'a pas été acceptée.';
$_MODULE['<{cw06be2bill}prestashop>confirmation_caa4088f1d295cf8ce8e358eb975ab32'] = 'Merci de réessayer de passer votre commande.';
$_MODULE['<{cw06be2bill}prestashop>payment_b509e1d458823c4e6c589622662e2666'] = 'Payer par carte bancaire avec Be2Bill';
$_MODULE['<{cw06be2bill}prestashop>payment_c453a4b8e8d98e82f35b67f433e3b4da'] = 'Paiement ';
$_MODULE['<{cw06be2bill}prestashop>payment_f10eb42ce6ba524d82de84b1f8da269f'] = ' fois par carte bancaire avec Be2Bill';

View File

@ -0,0 +1,35 @@
<?php
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@ -0,0 +1,35 @@
<?php
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Some files were not shown because too many files have changed in this diff Show More