AliPay for Hikashop

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45771

Blank page (like described above) when Alipay redirects me back to the sellers website. By the way, the status of the order was nat updated to confirmed either.

I have noticed there is a &is_success=T part within the url. May be Hikashop should be ajusted to understand the responce?

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45778

The "$return_url" should be the problem, so I will check this.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45780

Just wanted to let you know I am using 1.5.4 version of Hikashop if it makes any sense. Thanx

Update:

I have looked into the PayPal plugin and took some code from there:

		$notify_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=alipay&tmpl=component&lang='.$locale.$url_itemid;
		$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id.$url_itemid;
and it works now showing the THANK_YOU_FOR_PURCHASE="Thank you for your purchase" message, but the status is still 'created' and not 'confirmed'.

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.

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45804

Ok good, we will work in the statuses of the orders of your Alipay User Account in a second time.

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".

Last edit: 12 years 6 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45832

Here is the log:

Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Could not load any order for your notification Array
(
[option] => com_hikashop
[ctrl] => checkout
[task] => notify
[notif_payment] => alipay
[tmpl] => component
[lang] => en
[discount] => 0.00
[payment_type] => 1
[subject] => ORDER_FROM_YOUR_WEBSITE
[trade_no] => _hidden_
[buyer_email] => _hidden_
[gmt_create] => 2012-04-04 18:11:10
[notify_type] => trade_status_sync
[quantity] => 1
[out_trade_no] => 100765
[seller_id] => _hidden_
[notify_time] => 2012-04-04 18:11:11
[body] => order number : 100765
[trade_status] => WAIT_BUYER_PAY
[is_total_fee_adjust] => Y
[total_fee] => 0.01
[seller_email] => _hidden_
[price] => 0.01
[buyer_id] => _hidden_
[notify_id] => cf921b84dc60371260ffaac6488c127601
[use_coupon] => N
[sign_type] => MD5
[sign] => dfd16eb623ac48dd6e190bbe4f97e6c2
[view] => checkout
[Itemid] => 1
[hikashop_front_end_main] => 1
)



Could not load any order for your notification Array
(
[option] => com_hikashop
[ctrl] => checkout
[task] => notify
[notif_payment] => alipay
[tmpl] => component
[lang] => en
[discount] => 0.00
[logistics_type] => EXPRESS
[receive_zip] => 123123
[payment_type] => 1
[subject] => ORDER_FROM_YOUR_WEBSITE
[logistics_fee] => 0.00
[trade_no] => _hidden_
[buyer_email] => _hidden_
[gmt_create] => 2012-04-04 18:11:10
[notify_type] => trade_status_sync
[quantity] => 1
[logistics_payment] => BUYER_PAY
[out_trade_no] => 100765
[seller_id] => _hidden_
[notify_time] => 2012-04-04 18:11:49
[body] => order number : 100765
[trade_status] => WAIT_BUYER_PAY
[is_total_fee_adjust] => N
[total_fee] => 0.01
[seller_email] => _hidden_
[price] => 0.01
[buyer_id] => _hidden_
[gmt_logistics_modify] => 2012-04-04 18:11:10
[receive_phone] => 0571-88156688-0572
[notify_id] => af1cc1e37db3552a8a48eb3cb48b263b01
[use_coupon] => N
[receive_name] => Deniss
[sign_type] => MD5
[sign] => d675bb60ce60edf50e1ef4e6024d674f
[receive_address] => Line 1
[view] => checkout
[Itemid] => 1
[hikashop_front_end_main] => 1
)



Could not load any order for your notification Array
(
[option] => com_hikashop
[ctrl] => checkout
[task] => notify
[notif_payment] => alipay
[tmpl] => component
[lang] => en
[discount] => 0.00
[logistics_type] => EXPRESS
[receive_zip] => 123123
[payment_type] => 1
[subject] => ORDER_FROM_YOUR_WEBSITE
[logistics_fee] => 0.00
[trade_no] => _hidden_
[buyer_email] => _hidden_
[gmt_create] => 2012-04-04 18:11:10
[notify_type] => trade_status_sync
[quantity] => 1
[logistics_payment] => BUYER_PAY
[out_trade_no] => 100765
[seller_id] => _hidden_
[notify_time] => 2012-04-04 18:12:05
[body] => order number : 100765
[trade_status] => WAIT_SELLER_SEND_GOODS
[is_total_fee_adjust] => N
[gmt_payment] => 2012-04-04 18:12:05
[total_fee] => 0.01
[seller_email] => _hidden_
[price] => 0.01
[buyer_id] => _hidden_
[gmt_logistics_modify] => 2012-04-04 18:11:49
[receive_phone] => 0571-88156688-0572
[notify_id] => 4033cb53720d6ced33cdeda2735b218901
[use_coupon] => N
[receive_name] => Deniss
[sign_type] => MD5
[sign] => e97c0052c71c22b55af668456e05daa2
[receive_address] => Line 1
[view] => checkout
[Itemid] => 1
[hikashop_front_end_main] => 1
)



Could not load any order for your notification 

=> 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
12 years 6 months ago #45850

Ok can you please replace in "alipay.php" these lines :

$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;

Last edit: 12 years 6 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45852

After these changes I can not see any records about the new test orders, only about the old one I have posted earlier.
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

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45859

Good, now can you test it and tell me if you have the same error ?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45860

By the way, my error_log log file is full of this error:
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
12 years 6 months ago #45861

When you're testing the plugin put the debug mode off.

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';
}

Last edit: 12 years 6 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45862

After the new version of plugin was installed I have got same message as before:

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.'

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45866

1. Applied new code:

if($url['scheme'] == 'https')
{$transport = 'ssl://';
$url['port'] = '443';}
else {$transport = 'tcp://';
$url['port'] = '80';} 

2. Same error massage via Email.

3. More details for error_log file (debug is off in Plugin settings):
[04-Apr-2012 14:36:48 UTC] PHP Warning:  PHP Startup: PDO: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
[04-Apr-2012 14:36:48 UTC] PHP Warning:  PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
[04-Apr-2012 14:36:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite.so: undefined symbol: third_arg_force_ref in Unknown on line 0
[04-Apr-2012 14:36:48 UTC] PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20060613
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
[04-Apr-2012 14:36:52 UTC] PHP Warning:  readdir() expects parameter 1 to be resource, boolean given in /home/abc/public_html/libraries/joomla/filesystem/folder.php on line 424

4. No updates in hikashop log file.

Hope this helps

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45880

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");

Last edit: 12 years 6 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45886

Same error:

'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...

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45891

The problem can be caused by your hosting company :

- 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.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45894

Just sent the request. Waiting for the reply.

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?

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45900

Yes, I think that it could be a reason :).

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45907

Let's see what the hosting company will say.

Since we do not get any errors by the PHP interpreter, I think we should be fine shouldn't we?

Last edit: 12 years 6 months ago by seoweb.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 6 months ago #45978

Yes because the problem come from this line :

$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.

Last edit: 12 years 6 months ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 80
  • Thank you received: 1
12 years 6 months ago #45994

Good morning.

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.

Time to create page: 0.106 seconds
Powered by Kunena Forum