标签: php paypal
我已阅读PayPal的网址参数,以生成付款链接。但是,在重定向用户时,我似乎遇到了问题。我被带到PayPal的主页,好像我已将用户重定向到https://www.paypal.com,我没有。我将把我的代码留在下面......
'#'
代码运行没有错误,但后来我被重定向到PayPal主页,我似乎无法找到原因?
我的脚本生成的链接 https://www.sandbox.paypal.com/cgi-bin/webscr?cmd%3D_xclick%26business%3Dsales%40domain.com%26currency_code%3DGBP%26no_shipping%3D1%26amount%3D15.00%26invoice%3D001MyAccount%26item_name%3DMyAccount%26return%3D%2F%2Fid.mydomain.com%2Fmyaccount%2Fpayments%2F%3FPayPal_Response%3Dsuccess%26cancel_url%3D%2F%2Fid.mydomain.com%2Fmyaccount%2Fpayments%2F%3FPayPal_Response%3Dcancel
我的脚本生成的链接
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd%3D_xclick%26business%3Dsales%40domain.com%26currency_code%3DGBP%26no_shipping%3D1%26amount%3D15.00%26invoice%3D001MyAccount%26item_name%3DMyAccount%26return%3D%2F%2Fid.mydomain.com%2Fmyaccount%2Fpayments%2F%3FPayPal_Response%3Dsuccess%26cancel_url%3D%2F%2Fid.mydomain.com%2Fmyaccount%2Fpayments%2F%3FPayPal_Response%3Dcancel
答案 0 :(得分:0)
当我对字符串进行非URL编码时,它工作得很好。不要尝试对其进行URL编码。
https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=sales@domain.com¤cy_code=GBP&no_shipping=1&amount=15.00&invoice=001MyAccount&item_name=MyAccount&return=//id.mydomain.com/myaccount/payments/?PayPal_Response=success&cancel_url=//id.mydomain.com/myaccount/payments/?PayPal_Response=cancel