1

我在集成 paypal IPN 时遇到问题。我正在实现此代码,但它没有将值返回给 IPN 我在执行代码后制作的表单如下

   <form method="post" name="paypal_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr">

      <input type="hidden" name="rm" value="2"/>

      <input type="hidden" name="cmd" value="_cart"/>

      <input type="hidden" name="business" value="info@something.com"/>

      <input type="hidden" name="return" value="http://abc.com/test.php?action=success"/>

      <input type="hidden" name="cancel_return" value="http://abc.com/test.php?action=cancel"/>
         <input type="hidden" name="notify_url" value="http://abc.com/test.php?action=ipn"/>
         <input type="hidden" name="item_name_1" value="Adob photoshop"/>

      <input type="hidden" name="item_number_1" value="10"/>
        <input type="hidden" name="amount_1" value="15"/>

      <input type="hidden" name="upload" value="1"/>

      <input type="hidden" name="cn" value="1"/>
       <input type="hidden" name="tx" value="TransactionID"/>
       <input type="hidden" name="currency_code" value="USD"/>
        <input type="hidden" name="no_shipping" value="1"/>
        <center><br/><br/>If you are not automatically redirected to paypal within 5 seconds...<br/><br/>
        <input type="submit" value="Click Here"></center>
        </form>

问题是代码对于返回和取消部分工作正常,但是当我将此代码用于 IPN 时,它没有给我任何价值。我的 IPN 代码如下

if ($pay->validate_ipn()) {
   //do the insertion I have tested this insertion it is working fine
   }
4

1 回答 1

0

在您的 PayPal 帐户中查看历史 > IPN 历史。这应该会显示发送给您的 IPN 消息的状态。如果您想了解更多详细信息,请单击消息 ID。
如果它正在重试,请仔细检查您的错误日志并确保它在通过 PayPal IPN 服务 (notify.paypal.com) 访问时返回正确的 HTTP/1.1 200 OK 响应。

于 2011-07-26T13:49:57.857 回答