cosmocommerce / magento-alipay

Magento Alipay Payment Gateway
https://github.com/cosmocommerce/magento-alipay
59 stars 27 forks source link

Wrong link being sent? ILLEGAL_ARGUMENT #9

Open 8888866666 opened 9 years ago

8888866666 commented 9 years ago

Hi,

Im using this on magento version 1.9.2 and although it seems to work nicely with store, when the user proceeds to alipay they are getting an ILLEGAL_ARGUMENT error. The page it is linking to is (minus the partner id):

https://tradeexprod.alipay.com/cooperate/createPartnerTradeByBuyer.htm?partner=#############&out_trade_no=100000037

It seems like the link is missing a lot of the form details. When i use "Create Direct pay by user", the link seems to be going to the correct link (I get another error, but i assume that is because of my contract type?)

https://mapi.alipay.com/gateway.do?_input_charset=utf-8&body=100000030&defaultbank=BOCB2C&logistics_fee=0.00&logistics_payment=SELLER_PAY&logistics_type=EXPRESS&notify_url=http%3A%2F%2Fmysite.com%2Falipay%2Fpayment%2Fnotify%2F&out_trade_no=100000030&partner=###############&payment_type=1&paymethod=bankPay&price=0.00&quantity=1&return_url=http%3A%2F%2Fmysite.com%2Falipay%2Fpayment%2Fnotify%2F&seller_email=me%40mysite.com&service=create_direct_pay_by_user&show_url=http%3A%2F%2Fmysite.com%2F&subject=100000030&sign=#######################&sign_type=MD5

I've tried installing it different ways including with and without modman. I also cant see anywhere in the redirect urls that could be causing a problem.

Any advice on where i can look?

sidealice commented 9 years ago

It seems that problem was caused by wrong contract type. Because all arguments was sent with POST method which can't checked with your url parameters. Please confirm your contract type first then we can't give more detail advice.

8888866666 commented 9 years ago

Thanks for the response. My contract type is create_partner_trade_by_buyer this is also what I'm selecting in the cosmocommerce configuration. With this selected I get the error ILLEGAL_ARGUMENT from Alipay and the following link is showing.

https://tradeexprod.alipay.com/cooperate/createPartnerTradeByBuyer.htm?partner=#############&out_trade_no=100000037

All other contract types give me a different error, such as ILLEGAL PARTNER EXTERFACE, but the url seems the same as the one in the Alipay documentation "纯担保交易接口"

lsd commented 8 years ago

I am encountering the same issue as 8888866666. I get ILLEGAL_PARTNER_EXTERFACE when I choose any other option for contract type and the same ILLEGAL_ARGUMENT error when I choose the correct contract type for my web app.

The fact that alipay's site and documentation are not in English makes this seemingly trivial issue difficult to fix.

sidealice commented 7 years ago

could you provide detail log for the post? this payment gateway works fine over several years.