PayPal IPN - PHP和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?
In other words:
notify_url - Posts transaction information to the specified file.
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.
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.
只是一个问题,以确保我理解正确: p>
当我 创建我的立即购买按钮,我将所有表单字段传递给PayPal - 一旦用户完成了他们的交易,只要我设置了notify_url发布到比如说ipn.php文件,用户就会被重定向到 在返回字段中定义的网站上的页面,是吗? p>
换句话说: p>
notify_url strong> - 将交易信息发布到指定文件。 em> p>
返回 strong> - 将用户重定向到已定义的页面。 em> p>
我知道这应该很简单,我已经阅读了文档,我已经在这里工作了两个星期。 我的意思是,我一直试图找到适当的解决方案大约两个星期,我认为IPN选项可能是它。 p>
我相信,此时,我刚刚结束 想到了,但我听说这些领域相互抵消了。 这是真的? 如果是这样,我该如何纠正? p>
请不要将我发回给文档。 我现在很困惑。 p>
div>
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. It posts a specially-formatted request (the IPN) to the url you specify. 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.
You can have one or the other or both fields set.
When you submit from your site to Paypal, it again gets back to your site fr IPN and provides some response such as "VERIFIED" (in case transaction is successful), and then posts back to Paypal then ,redirects to your site for either success or failure response.
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. 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.
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.