简体   繁体   English

贝宝IPN-PHP和MySQL

[英]PayPal IPN - PHP and MySQL

Just a question to make sure I understand this correctly: 只是一个问题,以确保我正确理解了这一点:

When I create my buy now button and I pass all the form fields to PayPal - once the user has finished their transaction as long as I've set up the notify_url to post to, say, the ipn.php file, the user will be redirected to a page on the site defined in the return field, yes? 当我创建“立即购买”按钮并将所有表单字段传递给PayPal时-用户完成交易后,只要我设置了notify_url以发布到ipn.php文件即可,重定向到返回字段中定义的站点上的页面,是吗?

In other words: 换一种说法:

notify_url - Posts transaction information to the specified file. notify_url-将 交易信息发布到指定文件。

return - Redirects the user to a defined page. 回报 - 将用户重定向到一个定义的页面。

I know this should be simple enough, I've read the documentation and I've been at this for two weeks. 我知道这应该很简单,我已经阅读了文档,并且已经从事了两个星期。 I mean, I've been trying to find the proper solution for about two weeks and I think the IPN option may be it. 我的意思是,我一直在寻找合适的解决方案大约两个星期,我认为IPN选项可能就是它。

I believe, at this point, I'm just over thinking it but I've heard that these fields cancel one another out. 我相信,在这一点上,我只是在想一想,但是我听说这些领域相互抵消了。 Is this true? 这是真的? If so, how do I rectify it? 如果是这样,我该如何纠正?

Please, please, don't send me back to the documentation. 拜托,拜托,不要让我回到文档中。 I'm so confused by it right now. 我现在很困惑。

These two fields are unrelated to one another. 这两个字段彼此无关。

notify_url exists so that paypal can inform you (not the user) when the user's transaction is complete. notify_url存在,以便宝可以在用户的​​交易完成时通知 (而非用户)。 It posts a specially-formatted request (the IPN) to the url you specify. 它将特殊格式的请求(IPN)发布到您指定的URL。 This is an out-of-band mechanism that the user will never see. 这是用户永远不会看到的带外机制。

return redirects the user's browser to the page you specify when his transaction is complete. 当用户的交易完成时, return将用户的浏览器重定向到您指定的页面。

You can have one or the other or both fields set. 您可以设置一个或另一个或两个字段。

You are right on this. 你是对的。 You can either define a notify url for your paypal button itself if it is a hosted button or save one in your paypal account. 您可以为贝宝按钮本身定义一个通知URL(如果它是托管按钮),或者将一个保存在您的贝宝帐户中。 You can pass one as well as a hidden field to a non hosted button (what I do not recommend for security reasons). 您可以将一个以及一个隐藏字段传递给一个非托管按钮(出于安全原因,我不建议这样做)。

If you do not use a hosted button make sure the customer does not change the currency. 如果您不使用托管按钮,请确保客户未更改币种。

If you do not like to use a non hosted button but you need to change variables dynamically than take a look in the soap api of paypal. 如果您不喜欢使用非托管按钮,但需要动态更改变量,而不是查看paypal的soap api。

In the cbt variable you can set the label which will be used by paypal to link your return url given in the return variable to the button. 在cbt变量中,您可以设置标签,贝宝将使用该标签将return变量中给出的返回URL链接到按钮。

当您从站点提交到Paypal时,它再次回到IPN站点并提供一些响应,例如“ VERIFIED”(以防交易成功),然后回发到Paypal,然后重定向到您的站点以取得成功或失败响应。

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

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