paypal IPN 不发送任何通知

发布于 2025-01-06 22:25:19 字数 2063 浏览 2 评论 0原文

我已将 paypal 与我的网站集成,但它确实接受付款,但它不会将任何 IPN 发送到我的 php 文件,该文件应该更新我的数据库.... 有我一直在使用的代码: 从 php IPN 示例代码中调用

session_start();
if($mode=='live')
{
    $url=" https://www.paypal.com/cgi-bin/webscr";
    $email="[email protected]";
    $_SESSION['url']=$url;
    $_SESSION['email']=$email;
    $_SESSION['subtotal']=$subtotal;
}
else if($mode=='sandbox')
{
    $url= "https://www.sandbox.paypal.com/cgi-bin/webscr";
    $email="[email protected]";
    $_SESSION['url']=$url;
    $_SESSION['email']=$email;
    $_SESSION['subtotal']=$subtotal;
}
?>

                <form action="<?php echo $url; ?>" method="post">
                <input type="hidden" name="cmd" value="_xclick"/>
                <input type="hidden" name="business" value="<?php echo $email; ?>"/>
                <input type="hidden" name="item_name" value="shopping cart"/>
                <input type="hidden" name="currency_code" value="GBP"/>
                <input type="hidden" name="amount" value="<?php echo $subtotal;?>"/>
                <input type="hidden" name="return" value="<?php echo SITE_URL; ?>"/>
                <input type="hidden" name="cancel_return" value="<?php echo SITE_URL."/shoppingCart.php" ?>"/>
                <input type="hidden" name="notify_url" value="php url" />
                <input type="hidden" name="rm" value="2"/>
                <input type="hidden" name="custom" value="<?php echo $customer_ID;?>"/>
                <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
                </form>

php 代码

......

I have integrated paypal with my website and but it does take the payment but it doesnot send any IPN to my php file which should update my databse....
there is the code I have been using:
to call

session_start();
if($mode=='live')
{
    $url=" https://www.paypal.com/cgi-bin/webscr";
    $email="[email protected]";
    $_SESSION['url']=$url;
    $_SESSION['email']=$email;
    $_SESSION['subtotal']=$subtotal;
}
else if($mode=='sandbox')
{
    $url= "https://www.sandbox.paypal.com/cgi-bin/webscr";
    $email="[email protected]";
    $_SESSION['url']=$url;
    $_SESSION['email']=$email;
    $_SESSION['subtotal']=$subtotal;
}
?>

                <form action="<?php echo $url; ?>" method="post">
                <input type="hidden" name="cmd" value="_xclick"/>
                <input type="hidden" name="business" value="<?php echo $email; ?>"/>
                <input type="hidden" name="item_name" value="shopping cart"/>
                <input type="hidden" name="currency_code" value="GBP"/>
                <input type="hidden" name="amount" value="<?php echo $subtotal;?>"/>
                <input type="hidden" name="return" value="<?php echo SITE_URL; ?>"/>
                <input type="hidden" name="cancel_return" value="<?php echo SITE_URL."/shoppingCart.php" ?>"/>
                <input type="hidden" name="notify_url" value="php url" />
                <input type="hidden" name="rm" value="2"/>
                <input type="hidden" name="custom" value="<?php echo $customer_ID;?>"/>
                <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
                </form>

and php code

from php IPN sample code.....

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

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

发布评论

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

评论(2

谢绝鈎搭 2025-01-13 22:25:19

尝试:
1.登录您的paypal账户
2. 进入个人资料 -->历史--> IPN历史-->打开我的 IPN
3. 插入您的 IPN 侦听器 URL。

Try:
1. login in your paypal account
2. go to profile --> History --> IPN history --> turn on my IPN
3. insert your IPN listener URL.

┈┾☆殇 2025-01-13 22:25:19

值是什么:

<input type="hidden" name="notify_url" value="php url" />

这不应该位于本地主机上,因为 PayPal 将 POST 数据从其服务器发送到该 URL。所以本地主机将无法工作。

What's the value of:

<input type="hidden" name="notify_url" value="php url" />

This shouldn't be on localhost, since PayPal sends POST data from its servers to that URL. So localhost won't work.

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