【问题标题】:How to make sure the paypal notify_url being called from paypal server?如何确保从贝宝服务器调用贝宝 notify_url?
【发布时间】:2023-03-16 17:50:01
【问题描述】:

我正在使用贝宝定期付款订阅表单并使用沙盒帐户进行测试

这是我的表格:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <input type="hidden" name="business" value="testacc@email.com">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="Standard Pack">
    <input type="hidden" id="item_number" name="item_number" value="1233434-23213">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="user_id" value="13692">
    <input type="hidden" id="package_id" name="package_id" value="<?php echo $package_type; ?>">
    <input type="hidden" name="a1" value="0">
    <input type="hidden" name="p1" value="1">
    <input type="hidden" id="t1" name="t1" value="M">
    <input type="hidden" id="a3" name="a3" value="10">
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="M">
    <input type="hidden" name="src" value="1">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="no_shipping" value="1">
    <input name="return" type="hidden" value="<?php echo base_url();?>package/new_payment_success" />
    <input name="notify_url" type="hidden" value="<?php echo base_url();?>package/new_payment_notify" /> 
    <input name="cancel_return" type="hidden" value="<?php echo base_url();?>package/new_payment_cancel" />

    <div class="paypal-btn">
        <input type="image" src="pay-with-paypal.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style='width: 125px'>
    </div>
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

它工作得很好,并向notify_url url 发送成功信息 现在出于安全目的,我从$_SERVER 变量中检查HTTP_USER_AGENT,但这也可以修改。

那么在我更新我的数据库之前如何确保横断成功?

【问题讨论】:

    标签: php codeigniter security paypal paypal-sandbox


    【解决方案1】:

    我认为您可以通过附加 cmd=_notify-validate 并将其发送到 PayPal 来验证整个 POST 内容。他们会以已验证或未验证的回复回复您。

    请查看以下链接以获取更多信息:

    https://developer.paypal.com/docs/classic/ipn/gs_IPN/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-29
      • 2015-01-16
      • 2017-08-13
      • 1970-01-01
      • 2011-09-10
      • 1970-01-01
      • 2015-10-17
      • 2018-02-02
      相关资源
      最近更新 更多