【问题标题】:paypal sandbox IPN php贝宝沙箱IPN php
【发布时间】:2014-06-30 22:01:23
【问题描述】:

我正在使用 Paypal Sandbox,我有一个订阅按钮,我的问题是如何获得有关付款的通知,例如交易 ID 或付款状态,例如“待处理”、“成功”,以便我可以存储在我的数据库中。

我尝试搜索,我到处都能看到 IPN,但我不知道如何实现,我确实在我的 paypal 帐户中注册了 IPN,我也有 URL,我在那个文件中写了 this code 代码。

我的订阅按钮代码如下。

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="admin@cypherincorporated.org.in">
<input type="hidden" name="lc" value="IN">
<input type="hidden" name="item_name" value="unlimited">
<input type="hidden" name="return" value="http://103.8.216.147:81/UPS/index.php">
<input type="hidden" name="item_number" value="3">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="80.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="Y">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest">
<input type="image" src="images/apply.png" border="0" name="submit" alt="PayPal – The safer, easier way to pay online." style="margin:35px 0 0 70px">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">

沙盒支付工作正常,但我想要一些关于支付或状态的通知。

【问题讨论】:

    标签: php paypal paypal-ipn paypal-sandbox


    【解决方案1】:

    是的,您应该使用 IPN 来获取付款通知。 请注意,您的 IPN 侦听器文件应该存在于实时服务器中。 IPN 将无法在 localhost 中使用。如果全部设置,您将收到 IPN 通知,您可以在获得 IPN 后检查您的服务器日志或发送自定义电子邮件以检查您是否收到 IPN。

    【讨论】:

    • 我已经明确表示我已经将IPN代码写在了已经存在于实时服务器上的文件中,我不知道如何处理该代码。
    【解决方案2】:

    要动态设置 IPN,请使用 notify_url 变量:

        <input type="hidden" name="notify_url" value="http://path.to/your.ipn.php">
    

    来自Variable Reference

        notify_url
            Optional
            The URL to which PayPal posts information about the payment, in the form of Instant Payment Notification messages.
    

    【讨论】:

    • 试过了,还是不行,说网址不正确。
    猜你喜欢
    • 2012-08-31
    • 2017-01-10
    • 2013-01-27
    • 2013-01-11
    • 2011-02-21
    • 2023-04-10
    • 2012-04-10
    • 2016-07-08
    • 2013-06-05
    相关资源
    最近更新 更多