// Context - first commit
This commit is contained in:
@@ -33,13 +33,13 @@ $ogone = new Ogone();
|
||||
$id_module = $ogone->id;
|
||||
$id_cart = Tools::getValue('orderID');
|
||||
$key = Db::getInstance()->getValue('SELECT secure_key FROM '._DB_PREFIX_.'customer WHERE id_customer = '.(int)$cookie->id_customer);
|
||||
$link = new Link();
|
||||
$context = Context::getContext;
|
||||
|
||||
$smarty->assign(array(
|
||||
'id_module' => $id_module,
|
||||
'id_cart' => $id_cart,
|
||||
'key' => $key,
|
||||
'ogone_link' => (method_exists($link, 'getPageLink') ? $link->getPageLink('my-account') : _PS_BASE_URL_.'my-account')
|
||||
'ogone_link' => (method_exists($context->link, 'getPageLink') ? $context->link->getPageLink('my-account') : _PS_BASE_URL_.'my-account')
|
||||
));
|
||||
echo $ogone->display(dirname(__FILE__), 'waiting.tpl');
|
||||
|
||||
|
||||
@@ -183,17 +183,18 @@ class Ogone extends PaymentModule
|
||||
|
||||
public function hookOrderConfirmation($params)
|
||||
{
|
||||
global $smarty, $cookie;
|
||||
if (!$context)
|
||||
$context = Context::getContext();
|
||||
|
||||
if ($params['objOrder']->module != $this->name)
|
||||
return;
|
||||
|
||||
if ($params['objOrder']->valid)
|
||||
$smarty->assign(array('status' => 'ok', 'id_order' => $params['objOrder']->id));
|
||||
$context->controller->smarty->assign(array('status' => 'ok', 'id_order' => $params['objOrder']->id));
|
||||
else
|
||||
$smarty->assign('status', 'failed');
|
||||
$link = new Link();
|
||||
$smarty->assign('ogone_link', (method_exists($link, 'getPageLink') ? $link->getPageLink('contact', true) : Tools::getHttpHost(true).'contact'));
|
||||
$context->controller->smarty->assign('status', 'failed');
|
||||
|
||||
$context->controller->smarty->assign('ogone_link', (method_exists($link, 'getPageLink') ? $context->link->getPageLink('contact', true) : Tools::getHttpHost(true).'contact'));
|
||||
return $this->display(dirname(__FILE__), 'hookorderconfirmation.tpl');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user