简体   繁体   English

贝宝返回URL与变量不起作用

[英]Paypal return url with variable not working

I want Paypal to auto-return to my "thank-you" page once the payment has been made. 付款后,我希望Paypal自动返回我的“谢谢”页面。 I managed to do it in sandbox and it worked without problems. 我设法在沙盒中做到了这一点,并且没有任何问题。 Now that I have switched to 'live', I am not getting back the GET variables along with the return url as I used to do in sandbox. 现在,我已切换到“实时”状态,不再像以前在沙箱中那样返回GET变量和返回URL

Below is the full button link generated. 以下是生成的完整按钮链接。 It's working and does everything except passing back the transaction ID and the custom field back to my "return" url. 它可以正常工作,并且除了将事务ID和自定义字段传回我的“返回” URL之外,什么都可以做。

https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&no_shipping=1&lc=US&item_name={$itemName}&amount={$itemPrice}&business={$businessEmail}&custom={$custom}&currency_code=USD&notify_url={$notifyUrl}&return={$returnUrl}";

It sounds like you got PDT configured on your sandbox account but forgot to do the same on your live account. 听起来好像您在沙箱帐户上配置了PDT,但是却忘记了对真实帐户进行相同的操作。

That said, what exactly are you trying to do with your return URL? 也就是说,您到底要使用返回网址做什么? Are you updating databases, sending out email notifications, etc? 您是否正在更新数据库,发送电子邮件通知等? If so, you'll want to use IPN for that instead, which is very similar to PDT except that it happens apart from the checkout flow altogether. 如果是这样,您将改为使用IPN,它与PDT非常相似,只是它完全不同于签出流程。 PayPal POSTs the data to a listener script sitting on your server. 贝宝将数据发布到服务器上的侦听器脚本中。

With PDT the user is never guaranteed to make it back to your return URL, even if Auto-Return is enabled. 使用PDT,即使启用了自动返回,也永远不能保证用户将其返回到您的返回URL。 They could simply close the browser before the redirect happens, for example. 例如,他们可以在重定向发生之前简单地关闭浏览器。

IPN will be triggered every time a transaction occurs whether the user makes it back to your site or not. 无论用户是否将交易返回到您的站点,每次发生交易时都会触发IPN。 This is the recommended way to automate post-order procedures. 这是自动执行后订购过程的推荐方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM