Paypal整合问题

发布于 2024-11-26 04:03:18 字数 1770 浏览 0 评论 0原文

我在集成 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="[email protected]"/>

      <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
   }

I am having problem in integrating paypal IPN.I am implementing this code but it is not returning me the values to IPN
My form that is made after executing the code is as follow

   <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="[email protected]"/>

      <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>

The problem is that the code is working fine for the return and cancel part but when I use this code for IPN it does not give me any value.My code for the IPN is as under

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

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

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

发布评论

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

评论(1

梦里°也失望 2024-12-03 04:03:18

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

Have a look at History > IPN History inside your PayPal account. This should show the status of the IPN messages that were sent to you. Click on the message ID if you wish to find out more detailed information.
If it's retrying, double-check your error logs and ensure it's returning a proper HTTP/1.1 200 OK response when accessed by the PayPal IPN service (notify.paypal.com).

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