AliPay for Hikashop

  • Posts: 80
  • Thank you received: 1
12 years 8 months ago #44849

Hello,

Any chance to get an AliPay payment plugin for Hikashop any soon? I think this would open the whole Chinese market!

Regards,
SeoWeb

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45285

Hello,

We somehow managed to develop the alipay plugin but we don't have any test account, so if someone can test it for us, it would be great.

Regards,
Mohamed Thelji

Attachments:
The following user(s) said Thank You: seoweb

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45522

I wil test it for you and report back. Thanx for the Plugin!

Regards,
SeoWeb

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45582

Ok, I have got some results of my testing.

No matter what settings I use for the plugin I get the error message:



调试错误,请回到请求来源地,重新发起请求。
错误代码 ILLEGAL_PARTNER_EXTERFACE

说明:如果您不是因为本接口集成调试而看见该错误提醒,请联系本次请求来源网站,本错误属于网站集成接口的错误。

with a link to the documentation page: help.alipay.com/lab/index.htm?src=yy_reach_error where I can search using the string ILLEGAL_PARTNER_EXTERFACE.

There is only one relevant result for this term: help.alipay.com/lab/help_detail.htm?help...AL_PARTNER_EXTERFACE

Also there is another article saying that it might be that some of the AliPay Sellers features are not enabled (instant payment processing may be?)
www.oschina.net/question/163899_23976

We will check our Seller account to make a picture a bit clearer.

Will let you know...

Last edit: 12 years 7 months ago by seoweb.

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45588

Is this plugin designed for Instant Payment processing or for the Third Parties processing?

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45595

Hello, thank you for testing it !
This plugin is designed for a Third Parties processing, concerning your error message if you have correctly set your plugin it might be caused by the redirection link to the alipay's payment page or by your alipay's account setting.
If you can share your alipay's account or just your Partner ID and Security code by mp, it would help us a lot.

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

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45603

There are three options for AliPay to use:

现在支付宝公司给了用户三种接口:
1。快速付款(即时到账接口): service="create_direct_pay_by_user" 。
2。标准实物双接口(标准双接口): service="trade_create_by_buyer"
3。纯担保交易接口(担保接口): service="create_partner_trade_by_buyer"

Please note, there is no way to use instant payment (first one in a list) if the company in not registered in China.

I was informed that we use the create_partner_trade_by_buyer method. But when i change this in a alipay.php lile "service" => "create_partner_trade_by_buyer", I get an error ILLEGAL_ARGUMENT .

Unfortunately I can not share it with you, because they belong to live account and not Sandbox one, sorry. But I will be happy to continue testing following your instructions and reporting back about the results.

Last edit: 12 years 7 months ago by seoweb.

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45638

Yes, I think that you're right about the "service", so I will adjust my script and post it when I will need your test.
Thank you very much for your help SeoWeb :).



Can you test it like this please ?

$order_params = array(
"service" => "create_partner_trade_by_buyer",
"payment_type"=> "1",
"partner" => $method->payment_params->Partner_ID,
"seller_email" => $method->payment_params->email,
"return_url" => $return_url,
"notify_url" => $notify_url,
"_input_charset" => "utf-8",
"out_trade_no" => $out_trade_no,
"subject" => "order_name",
"body" => 'order number : '.$out_trade_no,
"total_fee" => $order->order_full_price
);

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

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45737

Hello,

Thanx for the code. Just tested and have got an error message:

抱歉,无法完成付款!

交易信息有误,请重新核实交易详情再付款。

错误代码:ILLEGAL_ARGUMENT

Is it possible there is something missing? Here is the sample code AliPay provides to the developers:

$parameter = array(
"service" => "create_partner_trade_by_buyer",
"payment_type" => "1",

"partner" => trim($aliapy_config),
"_input_charset" => trim(strtolower($aliapy_config)),
"seller_email" => trim($aliapy_config),
"return_url" => trim($aliapy_config),
"notify_url" => trim($aliapy_config),

"out_trade_no" => $out_trade_no, //generated by Hika
"subject" => $subject,
"body" => $body,
"price" => $price,
"quantity" => $quantity,

"logistics_fee" => $logistics_fee,
"logistics_type" => $logistics_type,
"logistics_payment" => $logistics_payment,

"receive_name" => $receive_name,
"receive_address" => $receive_address,
"receive_zip" => $receive_zip,
"receive_phone" => $receive_phone,
"receive_mobile" => $receive_mobile,

"show_url" => $show_url
);

As you can see there are more paramitres in that array. May be AliPay needs more?

Last edit: 12 years 7 months ago by seoweb.

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45738

I don't know if all of this parameters are needed but i will adjust the script for your next test.



Can you test it like this please ?

$order_params = array(
"seller_email" => $method->payment_params->email,
"service" => "create_partner_trade_by_buyer",
"partner" => $method->payment_params->Partner_ID,
"return_url" => $return_url,
"notify_url" => $notify_url,
"_input_charset" => "utf-8",
"subject" => "ORDER FROM YOUR WEBSITE",
"body" => 'order number : '.$out_trade_no,
"out_trade_no" => $out_trade_no,
"payment_type"=> "1",
"total_fee" => $order->order_full_price,
"logistics_type"=>"EXPRESS",
"logistics_fee"=> 0,
"logistics_payment"=>"BUYER_LOGISTIC_PAY",
'receive_name' => "ORDER RECEIVER",
'receive_address' => "ADRESSE",
'receive_zip' => "69150",
'receive_phone' => "0600000000"
);


The "Quantity" and "price" are not needed if you set the "total_fee"

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

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45743

No luck, same error:

抱歉,无法完成付款!

交易信息有误,请重新核实交易详情再付款。

错误代码:ILLEGAL_ARGUMENT

Please find the sample code provided by Alipay. If you ajust the alipay.config.php for both Seller and Buyer with correct account details everything will work fine!

File Attachment:

File Name: AlipaySampleCode.zip
File Size:43 KB

Attachments:
Last edit: 12 years 7 months ago by seoweb.

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45749

I already checked this code and used it to create the redirection's link to the alipay payment page, but I will look at this again.
Moreover, I made a few mistake in my previews script, "logistic_fee" should be like this :

"logistics_fee"=> "0.00"

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

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45750

Still the same:

抱歉,无法完成付款!

交易信息有误,请重新核实交易详情再付款。

错误代码:ILLEGAL_ARGUMENT


What are the recommended settings for the payment plugin itself? May be I have got something wrong?


Attachments:

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45751

These ones are not working as well.


Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45753

I think that your first configuration was good, can you test it for me please ?

And if it is doesn't work can you replace in alipay_end.php :

this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="get">

by this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action=" mapi.alipay.com/gateway.do?_input_charset=utf-8 " method="get">

Attachments:

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45754

Here are the results:

1. When I have deleted the old plugin, installed the new version and ran a test using first configuration I have got an error:

调试错误,请回到请求来源地,重新发起请求。
错误代码 ILLEGAL_SIGN

说明:如果您不是因为本接口集成调试而看见该错误提醒,请联系本次请求来源网站,本错误属于网站集成接口的错误。

2. I then replaced the line

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="get">

with

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="mapi.alipay.com/gateway.do?_input_charset=utf-8" method="get">

I ahve got this error message:

Not Found

The requested URL /newsim/checkout/step/mapi.alipay.com/gateway.do was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I think the action=" mapi.alipay.com/gateway.do?_input_charset=utf-8 " is not correct so I have changed it to action=" mapi.alipay.com/gateway.do?_input_charset=utf-8 "

and have got the same error message:

调试错误,请回到请求来源地,重新发起请求。
错误代码 ILLEGAL_SIGN

Any idea?

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45755

This error message seems better so now I will check the "sign" :).



1. Can you please replace in alipay_end.php :

this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="get">

by this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="POST">

==> tell me the result

2. Replace in alipay_end.php :

this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="get">

by this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action=" www.alipay.com/cooperate/gateway.do ?" method="get">

==> tell me the result :).

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

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45758

Since there is no english help I can only offer you a link to a chinese article in regards to this error: club.alipay.com/read-htm-tid-8681631.html

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

  • Posts: 80
  • Thank you received: 1
12 years 7 months ago #45767

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="get">

by this line :

<form id="hikashop_alipay_form" name="hikashop_alipay_form" action="<?php echo $alipay_link; ?>" method="POST">

==> did not get any errors, was able to pay successfully, and when AliPay was redirecting back to my website to report the cussessfull sale it was requestinf the https connection. We do not have SSL installed, so which part of the code I need to change to get the return url with http: in it?

Update:
Once I have changed the $httpsHikashop = str_replace('http://','https://', HIKASHOP_LIVE); to $httpsHikashop = str_replace('http://','https://', HIKASHOP_LIVE); I did not receive any errors at all, which is a good sign :-), but I can only see the blank page which is generated using this URL:

http://www.abc.com/index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=alipay&tmpl=component&user_return=1&lang=en&body=order+number+%3A+100760&buyer_email=_hidden_&buyer_id=_hidden_&discount=0.00&gmt_create=2012-04-03+23%3A22%3A17&gmt_logistics_modify=2012-04-03+23%3A22%3A17&gmt_payment=2012-04-03+23%3A22%3A37&is_success=T&is_total_fee_adjust=N&logistics_fee=0.00&logistics_payment=BUYER_PAY&logistics_type=EXPRESS&notify_id=RqPnCoPT3K9%252Fvwbh3I7ymxG0iJUuUJD58RjiCVi6H0dpb2jtQCH%252FD%252B7JMImaDkU4VV2T&notify_time=2012-04-03+23%3A22%3A42&notify_type=trade_status_sync&out_trade_no=100760&payment_type=1&price=0.01&quantity=1&receive_address=ADRESSE&receive_name=ORDER+RECEIVER&receive_phone=0600000000&receive_zip=69150&seller_actions=SEND_GOODS&seller_email=jaginehe%40hotmail.com&seller_id=_hidden_&subject=ORDER+FROM+YOUR+WEBSITE&total_fee=0.01&trade_no=_hidden_&trade_status=WAIT_SELLER_SEND_GOODS&use_coupon=N&sign=_hidden_&sign_type=MD5

Please note some parts in a url are being replaced with _hidden_ .

We are almost there!!!

Last edit: 12 years 7 months ago by seoweb.

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

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #45770

I think that you can replace in alipay.php:

line 72-73 :

$notify_url = $httpsHikashop.'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=alipay&tmpl=component&lang='.$locale;
$return_url = $httpsHikashop.'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=alipay&tmpl=component&user_return=1&lang='.$locale;

by :

$notify_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=alipay&tmpl=component&lang='.$locale;
$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=alipay&tmpl=component&user_return=1&lang='.$locale;


by the way, can you replace $order_params by :

$order_params = array(
"seller_email" => $method->payment_params->email,
"service" => "create_partner_trade_by_buyer",
"partner" => $method->payment_params->Partner_ID,
"return_url" => $return_url,
"notify_url" => $notify_url,
"_input_charset" => "utf-8",
"subject" => "ORDER_FROM_YOUR_WEBSITE",
"body" => 'order number : '.$out_trade_no,
"out_trade_no" => $out_trade_no,
"payment_type"=> "1",
"price" => $order->order_full_price,
"quantity" => "1",
"logistics_type"=>"EXPRESS",
"logistics_fee"=> "0.00",
"logistics_payment"=>"BUYER_PAY",
);

==> tell me if it works :)

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

Time to create page: 0.113 seconds
Powered by Kunena Forum