Can your replace in your alipay.php these lines :
while(!feof($fp)) {
$response = @fgets($fp, 1024);
}
fclose($fp);
if($element->payment_params->debug){
echo print_r($response,true)."\n\n\n";
}
$notify=implode(',', $notify);
by :
while(!feof($fp)) {
$response[] = @fgets($fp, 1024);
}
fclose($fp);
if($element->payment_params->debug){
echo print_r($response,true)."\n\n\n";
}
$notify=implode(',', $response);
and this :
$url = parse_url($url_notify);
$errno='';
$errstr='';
$notify = array();
if($url == 'https') {
$transport = 'ssl://';
$url = '443';
} else {
$transport = 'tcp://';
$url = '80';
}
if($element->payment_params->debug){
echo print_r($url,true)."\n\n\n";
}
$fp = @fsockopen($transport . $url, $url, $errno, $errstr, 60);
if(!$fp) {
$mailer->setSubject(JText::sprintf('NOTIFICATION_REFUSED_FOR_THE_ORDER','Alipay').' '.JText::sprintf('PAYPAL_CONNECTION_FAILED',$dbOrder->order_number));
$body = str_replace('<br/>',"\r\n",JText::sprintf('NOTIFICATION_REFUSED_NO_CONNECTION','Alipay'))."\r\n\r\n".$order_text;
$mailer->setBody($body);
$mailer->Send();
JError::raiseError( 403, JText::_( 'Access Forbidden' ));
return false;
} else {
fputs($fp, "POST " . $url . " HTTP/1.1\r\n");
fputs($fp, "HOST: " . $url . "\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: " . strlen($url) . "\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $url . "\r\n\r\n");
by :
$url_array = parse_url($url_notify);
$errno='';
$errstr='';
$notify = array();
if($url_array == 'https') {
$transport = 'ssl://';
$url_array = '443';
} else {
$transport = 'tcp://';
$url_array = '80';
}
if($element->payment_params->debug){
echo print_r($url,true)."\n\n\n";
}
$fp = @fsockopen($transport . $url_array, $url_array, $errno, $errstr, 60);
if(!$fp) {
$mailer->setSubject(JText::sprintf('NOTIFICATION_REFUSED_FOR_THE_ORDER','Alipay').' '.JText::sprintf('PAYPAL_CONNECTION_FAILED',$dbOrder->order_number));
$body = str_replace('<br/>',"\r\n",JText::sprintf('NOTIFICATION_REFUSED_NO_CONNECTION','Alipay'))."\r\n\r\n".$order_text;
$mailer->setBody($body);
$mailer->Send();
JError::raiseError( 403, JText::_( 'Access Forbidden' ));
return false;
} else {
fputs($fp, "POST " . $url_array . " HTTP/1.1\r\n");
fputs($fp, "HOST: " . $url_array . "\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: " . strlen($url_array) . "\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $url_array . "\r\n\r\n");