PayPal IPN - PHP 和 MySQL

发布于 2024-12-18 03:02:54 字数 456 浏览 3 评论 0原文

只是一个问题,以确保我正确理解这一点:

当我创建“立即购买”按钮并将所有表单字段传递给 PayPal 时 - 一旦用户完成交易,只要我设置了要发布的 notification_url,比如说,ipn.php 文件,用户将被重定向到返回字段中定义的网站页面,是吗?

换句话说:

notify_url - 将交易信息发布到指定文件。

返回 - 将用户重定向到定义的页面。 em>

我知道这应该很简单,我已经阅读了文档并且已经研究了两周。我的意思是,我已经尝试寻找合适的解决方案大约两周了,我认为 IPN 选项可能就是这样。

我相信,在这一点上,我只是想得太多了,但我听说这些领域相互抵消。这是真的吗?如果是这样,我该如何纠正?

拜托,拜托,不要让我回到文档。我现在对此很困惑。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

美煞众生 2024-12-25 03:02:54

这两个字段彼此无关。

notify_url 的存在是为了让 PayPal 在用户交易完成时通知(而不是用户)。它将特殊格式的请求(IPN)发布到您指定的 URL。这是用户永远不会看到的带外机制。

当用户的交易完成时,return 将用户的浏览器重定向到您指定的页面。

您可以设置一个或另一个或两个字段。

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.

So要识趣 2024-12-25 03:02:54

你在这一点上是对的。您可以为您的 PayPal 按钮本身定义一个通知 URL(如果它是托管按钮),也可以将其保存在您的 PayPal 帐户中。您可以将一个字段以及一个隐藏字段传递给非托管按钮(出于安全原因,我不建议这样做)。

如果您不使用托管按钮,请确保客户不会更改货币。

如果您不喜欢使用非托管按钮,但需要动态更改变量,请查看 paypal 的soap api。

在 cbt 变量中,您可以设置 paypal 将使用的标签,将 return 变量中给出的返回 URL 链接到按钮。

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.

芸娘子的小脾气 2024-12-25 03:02:54

当您从您的网站提交到 Paypal 时,它会再次通过 IPN 返回您的网站并提供一些响应,例如“已验证”(如果交易成功),然后发回 Paypal,然后重定向到您的网站以获取成功或失败响应。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文