Skip to main content

alipay return_url and notify_url seems have issue

More
11 years 4 months ago #201805 by aotogou@gmail.com
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.0
-- PHP version -- : 5.3.3
-- Browser(s) name and version -- : Chrome Version 42.0.2311.135 (64-bit)

Hi there,

I'm using alipay payment method for by website. Trade can be made after redirected to alipay website.
However, the order status is not updating after redirected back to my site, although the message like "Thank you for your purchage @ xxxxx" is displaying properly.

I looked into the code, not sure if I found out the cause of issue or not:
In the return_url or notify_url of alipay, they're:
$notify_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=alipay&tmpl=component&lang='.$this->locale.$this->url_itemid;
and
$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order->order_id.$this->url_itemid;

They both have query string. However, in the integration document officially provided by alipay, says the reture_url or notify_url can't have query strings. Maybe that's why the order status from alipay seems not being read, and error email saying "An Alipay notification was refused because the response from the Alipay server was invalid" continually occurs.

I'm not sure how do you control this return_url and notify_url issue for alipay, so I'm trying to get help here.

Thanks for your time.

Regards,
Yang

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

More
11 years 4 months ago - 11 years 4 months ago #201832 by Mohamed Thelji
Hello Yang,
Can you :
- Use that last Alipay version
- Set the Alipay "Debug" option to YES
- Test it again
- Show me your Payment log file content.

You'll be able to check your payment log file through "Hikashop->System->Configuration->Main" by using the "See the report" button of your Payment log file option.
Last edit: 11 years 4 months ago by Mohamed Thelji.

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

More
11 years 4 months ago #201854 by aotogou@gmail.com
Hi Mohamed,

Here's the log:
*************************

-- 05.15.15 23:16:08 --
Array
(
[option] => com_hikashop
[ctrl] => checkout
[task] => notify
[notif_payment] => alipay
[tmpl] => component
[lang] => en
[Itemid] => 329
[discount] => 0.00
[payment_type] => 1
[subject] => order number : 64
[trade_no] => 2015051500001000320058924060
[buyer_email] => lliyyang2@163.com
[gmt_create] => 2015-05-15 21:15:56
[notify_type] => trade_status_sync
[quantity] => 1
[out_trade_no] => 64
[seller_id] => 2088912559319093
[notify_time] => 2015-05-15 21:15:56
[trade_status] => WAIT_BUYER_PAY
[is_total_fee_adjust] => Y
[total_fee] => 0.01
[seller_email] => aotogou@gmail.com
[price] => 0.01
[buyer_id] => 2088002454394320
[notify_id] => ff0df07f91155fd66ebcf418aa656d6a3s
[use_coupon] => N
[sign_type] => MD5
[sign] => 761158796dd03684546bf971e591f541
)



-- 05.15.15 23:16:08 --
stdClass Object
(
[order_id] => 64
[order_billing_address_id] => 22
[order_shipping_address_id] => 22
[order_user_id] => 11
[order_status] => created
[order_type] => sale
[order_number] => C6U4
[order_created] => 1431695527
[order_modified] => 1431695527
[order_invoice_id] => 0
[order_invoice_number] =>
[order_invoice_created] => 0
[order_currency_id] => 38
[order_full_price] => 0.01000
[order_tax_info] => Array
(
)

[order_discount_code] =>
[order_discount_price] => 0.00000
[order_discount_tax] => 0.00000
[order_payment_id] => 2
[order_payment_method] => alipay
[order_payment_price] => 0.00000
[order_payment_params] =>
[order_shipping_id] =>
[order_shipping_method] =>
[order_shipping_price] => 0.00000
[order_shipping_tax] => 0.00000
[order_shipping_params] =>
[order_partner_id] => 0
[order_partner_price] => 0.00000
[order_partner_paid] => 0
[order_partner_currency_id] => 0
[order_ip] => 115.64.108.79
[order_site_id] =>
)



-- 05.15.15 23:16:08 --
stdClass Object
(
[order_id] => 64
[order_billing_address_id] => 22
[order_shipping_address_id] => 22
[order_user_id] => 11
[order_status] => created
[order_type] => sale
[order_number] => C6U4
[order_created] => 1431695527
[order_modified] => 1431695527
[order_invoice_id] => 0
[order_invoice_number] =>
[order_invoice_created] => 0
[order_currency_id] => 38
[order_full_price] => 0.01000
[order_tax_info] => Array
(
)

[order_discount_code] =>
[order_discount_price] => 0.00000
[order_discount_tax] => 0.00000
[order_payment_id] => 2
[order_payment_method] => alipay
[order_payment_price] => 0.00000
[order_payment_params] =>
[order_shipping_id] =>
[order_shipping_method] =>
[order_shipping_price] => 0.00000
[order_shipping_tax] => 0.00000
[order_shipping_params] =>
[order_partner_id] => 0
[order_partner_price] => 0.00000
[order_partner_paid] => 0
[order_partner_currency_id] => 0
[order_ip] => 115.64.108.79
[order_site_id] =>
)



-- 05.15.15 23:16:08 --
Array
(
[scheme] => http
[host] => notify.alipay.com
[path] => /trade/notify_query.do
[query] => partner=2088912559319093¬ify_id=ff0df07f91155fd66ebcf418aa656d6a3s
[port] => 80
)



-- 05.15.15 23:16:11 --
Array
(
[0] => HTTP/1.1 200 OK

[1] => Server: Tengine/2.1.0

[2] => Date: Fri, 15 May 2015 13:16:00 GMT

[3] => Content-Type: text/html;charset=GBK

[4] => Content-Length: 4

[5] => Connection: close

[6] => Set-Cookie: JSESSIONID=F19A51D02D1AA2CF2D648E2AC90A63A9; Path=/

[7] => Set-Cookie: ALIPAYJSESSIONID=GZ00rEJttkSZglEKZsrIp3Ymb1HSEQsuperapiGZ00; Domain=.alipay.com; Path=/

[8] => Set-Cookie: ctoken=SXu19OOxtYKU4cagN4a1XYUO3+IbZC; Domain=.alipay.com; Path=/

[9] => Cache-Control: max-age=0,no-cache

[10] => Expires: Thu, 05 Jan 1995 22:00:00 GMT

[11] => Pragma: no-cache

[12] => Set-Cookie: spanner=AoYqKdmrG2V1LjfjizZbnraTibwWXJaSXt2T4qEYgj0=;path=/;secure;

[13] =>

[14] => true
)



-- 05.15.15 23:16:11 --

sign1 :
6f9a0cd39c7ba4f3518002e1e940a467


-- 05.15.15 23:16:11 --

sign2 :
761158796dd03684546bf971e591f541


-- 05.15.15 23:16:11 --
invalid response


-- 05.15.15 23:18:41 --
Array
(
[option] => com_hikashop
[ctrl] => checkout
[task] => notify
[notif_payment] => alipay
[tmpl] => component
[lang] => en
[Itemid] => 329
[discount] => 0.00
[logistics_type] => EXPRESS
[receive_zip] => 3166
[payment_type] => 1
[subject] => order number : 64
[logistics_fee] => 0.00
[trade_no] => 2015051500001000320058924060
[buyer_email] => lliyyang2@163.com
[gmt_create] => 2015-05-15 21:15:56
[notify_type] => trade_status_sync
[quantity] => 1
[logistics_payment] => BUYER_PAY
[out_trade_no] => 64
[seller_id] => 2088912559319093
[notify_time] => 2015-05-15 21:18:28
[trade_status] => WAIT_SELLER_SEND_GOODS
[is_total_fee_adjust] => N
[gmt_payment] => 2015-05-15 21:18:28
[total_fee] => 0.01
[seller_email] => aotogou@gmail.com
[price] => 0.01
[buyer_id] => 2088002454394320
[gmt_logistics_modify] => 2015-05-15 21:15:56
[receive_phone] => +61452512657
[notify_id] => b7e89620380c399c5bcbd3256e2ee40c3s
[receive_name] => Li Yang
[use_coupon] => N
[sign_type] => MD5
[sign] => 71c7b9d9387f9a99aee2d686baece733
[receive_address] => U407 19 Hanover St
)



-- 05.15.15 23:18:41 --
stdClass Object
(
[order_id] => 64
[order_billing_address_id] => 22
[order_shipping_address_id] => 22
[order_user_id] => 11
[order_status] => created
[order_type] => sale
[order_number] => C6U4
[order_created] => 1431695527
[order_modified] => 1431695771
[order_invoice_id] => 0
[order_invoice_number] =>
[order_invoice_created] => 0
[order_currency_id] => 38
[order_full_price] => 0.01000
[order_tax_info] => Array
(
)

[order_discount_code] =>
[order_discount_price] => 0.00000
[order_discount_tax] => 0.00000
[order_payment_id] => 2
[order_payment_method] => alipay
[order_payment_price] => 0.00000
[order_payment_params] =>
[order_shipping_id] =>
[order_shipping_method] =>
[order_shipping_price] => 0.00000
[order_shipping_tax] => 0.00000
[order_shipping_params] =>
[order_partner_id] => 0
[order_partner_price] => 0.00000
[order_partner_paid] => 0
[order_partner_currency_id] => 0
[order_ip] => 115.64.108.79
[order_site_id] =>
)



-- 05.15.15 23:18:41 --
stdClass Object
(
[order_id] => 64
[order_billing_address_id] => 22
[order_shipping_address_id] => 22
[order_user_id] => 11
[order_status] => created
[order_type] => sale
[order_number] => C6U4
[order_created] => 1431695527
[order_modified] => 1431695771
[order_invoice_id] => 0
[order_invoice_number] =>
[order_invoice_created] => 0
[order_currency_id] => 38
[order_full_price] => 0.01000
[order_tax_info] => Array
(
)

[order_discount_code] =>
[order_discount_price] => 0.00000
[order_discount_tax] => 0.00000
[order_payment_id] => 2
[order_payment_method] => alipay
[order_payment_price] => 0.00000
[order_payment_params] =>
[order_shipping_id] =>
[order_shipping_method] =>
[order_shipping_price] => 0.00000
[order_shipping_tax] => 0.00000
[order_shipping_params] =>
[order_partner_id] => 0
[order_partner_price] => 0.00000
[order_partner_paid] => 0
[order_partner_currency_id] => 0
[order_ip] => 115.64.108.79
[order_site_id] =>
)



-- 05.15.15 23:18:41 --
Array
(
[scheme] => http
[host] => notify.alipay.com
[path] => /trade/notify_query.do
[query] => partner=2088912559319093¬ify_id=b7e89620380c399c5bcbd3256e2ee40c3s
[port] => 80
)



-- 05.15.15 23:18:46 --
Array
(
[0] => HTTP/1.1 200 OK

[1] => Server: Tengine/2.1.0

[2] => Date: Fri, 15 May 2015 13:18:33 GMT

[3] => Content-Type: text/html;charset=GBK

[4] => Content-Length: 4

[5] => Connection: close

[6] => Set-Cookie: JSESSIONID=C3435A84F2BF5B2138FB2EF4A154681C; Path=/

[7] => Set-Cookie: ALIPAYJSESSIONID=GZ00XRgPES621eaiHaFta0O8ZRLhxhsuperapiGZ00; Domain=.alipay.com; Path=/

[8] => Set-Cookie: ctoken=zm2nTjA4K7CypXqycCOfJALZUpO7d0; Domain=.alipay.com; Path=/

[9] => Cache-Control: max-age=0,no-cache

[10] => Expires: Thu, 05 Jan 1995 22:00:00 GMT

[11] => Pragma: no-cache

[12] => Set-Cookie: spanner=/Yd7Bz4dUzD6M5xJg5L8cb7MWl3iz1yw;path=/;secure;

[13] =>

[14] => true
)



-- 05.15.15 23:18:46 --

sign1 :
8eeb1e02444a05271b8cc2e035f9dcf9


-- 05.15.15 23:18:46 --

sign2 :
71c7b9d9387f9a99aee2d686baece733


-- 05.15.15 23:18:46 --
invalid response

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

More
11 years 4 months ago #201858 by Mohamed Thelji
As it's said on the payment log file, your issue is coming from the fact that the "SIGN" code that your website calculated isn't the same as the Alipay platform :

sign1 :
8eeb1e02444a05271b8cc2e035f9dcf9

sign2 :
71c7b9d9387f9a99aee2d686baece733
[/code]

Also, note that the alipay payment method can't handle the "partner" mode, you should use the "direct" mode.

The following user(s) said Thank You: aotogou@gmail.com

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

More
10 years 11 months ago #216191 by graceufo
I face the same problem.
any feedback.
thanks

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

More
10 years 11 months ago #216201 by nicolas
Hi,

So, are you using the latest version of HikaShop ? If not, please update.
Then, if you still have the issue, please follow our instructions above and activate the debug mode of the payment plugin and do a test purchase again. Then, provide the content of the payment log file so that we can understand your issue.

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

More
10 years 11 months ago #216547 by graceufo
Yes I am using the latest version.
and the debug report is below:(I have rewrite the buyer-email and seller-email for private reason,I think it does matter,right?)
Code:
-- 10.04.15 11:54:06 -- Array ( [option] => com_hikashop [ctrl] => checkout [task] => notify [notif_payment] => alipay [tmpl] => component [lang] => zh [Itemid] => 396 [discount] => 0.00 [payment_type] => 1 [subject] => order number : 11 [trade_no] => 2015100421001004080041989705 [buyer_email] => XXXXX@qq.com [gmt_create] => 2015-10-04 11:53:58 [notify_type] => trade_status_sync [quantity] => 1 [out_trade_no] => 11 [seller_id] => 2088021899249633 [notify_time] => 2015-10-04 11:54:06 [trade_status] => TRADE_SUCCESS [is_total_fee_adjust] => N [total_fee] => 1.00 [gmt_payment] => 2015-10-04 11:54:06 [seller_email] => [price] => 1.00 [buyer_id] => 2088102254263083 [notify_id] => d349dd864953c20e73aab77ec5cb722gm8 [use_coupon] => N [sign_type] => MD5 [sign] => 6164054b9dd39d130d9c849584c040ba ) -- 10.04.15 11:54:06 -- stdClass Object ( [order_id] => 11 [order_billing_address_id] => 1 [order_shipping_address_id] => 1 [order_user_id] => 1 [order_status] => created [order_type] => sale [order_number] => M11 [order_created] => 1443930823 [order_modified] => 1443930823 [order_invoice_id] => 0 [order_invoice_number] => [order_invoice_created] => 0 [order_currency_id] => 38 [order_full_price] => 1.00000 [order_tax_info] => Array ( ) [order_discount_code] => [order_discount_price] => 0.00000 [order_discount_tax] => 0.00000 [order_payment_id] => 2 [order_payment_method] => alipay [order_payment_price] => 0.00000 [order_payment_params] => [order_shipping_id] => [order_shipping_method] => [order_shipping_price] => 0.00000 [order_shipping_tax] => 0.00000 [order_shipping_params] => [order_partner_id] => 0 [order_partner_price] => 0.00000 [order_partner_paid] => 0 [order_partner_currency_id] => 0 [order_ip] => 119.120.238.112 [order_site_id] => [order_currency_info] => O:8:"stdClass":4:{s:13:"currency_code";s:3:"CNY";s:13:"currency_rate";s:7:"1.00000";s:20:"currency_percent_fee";s:4:"0.00";s:17:"currency_modified";s:10:"1443753389";} ) -- 10.04.15 11:54:06 -- stdClass Object ( [order_id] => 11 [order_billing_address_id] => 1 [order_shipping_address_id] => 1 [order_user_id] => 1 [order_status] => created [order_type] => sale [order_number] => M11 [order_created] => 1443930823 [order_modified] => 1443930823 [order_invoice_id] => 0 [order_invoice_number] => [order_invoice_created] => 0 [order_currency_id] => 38 [order_full_price] => 1.00000 [order_tax_info] => Array ( ) [order_discount_code] => [order_discount_price] => 0.00000 [order_discount_tax] => 0.00000 [order_payment_id] => 2 [order_payment_method] => alipay [order_payment_price] => 0.00000 [order_payment_params] => [order_shipping_id] => [order_shipping_method] => [order_shipping_price] => 0.00000 [order_shipping_tax] => 0.00000 [order_shipping_params] => [order_partner_id] => 0 [order_partner_price] => 0.00000 [order_partner_paid] => 0 [order_partner_currency_id] => 0 [order_ip] => 119.120.238.112 [order_site_id] => [order_currency_info] => O:8:"stdClass":4:{s:13:"currency_code";s:3:"CNY";s:13:"currency_rate";s:7:"1.00000";s:20:"currency_percent_fee";s:4:"0.00";s:17:"currency_modified";s:10:"1443753389";} ) -- 10.04.15 11:54:06 -- Array ( [scheme] => http [host] => www.alipay.com [path] => /cooperate/gateway.do [query] => service=notify_verify&partner=2088021899249633¬ify_id=d349dd864953c20e73aab77ec5cb722gm8 [port] => 80 ) -- 10.04.15 11:54:06 -- Array ( [0] => HTTP/1.1 302 Found [1] => Server: Tengine/2.1.0 [2] => Date: Sun, 04 Oct 2015 03:54:06 GMT [3] => Content-Type: text/html [4] => Content-Length: 264 [5] => Connection: close [6] => Location: https://www.alipay.com/cooperate/gateway.do [7] => Set-Cookie: spanner=;path=/;secure; [8] => [9] => [10] => [11] => [12] => [13] => 302 Found [14] => The requested resource resides temporarily under a different URI. [15] => Powered by Tengine/2.1.0 [16] => ) -- 10.04.15 11:54:06 -- sign1 : 2cfa1fc514ca55b55bc3bb347a8b9861 -- 10.04.15 11:54:06 -- sign2 : 6164054b9dd39d130d9c849584c040ba -- 10.04.15 11:54:08 -- invalid response -- 10.04.15 11:58:12 -- Array ( [option] => com_hikashop [ctrl] => checkout [task] => notify [notif_payment] => alipay [tmpl] => component [lang] => zh [Itemid] => 396 [discount] => 0.00 [payment_type] => 1 [subject] => order number : 11 [trade_no] => 2015100421001004080041989705 [buyer_email] => 214756310@qq.com [gmt_create] => 2015-10-04 11:53:58 [notify_type] => trade_status_sync [quantity] => 1 [out_trade_no] => 11 [seller_id] => 2088021899249633 [notify_time] => 2015-10-04 11:58:12 [trade_status] => TRADE_SUCCESS [is_total_fee_adjust] => N [total_fee] => 1.00 [gmt_payment] => 2015-10-04 11:54:06 [seller_email] => service@XXXXXX.com [price] => 1.00 [buyer_id] => 2088102254263083 [notify_id] => d349dd864953c20e73aab77ec5cb722gm8 [use_coupon] => N [sign_type] => MD5 [sign] => 87c9e39d01cb7831a3975fd068da03ab ) -- 10.04.15 11:58:12 -- stdClass Object ( [order_id] => 11 [order_billing_address_id] => 1 [order_shipping_address_id] => 1 [order_user_id] => 1 [order_status] => created [order_type] => sale [order_number] => M11 [order_created] => 1443930823 [order_modified] => 1443930846 [order_invoice_id] => 0 [order_invoice_number] => [order_invoice_created] => 0 [order_currency_id] => 38 [order_full_price] => 1.00000 [order_tax_info] => Array ( ) [order_discount_code] => [order_discount_price] => 0.00000 [order_discount_tax] => 0.00000 [order_payment_id] => 2 [order_payment_method] => alipay [order_payment_price] => 0.00000 [order_payment_params] => [order_shipping_id] => [order_shipping_method] => [order_shipping_price] => 0.00000 [order_shipping_tax] => 0.00000 [order_shipping_params] => [order_partner_id] => 0 [order_partner_price] => 0.00000 [order_partner_paid] => 0 [order_partner_currency_id] => 0 [order_ip] => 119.120.238.112 [order_site_id] => [order_currency_info] => O:8:"stdClass":4:{s:13:"currency_code";s:3:"CNY";s:13:"currency_rate";s:7:"1.00000";s:20:"currency_percent_fee";s:4:"0.00";s:17:"currency_modified";s:10:"1443753389";} ) -- 10.04.15 11:58:12 -- stdClass Object ( [order_id] => 11 [order_billing_address_id] => 1 [order_shipping_address_id] => 1 [order_user_id] => 1 [order_status] => created [order_type] => sale [order_number] => M11 [order_created] => 1443930823 [order_modified] => 1443930846 [order_invoice_id] => 0 [order_invoice_number] => [order_invoice_created] => 0 [order_currency_id] => 38 [order_full_price] => 1.00000 [order_tax_info] => Array ( ) [order_discount_code] => [order_discount_price] => 0.00000 [order_discount_tax] => 0.00000 [order_payment_id] => 2 [order_payment_method] => alipay [order_payment_price] => 0.00000 [order_payment_params] => [order_shipping_id] => [order_shipping_method] => [order_shipping_price] => 0.00000 [order_shipping_tax] => 0.00000 [order_shipping_params] => [order_partner_id] => 0 [order_partner_price] => 0.00000 [order_partner_paid] => 0 [order_partner_currency_id] => 0 [order_ip] => 119.120.238.112 [order_site_id] => [order_currency_info] => O:8:"stdClass":4:{s:13:"currency_code";s:3:"CNY";s:13:"currency_rate";s:7:"1.00000";s:20:"currency_percent_fee";s:4:"0.00";s:17:"currency_modified";s:10:"1443753389";} ) -- 10.04.15 11:58:12 -- Array ( [scheme] => http [host] => www.alipay.com [path] => /cooperate/gateway.do [query] => service=notify_verify&partner=2088021899249633¬ify_id=d349dd864953c20e73aab77ec5cb722gm8 [port] => 80 ) -- 10.04.15 11:58:12 -- Array ( [0] => HTTP/1.1 302 Found [1] => Server: Tengine/2.1.0 [2] => Date: Sun, 04 Oct 2015 03:58:12 GMT [3] => Content-Type: text/html [4] => Content-Length: 264 [5] => Connection: close [6] => Location: https://www.alipay.com/cooperate/gateway.do [7] => Set-Cookie: spanner=;path=/;secure; [8] => [9] => [10] => [11] => [12] => [13] => 302 Found [14] => The requested resource resides temporarily under a different URI. [15] => Powered by Tengine/2.1.0 [16] => ) -- 10.04.15 11:58:12 -- sign1 : 00b1321a2ff72f33445670c3d4d02f01 -- 10.04.15 11:58:12 -- sign2 : 87c9e39d01cb7831a3975fd068da03ab -- 10.04.15 11:58:13 -- invalid response

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

More
10 years 11 months ago #216569 by Mohamed Thelji
Hello,
You're actually having the same issue as aotogou@gmail.com :
Code:
sign1 : 00b1321a2ff72f33445670c3d4d02f01 -- 10.04.15 11:58:12 -- sign2 : 87c9e39d01cb7831a3975fd068da03ab -- 10.04.15 11:58:13 -- invalid response
The "SIGN" code that your website calculated isn't the same as the Alipay platform, that can be coming from the way you have configured your Hikashop Alipay payment method (Security code/Partner ID/E-mail), or the way you have configured your Alipay account.

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

More
10 years 11 months ago #217175 by graceufo
thanks for your reply.
I think I have the right setting in the alipay plugin.
because the plugin take affect.
but I don't understand why the sign is not the same.
have you any test on it?

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

More
10 years 11 months ago #217230 by Mohamed Thelji
Hello,

1. Can you show me some screenshots of how you configured it ?

2. By the time I developed it, I had a customer account to directly test it, and it worked pretty fine, but now that we don't have any account we are not able to fully test it.

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

More
10 years 11 months ago - 10 years 11 months ago #217504 by graceufo
My setting is below,anything we can do for the problem?
Please tell me more.Let's fix it!
Last edit: 10 years 11 months ago by graceufo.

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

More
10 years 11 months ago #217532 by Mohamed Thelji
Your settings seems to be correct ! (verifying the partner ID and Security code should be a good idea).

Please tell me more.Let's fix it!

Without being able to directly test it do a "test purchase" I won't be able to understand from where the issue is coming from.

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

Time to create page: 0.270 seconds
Powered by Kunena Forum