Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL 202 ecommence
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL 202 ecommence is strictly forbidden.
* In order to obtain a license, please contact us: tech@202-ecommerce.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe 202 ecommence
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL 202 ecommence est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter 202-ecommerce <tech@202-ecommerce.com>
* ...........................................................................
*
* @author 202-ecommerce <tech@202-ecommerce.com>
* @copyright Copyright (c) 202-ecommerce
* @license Commercial license
*/
class AdminPaypalConfigurationController extends \ModuleAdminController
{
/** @var Module Instance of your module automatically set by ModuleAdminController */
public $module;
public function __construct()
{
parent::__construct();
Tools::redirect($this->context->link->getAdminLink('AdminModules', true).'&configure='.$this->module->name.'&tab_module='.$this->module->tab.'&module_name='.$this->module->name);
}
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL 202 ecommerce
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL 202 ecommerce is strictly forbidden.
* In order to obtain a license, please contact us: tech@202-ecommerce.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe 202 ecommerce
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL 202 ecommerce est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter 202-ecommerce <tech@202-ecommerce.com>
* ...........................................................................
*
* @author 202-ecommerce <tech@202-ecommerce.com>
* @copyright Copyright (c) 202-ecommerce
* @license Commercial license
* @version develop
*/
include_once(_PS_MODULE_DIR_.'paypal/vendor/autoload.php');
use PaypalPPBTlib\Extensions\ProcessLogger\Controllers\Admin\AdminProcessLoggerController;
class AdminPaypalProcessLoggerController extends AdminProcessLoggerController
{
public function __construct()
{
parent::__construct();
$this->className = 'PaypalLog';
}
}

View File

@@ -0,0 +1,57 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL 202 ecommence
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL 202 ecommence is strictly forbidden.
* In order to obtain a license, please contact us: tech@202-ecommerce.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe 202 ecommence
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL 202 ecommence est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter 202-ecommerce <tech@202-ecommerce.com>
* ...........................................................................
*
* @author 202-ecommerce <tech@202-ecommerce.com>
* @copyright Copyright (c) 202-ecommerce
* @license Commercial license
*/
class AdminPaypalStatsController extends \ModuleAdminController
{
/** @var Module Instance of your module automatically set by ModuleAdminController */
public $module;
/** @var string redirection link */
public $report_link;
public function __construct()
{
parent::__construct();
Tools::redirect($this->getReportLink());
}
public function getReportLink()
{
if (Configuration::get('PAYPAL_METHOD') == 'BT') {
if (Configuration::get('PAYPAL_SANDBOX')) {
$this->report_link = "https://sandbox.braintreegateway.com/merchants/".Configuration::get('PAYPAL_SANDBOX_BRAINTREE_MERCHANT_ID')."/transactions/advanced_search";
} else {
$this->report_link = "https://www.braintreegateway.com/merchants/".Configuration::get('PAYPAL_LIVE_BRAINTREE_MERCHANT_ID')."/transactions/advanced_search";
}
} else {
if (Configuration::get('PAYPAL_SANDBOX')) {
$this->report_link = "https://business.sandbox.paypal.com/merchantdata/reportHome";
} else {
$this->report_link = "https://business.paypal.com/merchantdata/reportHome";
}
}
return $this->report_link;
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL 202 ecommence
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL 202 ecommence is strictly forbidden.
* In order to obtain a license, please contact us: tech@202-ecommerce.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe 202 ecommence
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL 202 ecommence est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter 202-ecommerce <tech@202-ecommerce.com>
* ...........................................................................
*
* @author 202-ecommerce <tech@202-ecommerce.com>
* @copyright Copyright (c) 202-ecommerce
* @license Commercial license
*/
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,139 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Init payment for EC shortcut
*/
class PaypalScInitModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['source_page'] = Tools::getvalue('source_page');
$this->values['checkAvailability'] = Tools::getvalue('checkAvailability');
$this->values['id_product'] = Tools::getvalue('id_product');
$this->values['product_attribute'] = Tools::getvalue('product_attribute');
$this->values['id_product_attribute'] = Tools::getvalue('id_product_attribute');
$this->values['quantity'] = Tools::getvalue('quantity');
$this->values['combination'] = Tools::getvalue('combination');
$this->values['getToken'] = Tools::getvalue('getToken');
$this->values['credit_card'] = 0;
$this->values['short_cut'] = 1;
}
public function postProcess()
{
if ($this->values['checkAvailability']) {
return $this->checkAvailability();
}
if ($this->values['source_page'] == 'product') {
$this->prepareProduct();
}
$method = AbstractMethodPaypal::load(Configuration::get('PAYPAL_METHOD'));
try {
$method->setParameters($this->values);
$response = $method->init();
if ($this->values['getToken']) {
$this->jsonValues = array('success' => true, 'token' => $method->token);
} else {
$this->redirectUrl = $response;
}
} catch (PaypalAddons\classes\PaypalException $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
$this->errors['msg_long'] = $e->getMessageLong();
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
}
if (!empty($this->errors)) {
if ($this->values['getToken']) {
$this->jsonValues = array('success' => false, 'redirect_link' => Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors));
} else {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
}
public function checkAvailability()
{
switch ($this->values['source_page']) {
case 'cart':
if ($this->context->cart->checkQuantities()) {
$this->jsonValues = array('success' => true);
} else {
$this->jsonValues = array('success' => false);
}
break;
case 'product':
$product = new Product($this->values['id_product']);
$product->id_product_attribute = $this->values['product_attribute'] != 0 ? $this->values['product_attribute'] : $this->values['id_product_attribute'];
if ($product->checkQty($this->values['quantity'])) {
$this->jsonValues = array('success' => true);
} else {
$this->jsonValues = array('success' => false);
}
break;
default:
}
}
public function prepareProduct()
{
if (empty($this->context->cart->id)) {
$this->context->cart->add();
$this->context->cookie->id_cart = $this->context->cart->id;
$this->context->cookie->write();
} else {
// delete all product in cart
$products = $this->context->cart->getProducts();
foreach ($products as $product) {
$this->context->cart->deleteProduct($product['id_product'], $product['id_product_attribute'], $product['id_customization'], $product['id_address_delivery']);
}
}
if ($this->values['combination']) {
// build group for search product attribute
$temp_group = explode('|', $this->values['combination']);
$group = array();
foreach ($temp_group as $item) {
$temp = explode(':', $item);
$group[$temp[0]] = $temp[1];
}
$this->context->cart->updateQty($this->values['quantity'], $this->values['id_product'], Product::getIdProductAttributesByIdAttributes($this->values['id_product'], $group));
} else {
$this->context->cart->updateQty($this->values['quantity'], $this->values['id_product']);
}
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
use PaypalPPBTlib\CommonAbstarctModuleFrontController;
/**
* Class PaypalAbstarctModuleFrontController
*/
abstract class PaypalAbstarctModuleFrontController extends CommonAbstarctModuleFrontController
{
}

View File

@@ -0,0 +1,101 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class PaypalAccountModuleFrontController extends ModuleFrontController
{
public function __construct()
{
$this->auth = true;
parent::__construct();
$this->context = Context::getContext();
include_once($this->module->getLocalPath().'classes/PaypalVaulting.php');
include_once($this->module->getLocalPath().'classes/PaypalCustomer.php');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
if (Tools::getValue('process') == 'delete') {
$id = (int)Tools::getValue('id_method');
$payment_method = new PaypalVaulting($id);
$method = AbstractMethodPaypal::load(Tools::getValue('method'));
$method->deleteVaultedMethod($payment_method);
$payment_method->delete();
}
if (Tools::getValue('process') == 'save') {
$all_values = Tools::getAllValues();
foreach ($all_values as $key => $value) {
$val_arr = explode('_', $key);
if ($val_arr[0] == 'name') {
$payment_method = new PaypalVaulting($val_arr[1]);
$payment_method->name = $value;
$payment_method->save();
}
}
}
}
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
$methods = PaypalVaulting::getCustomerGroupedMethods($this->context->customer->id);
$this->context->smarty->assign(array(
'payment_methods' => $methods,
));
$this->setTemplate('module:paypal/views/templates/front/payment_methods.tpl');
}
/**
* Set my account breadcrumb links.
*/
public function getBreadcrumbLinks()
{
$breadcrumb = parent::getBreadcrumbLinks();
$breadcrumb['links'][] = $this->addMyAccountToBreadcrumb();
return $breadcrumb;
}
/**
* Adds page-customer-account body class.
*/
public function getTemplateVarPage()
{
$page = parent::getTemplateVarPage();
$page['body_classes']['page-customer-account'] = true;
return $page;
}
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Validate BT payment
*/
class PaypalBtValidationModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['payment_method_nonce'] = Tools::getvalue('payment_method_nonce');
$this->values['payment_method_bt'] = Tools::getvalue('payment_method_bt');
$this->values['bt_vaulting_token'] = Tools::getvalue('bt_vaulting_token');
$this->values['pbt_vaulting_token'] = Tools::getvalue('pbt_vaulting_token');
$this->values['save_card_in_vault'] = Tools::getvalue('save_card_in_vault');
$this->values['save_account_in_vault'] = Tools::getvalue('save_account_in_vault');
}
public function postProcess()
{
$method_bt = AbstractMethodPaypal::load('BT');
try {
$method_bt->setParameters($this->values);
$method_bt->validation();
$cart = Context::getContext()->cart;
$customer = new Customer($cart->id_customer);
$paypal = Module::getInstanceByName($this->name);
$this->redirectUrl = 'index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$paypal->id.'&id_order='.$paypal->currentOrder.'&key='.$customer->secure_key;
} catch (PaypalAddons\classes\PaypalException $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
$this->errors['msg_long'] = $e->getMessageLong();
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
} finally {
$this->transaction_detail = $method_bt->getDetailsTransaction();
}
if (!empty($this->errors)) {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
}

View File

@@ -0,0 +1,80 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Prepare EC payment
*/
class PaypalEcInitModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['getToken'] = Tools::getvalue('getToken');
$this->values['credit_card'] = Tools::getvalue('credit_card');
$this->values['short_cut'] = 0;
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$paypal = Module::getInstanceByName($this->name);
$method_ec = AbstractMethodPaypal::load('EC');
try {
$method_ec->setParameters($this->values);
$url = $method_ec->init();
if ($this->values['getToken']) {
$this->jsonValues = array('success' => true, 'token' => $method_ec->token);
} else {
$this->redirectUrl = $url.'&useraction=commit';
}
} catch (PayPal\Exception\PPConnectionException $e) {
$this->errors['error_msg'] = $paypal->l('Error connecting to ', pathinfo(__FILE__)['filename']) . $e->getUrl();
} catch (PayPal\Exception\PPMissingCredentialException $e) {
$this->errors['error_msg'] = $e->errorMessage();
} catch (PayPal\Exception\PPConfigurationException $e) {
$this->errors['error_msg'] = $paypal->l('Invalid configuration. Please check your configuration file', pathinfo(__FILE__)['filename']);
} catch (PaypalAddons\classes\PaypalException $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
$this->errors['msg_long'] = $e->getMessageLong();
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
}
if (!empty($this->errors)) {
if ($this->values['getToken']) {
$this->jsonValues = array('success' => false, 'redirect_link' => Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors));
} else {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
}
}

View File

@@ -0,0 +1,209 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Update PrestaShop Order after return from PayPal
*/
class PaypalEcScOrderModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['payment_token'] = Tools::getvalue('token');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$method = AbstractMethodPaypal::load('EC');
$paypal = Module::getInstanceByName($this->name);
try {
$method->setParameters($this->values);
$info = $method->getInfo();
$this->prepareOrder($info);
$this->redirectUrl = $this->context->link->getPageLink('order', null, null, array('step'=>2));
} catch (PayPal\Exception\PPConnectionException $e) {
$this->errors['error_msg'] = $paypal->l('Error connecting to ', pathinfo(__FILE__)['filename']) . $e->getUrl();
} catch (PayPal\Exception\PPMissingCredentialException $e) {
$this->errors['error_msg'] = $e->errorMessage();
} catch (PayPal\Exception\PPConfigurationException $e) {
$this->errors['error_msg'] = $paypal->l('Invalid configuration. Please check your configuration file', pathinfo(__FILE__)['filename']);
} catch (PaypalAddons\classes\PaypalException $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
$this->errors['msg_long'] = $e->getMessageLong();
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
}
if (!empty($this->errors)) {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
/**
* @param $info object transaction
*/
public function prepareOrder($info)
{
$module = Module::getInstanceByName($this->name);
$payer_info = $info->GetExpressCheckoutDetailsResponseDetails->PayerInfo;
$ship_addr = $info->GetExpressCheckoutDetailsResponseDetails->PaymentDetails[0]->ShipToAddress;
if ($this->context->cookie->logged) {
$customer = $this->context->customer;
} elseif ($id_customer = Customer::customerExists($payer_info->Payer, true)) {
$customer = new Customer($id_customer);
} else {
$customer = new Customer();
$customer->email = $payer_info->Payer;
$customer->firstname = $payer_info->PayerName->FirstName;
$customer->lastname = $payer_info->PayerName->LastName;
$customer->passwd = Tools::encrypt(Tools::passwdGen());
$customer->add();
}
$id_cart = $this->context->cart->id; // save id cart
// Login Customer
$this->context->updateCustomer($customer);
$this->context->cart = new Cart($id_cart); // Reload cart
$this->context->cart->id_customer = $customer->id;
$this->context->cart->update();
Hook::exec('actionAuthentication', array('customer' => $this->context->customer));
// Login information have changed, so we check if the cart rules still apply
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
// END Login
$this->context->cookie->__set('paypal_ecs', $info->GetExpressCheckoutDetailsResponseDetails->Token);
$this->context->cookie->__set('paypal_ecs_payerid', $info->GetExpressCheckoutDetailsResponseDetails->PayerInfo->PayerID);
$this->context->cookie->__set('paypal_ecs_email', $info->GetExpressCheckoutDetailsResponseDetails->PayerInfo->Payer);
$addresses = $this->context->customer->getAddresses($this->context->language->id);
$address_exist = false;
$count = 1;
$id_address = 0;
$payer_phone = '';
if (!empty($ship_addr->Phone)) {
$payer_phone = $ship_addr->Phone;
} elseif (!empty($payer_info->ContactPhone)) {
$payer_phone = $payer_info->ContactPhone;
} elseif (!empty($info->GetExpressCheckoutDetailsResponseDetails->ContactPhone)) {
$payer_phone = $info->GetExpressCheckoutDetailsResponseDetails->ContactPhone;
}
$id_state = PayPal::getIdStateByPaypalCode($ship_addr->StateOrProvince, $ship_addr->Country);
foreach ($addresses as $address) {
if ($address['firstname'].' '.$address['lastname'] == $ship_addr->Name
&& $address['address1'] == $ship_addr->Street1
&& (empty($ship_addr->Street2) || $address['address2'] == $ship_addr->Street2)
&& $address['id_country'] == Country::getByIso($ship_addr->Country)
&& $address['city'] == $ship_addr->CityName
&& (empty($ship_addr->StateOrProvince) || $address['id_state'] == $id_state)
&& $address['postcode'] == $ship_addr->PostalCode
&& (empty($payer_phone) || $address['phone'] == $payer_phone)
) {
$address_exist = true;
$id_address = $address['id_address'];
break;
} else {
if ((strrpos($address['alias'], 'Paypal_Address')) !== false) {
$count = (int)(Tools::substr($address['alias'], -1)) + 1;
}
}
}
if (!$address_exist) {
$orderAddress = new Address();
$pos_separator = strpos($ship_addr->Name, ' ');
$orderAddress->firstname = Tools::substr($ship_addr->Name, 0, $pos_separator);
$orderAddress->lastname = Tools::substr($ship_addr->Name, $pos_separator+1);
$orderAddress->address1 = $ship_addr->Street1;
if (isset($ship_addr->Street2)) {
$orderAddress->address2 = $ship_addr->Street2;
}
$orderAddress->id_country = Country::getByIso($ship_addr->Country);
$orderAddress->city = $ship_addr->CityName;
if ($id_state) {
$orderAddress->id_state = $id_state;
}
$orderAddress->postcode = $ship_addr->PostalCode;
if (!empty($payer_phone)) {
$orderAddress->phone = $payer_phone;
}
$orderAddress->id_customer = $customer->id;
$orderAddress->alias = 'Paypal_Address '.($count);
$validationMessage = $orderAddress->validateFields(false, true);
if (Country::containsStates($orderAddress->id_country) && $orderAddress->id_state == false) {
$validationMessage = $module->l('State is required in order to process payment. Please fill in state field.', pathinfo(__FILE__)['filename']);
}
$country = new Country($orderAddress->id_country);
if ($country->active == false) {
$validationMessage = $module->l('Country is not active', pathinfo(__FILE__)['filename']);
}
if (is_string($validationMessage)) {
$var = array(
'newAddress' => 'delivery',
'address1' => $orderAddress->address1,
'firstname' => $orderAddress->firstname,
'lastname' => $orderAddress->lastname,
'postcode' => $orderAddress->postcode,
'id_country' => $orderAddress->id_country,
'city' => $orderAddress->city,
'phone' => $orderAddress->phone,
'address2' => $orderAddress->address2,
'id_state' => $orderAddress->id_state
);
session_start();
$_SESSION['notifications'] = Tools::jsonEncode(array('error' => $validationMessage));
$url = Context::getContext()->link->getPageLink('order') . '&' . http_build_query($var);
Tools::redirect($url);
}
$orderAddress->save();
$id_address = $orderAddress->id;
}
$this->context->cart->id_address_delivery = $id_address;
$this->context->cart->id_address_invoice = $id_address;
$products = $this->context->cart->getProducts();
foreach ($products as $key => $product) {
$this->context->cart->setProductAddressDelivery($product['id_product'], $product['id_product_attribute'], $product['id_address_delivery'], $id_address);
}
$this->context->cart->save();
}
}

View File

@@ -0,0 +1,81 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Validate EC payment
*/
class PaypalEcValidationModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['short_cut'] = Tools::getvalue('short_cut');
$this->values['payerId'] = Tools::getvalue('PayerID');
$this->values['payment_token'] = Tools::getvalue('token');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$method_ec = AbstractMethodPaypal::load('EC');
$paypal = Module::getInstanceByName($this->name);
try {
$method_ec->setParameters($this->values);
$method_ec->validation();
$cart = Context::getContext()->cart;
$customer = new Customer($cart->id_customer);
$this->redirectUrl = 'index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$paypal->id.'&id_order='.$paypal->currentOrder.'&key='.$customer->secure_key;
} catch (PayPal\Exception\PPConnectionException $e) {
$this->errors['error_msg'] = $paypal->l('Error connecting to ', pathinfo(__FILE__)['filename']) . $e->getUrl();
} catch (PayPal\Exception\PPMissingCredentialException $e) {
$this->errors['error_msg'] = $e->errorMessage();
} catch (PayPal\Exception\PPConfigurationException $e) {
$this->errors['error_msg'] = $paypal->l('Invalid configuration. Please check your configuration file', pathinfo(__FILE__)['filename']);
} catch (PaypalAddons\classes\PaypalException $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
$this->errors['msg_long'] = $e->getMessageLong();
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
} finally {
$this->transaction_detail = $method_ec->getDetailsTransaction();
}
//unset cookie of payment init
Context::getContext()->cookie->__unset('paypal_ecs');
Context::getContext()->cookie->__unset('paypal_ecs_payerid');
Context::getContext()->cookie->__unset('paypal_ecs_email');
if (!empty($this->errors)) {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* Manage errors.
*/
class PaypalErrorModuleFrontController extends ModuleFrontController
{
/**
* @see ModuleFrontController::init()
*/
public function init()
{
parent::init();
$this->values['error_msg'] = Tools::getvalue('error_msg');
$this->values['msg_long'] = Tools::getvalue('msg_long');
$this->values['error_code'] = Tools::getvalue('error_code');
$this->values['no_retry'] = Tools::getvalue('no_retry');
}
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
Context::getContext()->smarty->assign(array(
'error_msg' => $this->values['error_msg'],
'msg_long' => $this->values['msg_long'],
'error_code' => $this->values['error_code'],
'show_retry' => (Context::getContext()->cart->nbProducts() > 0 && !$this->values['no_retry']) ? true : false,
'method' => Configuration::get('PAYPAL_METHOD'),
));
$this->setTemplate('module:paypal/views/templates/front/payment_error.tpl');
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2019 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-2019 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,50 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Update PPP payment request before initialize it.
*/
class PaypalPppPatchModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function postProcess()
{
$method_ppp = AbstractMethodPaypal::load('PPP');
if (Context::getContext()->cookie->paypal_plus_payment) {
try {
$method_ppp->doPatch();
$this->jsonValues = array('success' => true);
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
$this->jsonValues = array('success' => false, 'redirect_link' => Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors));
}
}
}
}

View File

@@ -0,0 +1,159 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
use PayPal\Api\Payment;
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Update PrestaShop Order after return from PayPal Plus
*/
class PaypalPppScOrderModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['paymentId'] = Tools::getvalue('paymentId');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$method = AbstractMethodPaypal::load('PPP');
$paypal = Module::getInstanceByName($this->name);
try {
$info = Payment::get($this->values['paymentId'], $method->_getCredentialsInfo());
$this->prepareOrder($info);
$this->redirectUrl = $this->context->link->getPageLink('order', null, null, array('step'=>2));
} catch (PayPal\Exception\PayPalConnectionException $e) {
$decoded_message = Tools::jsonDecode($e->getData());
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $decoded_message->message;
$this->errors['msg_long'] = $decoded_message->name.' - '.$decoded_message->details[0]->issue;
} catch (PayPal\Exception\PayPalInvalidCredentialException $e) {
$this->errors['error_msg'] = $e->errorMessage();
} catch (PayPal\Exception\PayPalMissingCredentialException $e) {
$this->errors['error_msg'] = $paypal->l('Invalid configuration. Please check your configuration file', pathinfo(__FILE__)['filename']);
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
}
if (!empty($this->errors)) {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
public function prepareOrder($info)
{
$payer_info = $info->payer->payer_info;
$ship_addr = $info->transactions[0]->item_list->shipping_address;
$id_state = PayPal::getIdStateByPaypalCode($ship_addr->state, $ship_addr->country_code);
if ($this->context->cookie->logged) {
$customer = $this->context->customer;
} elseif ($id_customer = Customer::customerExists($payer_info->email, true)) {
$customer = new Customer($id_customer);
} else {
$customer = new Customer();
$customer->email = $payer_info->email;
$customer->firstname = $payer_info->first_name;
$customer->lastname = $payer_info->last_name;
$customer->passwd = Tools::encrypt(Tools::passwdGen());
$customer->add();
}
$id_cart = $this->context->cart->id; // save id cart
// Login Customer
$this->context->updateCustomer($customer);
$this->context->cart = new Cart($id_cart); // Reload cart
$this->context->cart->id_customer = $customer->id;
$this->context->cart->update();
Hook::exec('actionAuthentication', array('customer' => $this->context->customer));
// Login information have changed, so we check if the cart rules still apply
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
// END Login
$addresses = $this->context->customer->getAddresses($this->context->language->id);
$address_exist = false;
$count = 1;
$id_address = 0;
foreach ($addresses as $address) {
if ($address['firstname'].' '.$address['lastname'] == $ship_addr->recipient_name
&& $address['address1'] == $ship_addr->line1
&& $address['id_country'] == Country::getByIso($ship_addr->country_code)
&& $address['city'] == $ship_addr->city
&& (empty($ship_addr->state) || $address['id_state'] == $id_state)
&& $address['postcode'] == $ship_addr->postal_code
&& (empty($ship_addr->line2) || $address['address2'] == $ship_addr->line2)
) {
$address_exist = true;
$id_address = $address['id_address'];
break;
} else {
if ((strrpos($address['alias'], 'Paypal_Address')) !== false) {
$count = (int)(Tools::substr($address['alias'], -1)) + 1;
}
}
}
if (!$address_exist) {
$orderAddress = new Address();
$pos_separator = strpos($ship_addr->recipient_name, ' ');
$orderAddress->firstname = Tools::substr($ship_addr->recipient_name, 0, $pos_separator);
$orderAddress->lastname = Tools::substr($ship_addr->recipient_name, $pos_separator+1);
$orderAddress->address1 = $ship_addr->line1;
if (isset($ship_addr->line2)) {
$orderAddress->address2 = $ship_addr->line2;
}
$orderAddress->id_country = Country::getByIso($ship_addr->country_code);
$orderAddress->city = $ship_addr->city;
if ($id_state) {
$orderAddress->id_state = (int) $id_state;
}
$orderAddress->postcode = $ship_addr->postal_code;
$orderAddress->id_customer = $customer->id;
$orderAddress->alias = 'Paypal_Address '.($count);
$orderAddress->save();
$id_address = $orderAddress->id;
}
$this->context->cart->id_address_delivery = $id_address;
$this->context->cart->id_address_invoice = $id_address;
$product = $this->context->cart->getProducts();
$this->context->cart->setProductAddressDelivery($product[0]['id_product'], $product[0]['id_product_attribute'], $product[0]['id_address_delivery'], $id_address);
$this->context->cart->save();
$this->context->cookie->__set('paypal_pSc', $info->id);
$this->context->cookie->__set('paypal_pSc_payerid', $payer_info->payer_id);
$this->context->cookie->__set('paypal_pSc_email', $payer_info->email);
}
}

View File

@@ -0,0 +1,80 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once _PS_MODULE_DIR_.'paypal/classes/AbstractMethodPaypal.php';
include_once _PS_MODULE_DIR_.'paypal/controllers/front/abstract.php';
/**
* Validate PPP payment
*/
class PaypalPppValidationModuleFrontController extends PaypalAbstarctModuleFrontController
{
public function init()
{
parent::init();
$this->values['short_cut'] = Tools::getvalue('short_cut');
$this->values['paymentId'] = Tools::getvalue('paymentId');
$this->values['payerId'] = Tools::getvalue('PayerID');
}
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$method_ppp = AbstractMethodPaypal::load('PPP');
$paypal = Module::getInstanceByName($this->name);
try {
$method_ppp->setParameters($this->values);
$method_ppp->validation();
$cart = Context::getContext()->cart;
$customer = new Customer($cart->id_customer);
$this->redirectUrl = 'index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$paypal->id.'&id_order='.$paypal->currentOrder.'&key='.$customer->secure_key;
} catch (PayPal\Exception\PayPalConnectionException $e) {
$decoded_message = Tools::jsonDecode($e->getData());
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $decoded_message->message;
$this->errors['msg_long'] = $decoded_message->name.' - '.$decoded_message->details[0]->issue;
} catch (PayPal\Exception\PayPalInvalidCredentialException $e) {
$this->errors['error_msg'] = $e->errorMessage();
} catch (PayPal\Exception\PayPalMissingCredentialException $e) {
$this->errors['error_msg'] = $paypal->l('Invalid configuration. Please check your configuration file.', pathinfo(__FILE__)['filename']);
} catch (Exception $e) {
$this->errors['error_code'] = $e->getCode();
$this->errors['error_msg'] = $e->getMessage();
} finally {
$this->transaction_detail = $method_ppp->getDetailsTransaction();
}
Context::getContext()->cookie->__unset('paypal_plus_payment');
Context::getContext()->cookie->__unset('paypal_pSc');
Context::getContext()->cookie->__unset('paypal_pSc_payerid');
Context::getContext()->cookie->__unset('paypal_pSc_email');
if (!empty($this->errors)) {
$this->redirectUrl = Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors);
}
}
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* 2007-2019 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-2019 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* Class PayPalTlscurltestserverModuleFrontController. Check TLS
*/
class PayPalTlscurltestserverModuleFrontController extends ModuleFrontController
{
public function initContent()
{
die('ok');
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2019 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-2019 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;