40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
<?php
|
|
require_once(dirname(__FILE__).'/../config/config.inc.php');
|
|
require_once(dirname(__FILE__).'/init.php');
|
|
|
|
if($cookie->isLoggedBack() && ($id_cart = (int) Tools::getValue('id_cart')) && ($payment = Tools::getValue('payment'))) {
|
|
$cart = new Cart($id_cart);
|
|
|
|
if(Validate::isLoadedObject($cart)) {
|
|
$amount = $cart->getOrderTotal();
|
|
|
|
if($payment == 'paypal') {
|
|
$method = 'Paypal';
|
|
include(_PS_ROOT_DIR_.'/modules/paypal/paypal.php');
|
|
$paypal = new Paypal();
|
|
$paypal->validateOrder($id_cart, (int) Configuration::get('PS_OS_PAYMENT'), $amount, $method);
|
|
}
|
|
}
|
|
|
|
Tools::redirectAdmin('/adm/index.php?tab=AdminCarts&id_cart='.$id_cart.'&viewcart&token='.Tools::getAdminTokenLite('AdminCarts'));
|
|
}
|
|
|
|
/*if($_SERVER['REMOTE_ADDR'] == '109.190.53.175') {
|
|
exit;
|
|
$cart = 54534;
|
|
$amount = 38.40;
|
|
$method = 'atos_cyberplus';
|
|
|
|
include('../config/config.inc.php');
|
|
include(_PS_ROOT_DIR_.'/modules/paypal/paypal.php');
|
|
|
|
$paypal = new Paypal();
|
|
$paypal->validateOrder($cart, 2, $amount, $method);
|
|
|
|
include('../config/config.inc.php');
|
|
include(_PS_ROOT_DIR_.'/modules/atos_cyberplus/atos_cyberplus.php');
|
|
|
|
$p = new atos_cyberplus();
|
|
$p->validateOrder($cart, 2, $amount, $method);
|
|
}*/
|