Другие методы оплаты работают.
Видимо что-то в коде обработчика конфликтует с php7 другого варианта реально не вижу.
<?php
defined('_JEXEC') or die('Restricted access');
class pm_alfabank extends PaymentRoot {
function showPaymentForm($params, $pmconfigs) {
include(dirname(__FILE__)."/paymentform.php");
}
function showAdminFormParams($params) {
$jmlThisDocument = JFactory::getDocument();
switch ($jmlThisDocument->language) {
case 'en-gb': include(JPATH_SITE.'/administrator/components/com_jshopping/lang/en-GB_alfabank.php'); $language = 'en'; break;
case 'ru-ru': include(JPATH_SITE.'/administrator/components/com_jshopping/lang/ru-RU_alfabank.php'); $language = 'ru'; break;
default: include(JPATH_SITE.'/administrator/components/com_jshopping/lang/ru-RU_alfabank.php');
}
$array_params = array('testmode', 'email_received', 'transaction_end_status', 'transaction_pending_status', 'transaction_failed_status', 'mecrchant_pass', 'login');
foreach ($array_params as $key)
if (!isset($params[$key]))
$params[$key] = '';
$orders = JModelLegacy ::getInstance('orders', 'JshoppingModel');
$currency = JModelLegacy ::getInstance('currencies', 'JshoppingModel');
include(dirname(__FILE__)."/adminparamsform.php");
jimport('joomla.html.pane');
}
function checkTransaction($pmconfigs, $order, $act){
//get bank order Id
$q = "SELECT #__jshopping_order_pm_alfa.ab_order_id FROM #__jshopping_order_pm_alfa WHERE #__jshopping_order_pm_alfa.js_order_id = '".$order->order_id."'";
$db = JFactory::getDBO();
$db->setQuery($q);
$orderId = $db->loadResult();
if ($orderId != '') {
// check order status
$mecrchant_login = $pmconfigs['login'];
$mecrchant_pass = $pmconfigs['mecrchant_pass'];
$curlParams = Array(
'userName' => $mecrchant_login,
'password' => $mecrchant_pass,
'orderId' => $orderId,
);
if ($pmconfigs['testmode']) {
$host = "https://web.rbsuat.com/ab/rest/getOrderStatus.do";
} else {
$host = "https://engine.paymentgate.ru/payment/rest/getOrderStatus.do";
}
$alfaCurl = curl_init();
curl_setopt_array($alfaCurl, array(
CURLOPT_URL => $host,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($curlParams),
));
$transactiondata = curl_exec($alfaCurl);
curl_close($alfaCurl);
$transactiondata = json_decode($transactiondata, true);
$res = '';
foreach ($response as $k=>$data) {
$res .= '['.$k.'=>'.$data.'], ';
}
saveToLog("payment.log", "Order ID ".$order->order_number."; Response: ".$res);
$transaction = $transactiondata['ErrorMessage'];
$errorCode = $transactiondata['ErrorCode'];
$orderStatus = $transactiondata['OrderStatus'];
if (($errorCode != '0') && ($orderStatus != '2')) {
//error in pocessing
$orderStatus = '2';
} else {
//processing without error
$orderStatus = '1';
}
} else {
$orderStatus = '0';
}
return array($orderStatus, '', $transaction, $transactiondata);
}
function showEndForm($pmconfigs, $order) {
$jshopConfig = JSFactory::getConfig();
$item_name = sprintf(_JSHOP_PAYMENT_NUMBER, $order->order_number);
$jmlThisDocument = JFactory::getDocument();
switch ($jmlThisDocument->language) {
case 'en-gb': include(JPATH_SITE.'/administrator/components/com_jshopping/lang/en-GB_alfabank.php'); $language = 'en'; break;
case 'ru-ru': include(JPATH_SITE.'/administrator/components/com_jshopping/lang/ru-RU_alfabank.php'); $language = 'ru'; break;
default: include(JPATH_SITE.'/administrator/components/com_jshopping/lang/ru-RU_alfabank.php');
}
if ($pmconfigs['testmode']) {
$host = "https://web.rbsuat.com/ab/rest/register.do";
} else {
$host = "https://engine.paymentgate.ru/payment/rest/register.do";
}
//redirect if paymant complite
$notify_url = JURI::root()."index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_alfabank&order_id=".$order->order_id;
//redirect if paymant error
$cancel_return = JURI::root()."index.php?option=com_jshopping&controller=checkout&task=step7&act=cancel&js_paymentclass=pm_alfabank";
// params
$mecrchant_login = $pmconfigs['login'];
$mecrchant_pass = $pmconfigs['mecrchant_pass'];
$order_desc = _JHOP_ALFABANK_ORDER_PAY." ".$order->order_number;
// prepare curl option
$args = Array(
'userName' => $mecrchant_login,
'password' => $mecrchant_pass,
'amount' => $order->order_total * 100,
'currency' => '810',
'orderNumber' => $order->order_number,
'description' => $order_desc,
'returnUrl' => $notify_url,
'failUrl' => $cancel_return,
);
//curl
$alfaCurl = curl_init();
curl_setopt_array($alfaCurl, array(
CURLOPT_URL => $host,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($args)
));
$response = curl_exec($alfaCurl);
curl_close($alfaCurl);
$response = json_decode($response, true);
$errorCode = $response['errorCode'];
$alfaOrderId = $response['orderId'];
if ($errorCode == 0) {
$html = _JSHOP_ALFABANK_HTML;
$html .= '<p>'._JSHOP_ALFABANK_HTML_ORDER.$order->order_number._JSHOP_ALFABANK_SUMM.$order->order_total.'RUB</p>';
$html .= '<a class="button cancel" href="'.$response['formUrl'].'">'._JSHOP_ALFABANK_PAYNOW.'</a>';
$html .= '<a class="button cancel" href="'.$response['formUrl'].'">'._JSHOP_ALFABANK_PAYNOW.'</a>';
$db = JFactory::getDBO();
$jshop_order_summ = $order->order_total * 100;
$sql_order_data = "INSERT INTO `#__jshopping_order_pm_alfa` VALUES ('', '".$order->order_id."', '".$order->order_number."', 'RUR', '".$order->order_total."', 'created', '".$alfaOrderId."', '', 'registred');";
$db->setQuery($sql_order_data);
if(!$db->query()) {
echo __LINE__.$db->stderr();
}
} else {
$html = 'Error #'.$errorCode.': '.$response['errorMessage'];
}
$q = "SELECT #__jshopping_order_pm_alfa.ab_order_id FROM #__jshopping_order_pm_alfa WHERE #__jshopping_order_pm_alfa.js_order_id = '".$order->order_id."'";
$db = JFactory::getDBO();
$db->setQuery($q);
$orderId = $db->loadResult();
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?php echo '<div style="text-align: center;">'.$html.'</div>'; ?>
</body>
<?php
die();
}
function getUrlParams($pmconfigs) {
$params = array();
$params['order_id'] = JRequest::getInt("order_id");
$params['hash'] = "";
$params['checkHash'] = 0;
$params['checkReturnParams'] = 1;
return $params;
}
}
?>