Paypal IPN:如何捐赠至少 1 美元?
目前,用户可以在 Paypal 网站上输入小于 1 美元的金额,并且由于 Paypal 费用,有些人的捐款结果为 0 美元。如何将最低金额设置为 1 美元或更多?
Currently, the user can enter a quantity less than $1 on Paypal's website and some people are donations result in $0 because of Paypal fees. How can I set the minimum to be a $1 or more?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在将其发送到 Paypal 之前,您可以使用表单验证来确保该值 >$1。
我会同时使用 Javascript 和 PHP 验证。 JavaScript 很好,因为处理是在客户端完成的,并且是在 http 请求之前完成的。需要 PHP 验证,因为客户端可以关闭 Javascript。
Javascript 验证的示例可能如下所示:
此外,请确保在显示“捐赠金额(最低 5 美元)”之类的字段旁边明确标记了“帮助者”文本。
You could use form validation to ensure the value is >$1 before sending it to Paypal.
I would use both Javascript and PHP validation. Javascript is nice because the processing is done on the client and is done before the http request. PHP validation is required because the client could turn off Javascript.
Example of Javascript validation could be something like this:
Also, make sure you have clearly labeled 'helper' text next to the field that says something like "Donation Amount (Minimum of $5)".