如何安全地发送贝宝表单的隐藏变量


how to safely send hidden variables of paypal form?

我有一个贝宝表单,它会有隐藏的变量,我可以使用firebug编辑它来更改金额。如何在将此表单发送到贝宝之前避免这种情况,我不会在数据库中存储任何值。一旦从贝宝获得成功值,我应该将这些数据存储在数据库中吗?我应该检查当前金额是否等于发送金额项目id。

<form id="paypal_form_one_time" target="_top" class="paypal-form" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
    <input type="hidden" value="_xclick" name="cmd">
    <input type="hidden" value="110.00" name="amount"> 
    <input type="hidden" value="xxxx@xxx.com" name="business">
    <input type="hidden" value="12345" name="item_number">
    <input type="hidden" value="Featured for 3 Months ($99)" name="item_name">
    <input type="hidden" value="USD" name="currency_code">
    <input type="hidden" value="1" name="no_note">
    <input type="hidden" value="1" name="no_shipping">
    <input type="hidden" value="1" name="rm">                   
    <input type="hidden" value="feature_item_id=1&amp;deal_item_id=0" name="custom">
    <input type="hidden" value="http://localhost/xxxx/xxxx/paypal_success" name="return">
    <input type="hidden" value="" name="user_email">
    <input type="hidden" value="http://xxxx/xx/xxx/paypal_cancel" name="cancel_return">
    <input type="hidden" value="http://xxx/xx/paxxypal_ipn" name="notify_url">
</form>

只需通过curl库和参数CURLOPT_post发布到贝宝-在这种情况下,用户将无法更改参数

另一种方法是实现PayPal Express Checkout API。使用这种方法代替html表单有很多好处。它看起来比简单的html表单更困难,但您可以节省创建IPN侦听器文件的时间,因为响应将立即传递,并且您不会使用IPN方法来检查事务是否成功。此外,您还可以在一个会话中添加多次定期付款和一次性付款,包括税收和福利。你将可以自由添加所有这些东西,实际上是所有东西。