gpt4 book ai didi

django paypal - 如何防止用户篡改金额

转载 作者:太空宇宙 更新时间:2023-11-03 15:48:55 25 4
gpt4 key购买 nike

我正在使用 Django 1.7 和 django-paypal。

我关注tutorial ,一切正常。

然而,虽然付款表单是隐藏的,但我发现用户可以通过简单地使用浏览器检查元素功能来调节金额。

例如。

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input id="id_business" name="business" type="hidden" value="xxx@example.com">
<input id="id_amount" name="amount" type="hidden" value="10.0">
<input id="id_item_name" name="item_name" type="hidden" value="2">
<input id="id_notify_url" name="notify_url" type="hidden" value="http://www.example.com/pp/ipn/">
<input id="id_cancel_return" name="cancel_return" type="hidden" value="http://www.example.com/order/21/">
<input id="id_return_url" name="return" type="hidden" value="http://www.example.com/thank-you">
<input id="id_invoice" name="invoice" type="hidden" value="21"><input id="id_cmd" name="cmd" type="hidden" value="_xclick">
<input id="id_charset" name="charset" type="hidden" value="utf-8">
<input id="id_currency_code" name="currency_code" type="hidden" value="USD">
<input id="id_no_shipping" name="no_shipping" type="hidden" value="1">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="Buy it Now">
</from>

这是一个错误还是我在这里遗漏了什么?如何防止用户欺诈付款?我应该在 ipn View 上验证付款吗??

最佳答案

您创建的按钮代码是 Clear text 按钮,它不是托管按钮。为了防止按钮被篡改,我建议您创建一个托管按钮。创建步骤:

1) 登录 www.paypal.com

2) 导航至我的个人资料->我的销售工具或我的销售偏好

3) 单击“PayPal 按钮”旁边的“更新”

4) 创建新按钮并输入所有必需的信息,

5) 在第 2 步中,选中复选框(PayPal 上的保存按钮),点击保存

enter image description here

托管按钮存储在 PayPal 上。与此类按钮关联的参数是安全的。托管按钮提供了最大的灵 active ,因为您可以指示 PayPal 动态更改它们,而 PayPal 维护有关它们状态的信息,例如与按钮关联的库存水平。

关于django paypal - 如何防止用户篡改金额,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26154830/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com