AliPay Order status not changed when complete checkout

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #271973

Hi,

I'm using hikashop in china.

When customer finish the payment with Alipay, the order status in backend is still show 【created】not confirmed.

How fix it?

Thanks.

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
7 years 5 months ago #272011

Hello,

We'll need more information about your issue so can you :
- Check that the debug mode option is ON through your Alipay payment configuration page
- Test it again
- Check your Payment log file content through "Hikashop->System->Configuration->Main" by using the "See the report" button of your Payment log file option.
- Show us its content

Also can you show us some screenshots of how you configured your Alipay payment method ? Because you should also make sure to enable the "Allow payment notifications" option

Thank you.

Last edit: 7 years 5 months ago by Mohamed Thelji.

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272039

Hi,

I have just consulted Alipay customer service. The payment interface used by hikashop is out of date.

Here is the new development document.

doc.open.alipay.com/docs/doc.htm?treeId=...eId=105288&docType=1

In addition, hikashop has plan to develop new Alipay payment plugin?

Best Regards,
Arvin

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272040

Hi,

I will follow your instructions to try again,and give you feedback soon.

Thank you for your reply.

Arvin

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272048

Hi,

I just try it again, but the issue still exists.

The attachment is my screenshot of the steps.

And the logs of alipay payment shows that, a 301 redirect.

Plese check it.

This message contains confidential information

Last edit: 7 years 5 months ago by Jerome.

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272049

By the way,
I can provide a partner ID account password, and my personal Alipay account is used to pay for the test if needed.

Arvin

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 5 months ago #272078

Hello,

Please edit the alipay plugin code and replace the content

		if($this->_transport == 'https') {
			$this->_gateway = 'http://www.alipay.com/cooperate/gateway.do?';
By
		if($this->_transport == 'https') {
			$this->_gateway = 'https://www.alipay.com/cooperate/gateway.do?';
It will force the usage of HTTPS protocol.
Afterwards, please let us know if the patch is working so we can integrate it.

We do not plan to create a new Alipay plugin ; the development of that one was very complicated because we do not read or understand Chinese. From the documentation to the tests ; it was very very difficult for us.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272126

Hello,

When i change the protocol from HTTP to HTTPS ,it works correctly.

Thanks VERY Much.

Well,
Hikashop, as one of the popular e-commerce components in joomla, I am looking forward to that, Your team can develop a new alipay payment plugin in the future.

Using the new alipay payment interface, when a user open the payment page on mobile phone, it will automatically call alipay mobile client to complete the payment if it been installed on the phone. Otherwise,it will continue to complete the payment through the alipay website page.

It will improve the user's payment experience. After all, mobile payment has become mainstream.

Important:MD5 is not supported for sign_type with the new alipay wap payment interface.Official recommended RSA2.

Maybe, I will ask someone to help to develop new alipay payment plugin for me, If your team do not plan to create a new Alipay plugin.

Thanks again for your help and your excellent work.

Regards,

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 5 months ago #272140

Hello,

If you can find some English documentation for the new AliPay API ; we can see what we can do.
Even if it is possible to find a tiny list of SDK or lib in github (like: github.com/bitmash/alipay-api-php ), there is nothing which can really explain how it is working, the parameters, etc.
So if there is just some documentation in Chinese ; I'm sorry but we won't be able to make it. The first implementation was too complicated and a real pain to understand the doc and perform tests.
And I'm afraid the answer would be the same with most of HikaShop partners who do not understand Chinese either.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272166

Hello,

I will try to find some english documentation or translate the key document for you, if i have free time.

Now I still have a problem that needs your help. I want use order_number as the value of $out_trade_no.
I tried to replace some of the code and can complete the payment. However, there is no order status update, no alipay payment notification, no payment log records(debug is on).

What should i do?

Regards,

Attachments:
Last edit: 7 years 5 months ago by iaiai.

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272174

Hello,

Here is my suggestion for the alipay plugin.

Please check the screenshot.

The official document highlights this:

程序执行完后必须打印输出“success”(不包含引号)。如果商户反馈给支付宝的字符不是success这7个字符,支付宝服务器会不断重发通知,直到超过24小时22分钟。一般情况下,25小时以内完成8次通知(通知的间隔频率一般是:4m,10m,10m,1h,2h,6h,15h);

当商户收到服务器异步通知并打印出success时,服务器异步通知参数notify_id才会失效。也就是说在支付宝发送同一条异步通知时(包含商户并未成功打印出success导致支付宝重发数次通知),服务器异步通知参数notify_id是不变的。

docs.open.alipay.com/270/105902#s7

Attachments:

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

  • Posts: 12
  • Thank you received: 2
7 years 5 months ago #272210

Hi,

Repeated notifications still exist, even if I print out "success".

My modified code:

 		if((preg_match('/true$/i', $response) && $sign == $_POST['sign']) && ( /* $_POST['trade_status'] == 'TRADE_FINISHED' || */ $_POST['trade_status'] == 'TRADE_SUCCESS' || $_POST['trade_status'] == 'WAIT_SELLER_SEND_GOODS' /* || $_POST['trade_status']== 'WAIT_BUYER_PAY' */ )) {

			$price_check = round($dbOrder->order_full_price, (int)$this->currency->currency_locale['int_frac_digits'] );

			$history->notified=1;
			$history->amount=$price_check;
			$history->data = ob_get_clean();

			$order_status = $this->payment_params->verified_status;


			if($dbOrder->order_status == $order_status) echo "success"; //return true;
			$mail_status=$statuses[$order_status];
			$email->subject = JText::sprintf('PAYMENT_NOTIFICATION_FOR_ORDER','Alipay',$_POST['trade_status'],$dbOrder->order_number);
			$email->body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Alipay',$_POST['trade_status'])).' '.JText::sprintf('ORDER_STATUS_CHANGED',$mail_status)."\r\n\r\n".$order_text;

			$this->modifyOrder($order_id,$order_status,$history,$email);
			
            echo "success";
		//  return true;
		} else {
			$email->subject = JText::sprintf('NOTIFICATION_REFUSED_FOR_THE_ORDER','Alipay').'invalid response';
			$email->body = JText::sprintf("Hello,\r\n An Alipay notification was refused because the response from the Alipay server was invalid")."\r\n\r\n".$order_text;

			$this->modifyOrder($order_id,null,false,$email);

			if($this->payment_params->debug){
				$this->writeToLog('invalid response'."\n\n\n");
			}
			
			echo "fail";
		//	return false;
		} 


'TRADE_FINISHED' means that,After the order is completed for three months, the refund will not be allowed and the alipay server will send the notification to hikashop three months later, allowing the merchant to perform a custom action based on the result of this notification.


更新分割线

Maybe echo "success" only works for the two gateway mapi.alipay.com/gateway.do and openapi.alipay.com/gateway.do .

I used return "success", Now it works fine. See screenshot 5.

Last edit: 7 years 5 months ago by iaiai.

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

  • Posts: 12953
  • Thank you received: 1778
7 years 5 months ago #272226

Hello,

The best solution will probably be to use :

return "success";
Instead of :
 echo "success";



And :
return "fail";
Instead of :
 echo "fail";


EDIT

I used return "success", Now it works fine. See screenshot 5.


Good ! Thank you for your feedback.

Last edit: 7 years 5 months ago by Mohamed Thelji.

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

  • Posts: 57
  • Thank you received: 0
7 years 5 months ago #272593

Yes, a new alipay plugin please.

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

  • Posts: 57
  • Thank you received: 0
6 years 8 months ago #289096

iaiai wrote: Hello,
Using the new alipay payment interface, when a user open the payment page on mobile phone, it will automatically call alipay mobile client to complete the payment if it been installed on the phone. Otherwise,it will continue to complete the payment through the alipay website page.

It will improve the user's payment experience. After all, mobile payment has become mainstream.


Is this feature included in the below alipay plugin?
www.hikashop.com/support/documentation/i...ent-alipay-form.html

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

  • Posts: 12953
  • Thank you received: 1778
6 years 8 months ago #289106

Hello,

That feature wasn't developed for the moment so if you need the help of a professional developer to quickly develop it, you can check our partners section : www.hikashop.com/home/our-partners.html

Best regards,
Mohamed Thelji.

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

Time to create page: 0.126 seconds
Powered by Kunena Forum