带 codeigniter 的 IPN 模拟器 403

发布于 2024-09-25 03:35:51 字数 122 浏览 0 评论 0原文

我使用 IPN 模拟器收到 403 我的网站在线(不在本地主机上)并且我使用 paypal_lib 库知道什么可能导致此情况吗?

这是来自 IPN 模拟器的消息:IPN 传送失败。 HTTP 错误代码 403:禁止

i get a 403 with the IPN simulator my site is online (not on localhost) and i m using the paypal_lib library any idea what could cause this?

this is the message from the IPN simulator : IPN delivery failed. HTTP error code 403: Forbidden

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

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

发布评论

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

评论(2

云雾 2024-10-02 03:35:51

还没有人回答这个问题 - 很奇怪你得到了 403 禁止。 SO 上的大多数人都使用 Django PayPal IPN 库并违反了 CSRF 身份验证,但您的 CodeIgniter 安装可能没有类似的东西。

您使用的 URL 是否绝对可用(例如,不在您网站的受密码保护的部分中)?

我建议将您的站点连接到沙箱并启用沙箱中的 IPN 调用,以便您可以准确地看到正在发生的情况。另外,我刚刚发布了 CodeIgniter 的替代 PayPal IPN 库,它比 Paypal_Lib 具有更多的日志记录,并且还具有用于直接测试 IPN 的调试模式。我希望你觉得它有用:

https://github.com/orderly/codeigniter-paypal-ipn< /a>

Nobody answered this one yet - it's odd you got 403 forbidden. Most of the people on SO who got that were using the Django PayPal IPN library and fell foul of CSRF authentication, but your CodeIgniter installation likely doesn't have anything like that.

Is the URL you were using definitely available (and not e.g. in a password protected part of your site)?

I would suggest connecting your site to the sandbox and enabling IPN calls from the sandbox, so you can see exactly what is going on. Also I've just released an alternative PayPal IPN library for CodeIgniter, which has much more logging than Paypal_Lib, and has a debugging mode as well for testing the IPN directly. I hope you find it useful:

https://github.com/orderly/codeigniter-paypal-ipn

把回忆走一遍 2024-10-02 03:35:51

我刚刚经历了同样的噩梦,除了不是用PayPal,而是用AlertPay。问题很可能是相似的。

事实证明,至少就我而言,403 Forbidden 代码非常具有误导性。我的按钮代码有错误。我两次使用相同的论点。我复制了一个自定义参数行来添加另一个自定义参数,但我忘记更改参数的名称。

因此,我提交带有重复参数的按钮,结果出现 403 Forbidden 错误。这不是一个很有帮助的错误,因为它导致我查找所有错误的地方。我也认为这是我的 iPN 侦听器的权限问题,但与此无关。

在相关问题中,解决此问题后,我开始收到 500(内部服务器错误)。这个 500 错误是我的另一个编码错误,但这次是在我的 ipn 侦听器脚本中。我用了“休息”;语句位于“if”语句内(PHP),这是不允许的。从技术上讲,这不是语法错误,因此脚本仍在加载,并且代码仍在其周围执行,但它是非法语句,这导致我的 IPN 上出现 500 内部服务器错误。

希望这能帮助其他遇到同样问题的人。

I just finished going through the same nightmare except not with PayPal, with AlertPay. Chances are the issues are similar.

As it turns out, in my case at least, the 403 Forbidden code is very misleading. I had an error in my button code. I was using the same argument twice. I had copied a custom argument line to add another custom argument but I had forgotten to change the name of the argument.

So I was submitting the button with a duplicate argument and it gave me a 403 Forbidden error. Not a very helpful error as it led me to look in all the wrong places. I too thought it was a permissions issue on my ipn listener but it had nothing to do with that.

In a related matter, after I got this resolved I started getting a 500 (Internal Server Error). This 500 error turned out to be another coding error on my part but this time in my ipn listener script. I had used a "break;" statement inside an "if" statement (PHP) which is not allowed. It's not technically a syntax error so the script was still loading and the code was still executing all around it, but it was an illegal statement and this was causing the 500 Internal Server Error on my IPN.

Hopefully this will help somebody else with the same problem.

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