【问题标题】:Paypal IPN not calling my scriptPaypal IPN 没有调用我的脚本
【发布时间】:2011-12-26 18:59:28
【问题描述】:

我有一个小型网站,我使用 paypal 进行定期订阅。 我使用我在博客上找到的内容自己编写了 PHP 代码,因为 IMO 的官方文档根本不清楚。

自 12 月 6 日以来,paypal 似乎不想再调用我的 php 脚本(我在表单的 notify_url 中指定了 url)。 我没有更改我的代码或服务器上的任何内容,所以有人知道它为什么停止工作吗? 我知道这不是 php 代码问题,因为我可以在 apache 的日志中看到脚本没有被调用(并且我添加了一些写入文件的调试行以确保)。

这是我的表格的副本:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" value="_xclick-subscriptions" type="hidden">
<input name="business" value="paypal@*****.com" type="hidden">
<input name="item_name" id="item_name" value="************" type="hidden">
<input name="a3" id="a3" value="6.99" type="hidden">
<input name="p3" value="1" type="hidden">
<input name="t3" value="M" type="hidden">
<input name="src" value="1" type="hidden">
<input name="sra" value="1" type="hidden">
<input name="no_shipping" value="1" type="hidden">
<input name="custom" id="custom" value="11" type="hidden">
<input name="return" value="http://*****.com/account" type="hidden">
<input name="cancel_return" value="http://*****.com/account" type="hidden">
<input name="notify_url" value="http://paypal.*****.com/paypal.php" type="hidden">
<input name="no_note" value="1" type="hidden">
<input name="currency_code" value="EUR" type="hidden">
<input name="lc" value="US" type="hidden">
<input src="images/x-click-but20.gif" name="submit" alt="Subscribe with Paypal Now !" border="0" type="image">
</form>

我把它放在我的 paypal.php 文件的开头,以确保查看是否发生任何事情:

file_put_contents('/tmp/paypaldetail',date('d-m-Y H:i:s').':[debug] '.print_r($_POST,true)."\r\n",FILE_APPEND);

当然,当我在浏览器中调用 url 时,我得到一个空的结果,但仍然有些东西..

26-12-2011 19:29:16:[debug] Array
(
)

感谢您的想法;)

【问题讨论】:

  • 在 12 月 6 日之前运行正常吗?
  • 是的,订阅,甚至在第一个月后付款。
  • 我会查看 Apache 访问日志,它会告诉您是否以及何时访问了该页面,并且会告诉您它是脚本还是它真的没有被教皇点击
  • 也许联系 PayPal 并询问一段时间后它会停止工作的原因。他们是否更改了 API?
  • 查看个人资料 > 我的销售工具 > IPN(即时付款通知)。在您的脚本返回一组否定的 HTTP 状态代码后,它很可能会自动被禁用。

标签: php paypal paypal-ipn


【解决方案1】:

我也遇到过类似的问题。试试这个:登录到贝宝,-> 个人资料-> 我的销售工具-> 更新(阻止付款)-> 阻止意外付款点击“否”。

然后再次测试它,看看 IPN 是否会执行您的脚本。您可能希望稍后将其更改回来,这样可以阻止意外付款。

【讨论】:

    猜你喜欢
    • 2012-07-11
    • 2014-08-14
    • 2013-05-09
    • 2011-09-07
    • 1970-01-01
    • 2010-11-10
    • 2012-12-15
    • 1970-01-01
    • 2016-09-14
    相关资源
    最近更新 更多