阅读更多
遇到在跳转到paypal支付页面的时候出现502 bad gateway的错误,跳转的URL是
https://www.paypal.com/cgi-bin/webscr?locale.x=zh_HK
换了个paypal button id就可以,或者随便填个不存在的buttion id,也行。所以初步怀疑是paypal button的问题。登录paypal.com进入查看Tools->All tools->Paypal buttons
选择有问题的button,create simile button,创建一个一样的button,删除drop menu 下的选项。然后先增加一项,输入内容和价格(是中文的内容)。获取form 代码,放在html中运行,可以跳转。再逐个增加,当增加到第六个时,出现了502错误,删除掉第六个又没问题
是不是第六项的内容有什么特殊字符?没发现。
然后将所有dropmenu的内容都改成英文,增加到8项。没问题
是不是对中文支持不好,如果不好,增加到5项又没问题哦。所以是不是长度限制了?
再将每项的内容整理下,在保持意思的前提下,缩减内容。填写了8项内容和价格
重新生成html,可以跳转成功。
因此,这个问题是paypal对drop menu的长度处理有限制,但是又没提示。更重要的是,之前没问题,现在突然发现有这个问题,也不知道什么时候出现这个问题。paypal真的好渣啊
找到paypal的官方说明:
Using Options Fields on Your Website
Option fields let your customers specify options (such as size or colour) for the items they purchase. Each item may have up to two options, and option fields are compatible with Buy Now Buttons, PayPal Shopping Cart, and Subscriptions and Recurring Payments buttons.
The requirements for your options fields are:
Each option name is limited to 30 characters
Your drop-down menu choices should not exceed 10 menu items of 30 characters each (if you are using the Button Factory to generate your HTML code. If you are editing the code by hand, you may add additional menu choices)
Option fields cannot be used for options that will alter the item's price
You will need to be comfortable editing HTML code to perform some of the tasks outlined in this article.
https://www.paypal.com/uk/cgi-bin/webscr?cmd=p/xcl/rec/options-help-outside