Posmotrite pojaluysta cto tam takogo. Vot moy kod:
<?
class MyCheckoutBackUrlModuleFrontController extends ModuleFrontController
{
public function postProcess()
{
$authorized = false;
foreach (Module::getPaymentModules() as $module)
if ($module['name'] == 'mycheckout')
{
$authorized = true;
break;
}
if (!$authorized)
die($this->module->l('This payment method is not available.', 'backurl'));
$insideReference = Tools::getValue('reference');
$sql_select = "SELECT * FROM ps_paymenthere WHERE reference='{$insideReference}' AND used=0";
if ($row = Db::getInstance()->getRow($sql_select))
{
$data = "mid=".$row['mid']."&reference=".$row['reference']."";
$myCurl = curl_init();
curl_setopt_array($myCurl, array(
CURLOPT_URL => 'http://test.paymenthere.az:8848/gateway/payment/status?',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $data
));
$response = curl_exec($myCurl);
curl_close($myCurl);
$xml = simplexml_load_string($response);
$status_zakaza = "";
if ($xml->rc==000 && $xml->code==0)
{
$id_ORDER2 = $row['id_order'];
$objOrder = new Order($id_ORDER2); //order with id=1
$history = new OrderHistory();
$history->id_order = (int)$objOrder->id;
$history->changeIdOrderState(20, (int)($objOrder->id)); //order status=3
$status_zakaza = "OK";
}
else
{
}
}
}
}
?>