- Posts: 80
- Thank you received: 1
AliPay for Hikashop
I have noticed there is a &is_success=T part within the url. May be Hikashop should be ajusted to understand the responce?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
Update:
I have looked into the PayPal plugin and took some code from there:
I have checked the statuses of the orders in my AliPay User Account area and I can see the status is set to 'Waiting for dispatch'. Since Alipay logic is different from PayPal I think Hikashop should have a way to let the AliPay know that the Product has been sent to the customer. Probably when the status will be changed manually to 'Shipped' Hikashop should trigger AliPay's website and let them know that the product has been sent to the customer. For this there is another part of the API called (send_goods_confirm_by_platform) which I think should be utilized when the order status is changed to 'Shipped' and this logic should only be used when the AliPay payment methos has been used by the customer and not PayPal.
According to AliPay's logic there should be one more step: Once the buyer receives the product, he has to confirm this fact using AliPay's website. Only After this money will be transferred to Seller's account.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Now, can you please :
1. activate the debug mode in the configuration of your alipay plugin.
2. do a simple test of purshase.
3. and then send me screenshots of your logs (Hikashop -> Configuration -> Files -> see the report).
==> It was a good idea to change the "$return_url" but I think that the problem come from the "$notify_url".
Please Log in or Create an account to join the conversation.
=> I have changed both return_urk and notify_url .
Regards
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
$dbOrder = $orderClass->get((int)@$vars);
if(empty($dbOrder)){
echo "Could not load any order for your notification ".@$vars;
by these lines :
$dbOrder = $orderClass->get((int)@$vars);
if(empty($dbOrder)){
echo "Could not load any order for your notification ".@$vars;
==> tell me if it works.
And can you replace also the "notify_url" by :
$notify_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=alipay&tmpl=component&lang='.$locale.$url_itemid;
Please Log in or Create an account to join the conversation.
The whole purchising procedure went fine without any errors.
Update:
Just got a message via email from Hikashop itself:
Hello,
A Alipay notification was refused because the connection to the confirmation server failed.
This notification was for the order J1G0M0E767 on the website www.didamobile.com/
You can access the order details directly by clicking on the link below after logging in your back end:
www.abc.com/administrator/index.php?opti...edit&order_id=100767
And these messages are continuing to arrive every 1 to 5 minutes
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /home/abc/public_html/libraries/joomla/filesystem/folder.php on line 424
The file size is about 700 MB now!
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Update
can you also replace in alipay.php these lines :
if($url == 'https') {
$transport = 'ssl://';
$url = '443';
} else {
$transports = 'tcp://';
$url = '80';
}
by theses lines :
if($url == 'https') {
$transport = 'ssl://';
$url = '443';
} else {
$transport = 'tcp://';
$url = '80';
}
Please Log in or Create an account to join the conversation.
Hello,
A Alipay notification was refused because the connection to the confirmation server failed.
This notification was for the order J1G0M0F768 on the website www.didamobile.com/
You can access the order details directly by clicking on the link below after logging in your back end:
www.abc.com/administrator/index.php?opti...edit&order_id=100768
The order status is still 'Created' and I continue to get error messages 'A Alipay notification was refused because the connection to the confirmation server failed.'
Please Log in or Create an account to join the conversation.
2. Same error massage via Email.
3. More details for error_log file (debug is off in Plugin settings):
4. No updates in hikashop log file.
Hope this helps
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
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");
Please Log in or Create an account to join the conversation.
'A Alipay notification was refused because the connection to the confirmation server failed.' arrives once I am redirected to AliPay to complete the payment and another time when the payment has been confirmed by AliPay and I get rediracted back to the Seller's website and a couple more times after that...
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
- do you know if they allow outgoing connection to another server ?
- and can you ask them if they can allow an outgoing connection to the alipay server ?
Please Log in or Create an account to join the conversation.
They have just updated their servers to PHP version PHP 5.3.10. May be this is a reason why we can not implement the AliPay solution successfully?
We have a PayPal payment plugin working without any problems on our website. Do you think there is still a possibility they block outgoing connections?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.
Since we do not get any errors by the PHP interpreter, I think we should be fine shouldn't we?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
$fp = @fsockopen($transport . $url_array, $url_array, $errno, $errstr, 60);
==> it means that your server can't accept any outgoing connections from the Alipay server.
Please Log in or Create an account to join the conversation.
The are asking what are the outgoing port numbers we want them to open.
Please Log in or Create an account to join the conversation.