Paypal 未按预期重定向 [英] Paypal Not redirecting as expected
问题描述
我正在尝试让贝宝为我的网站工作.我正在使用 Jade,因此下面的代码看起来与 html 不完全一样,但呈现相同.
I am trying to get paypal working for my site. I am using Jade so the code below will not look exactly like html but renders the same.
form(id="SubmitForm", action="https://api-3t.sandbox.paypal.com/nvp")
input(type="hidden", name="USER",value="USER")
input(type="hidden", name="PWD", value="PWD")
input(type="hidden", name="SIGNATURE", value="SIGNATURE")
input(type="hidden", name="VERSION", value="89.0")
input(type="hidden", name="PAYMENTREQUEST_0_PAYMENTACTION",
value="Sale")
input(name="PAYMENTREQUEST_0_AMT", value="19.95")
input(type="hidden", name="RETURNURL",
value="https://localhost:3001/confirm")
input(type="hidden", name="CANCELURL",
value="https://localhost:3001/end")
input(type="submit", name="METHOD", value="SetExpressCheckout")
它对 paypal 执行并返回带有令牌的文本字符串,而不是重定向回我期望的确认页面.
It does to paypal and returns a text string with the token instead of doing a redirect back to the confirm page I am expecting.
我看到类似......
I see something like....
TOKEN=EC%2d33S38595GH5727152&TIMESTAMP=2012%2d07%2d11T20%3a00%3a02Z&CORRELATIONID=687adf3870d19&ACK=Success&%BUILSION6&%BUILSION7D2012%2d07%2d11T20%3a00%3a02Z&CORRELATIONID
TOKEN=EC%2d33S38595GH5727152&TIMESTAMP=2012%2d07%2d11T20%3a00%3a02Z&CORRELATIONID=687adf3870d19&ACK=Success&VERSION=89%2e0&BUILD=3242673
带有...的网址
如果我剪切并粘贴令牌它可以正常工作,但是,我当然会尽量避免这种情况.
If I cut and paste the token it works fine, however, I am of course trying to avoid this.
推荐答案
正如前面提到的那样,这是因为您所获得的是通过服务器端进程进行 API 调用.
As the previous person mentioned, this is because what you've got is meant for an API call via a server-side process.
如果您只想重定向到 PayPal 并立即付款,只需使用以下 URL,并将其替换为您自己的值;
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=YOUR-EMAIL-HERE&amount=YOUR-AMOUNT-HERE&item_name=NAME-OF-YOUR-ITEM-HERE&return=YOUR-RETURN-URL&cancel_return=YOUR-CANCEL-URL
If all you want to do is redirect to PayPal and take a payment immediately, simply use the following URL, and replace it with your own values;
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=YOUR-EMAIL-HERE&amount=YOUR-AMOUNT-HERE&item_name=NAME-OF-YOUR-ITEM-HERE&return=YOUR-RETURN-URL&cancel_return=YOUR-CANCEL-URL
这篇关于Paypal 未按预期重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!