“立即捐赠"的 Paypal 自定义金额按钮 [英] Paypal custom amount for "Donate Now" button
问题描述
有人要求我在网站上实施 Paypal立即捐赠"功能,类似于 维基百科网站.
I've been asked to implement Paypal "Donate Now" functionality on a web site, similar to Wikipedia's site.
我知道如何生成固定金额和可变金额的立即购买/捐赠"按钮,但我不知道维基百科如何让用户在其网站上指定金额,然后将其结转到 Paypal,以便预填> 一旦他们到达那里.
I know how to generate "Buy/Donate Now" buttons with fixed amounts, and with variable amounts, but I don't see how Wikipedia is able to have the user specify the amount on their site and then have it carry over to Paypal, so that the amount is pre-filled once they get there.
Paypal 自己的文档似乎不支持金额"字段(或者我错过了).我实际上打电话给 Paypal 支持,并被告知我必须使用第 3 方购物车才能实现此功能,但如果购物车支持此功能,它不只是一个表单参数吗?
Paypal's own documentation does not seem to support an "amount" field (or I've missed it). I actually called Paypal support and was told that I'd have to use a 3rd-party shopping cart for this functionality, but if the carts support this, isn't it just a form param?
推荐答案
是的,这里有一个 HTML 输入参数.简称为金额".
参见 https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
Yes, there's an HTML input parameter for this. Simply called 'amount'.
See https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
只需在任何 HTML 输入/选择字段中包含 amount
并确保将其传递给 PayPal.例如:
Just include amount
in any HTML input/select field and ensure you pass it over to PayPal. For example:
<label for="amount">Enter the amount you wish to donate:</label>
<input type="text" id="amount" name="amount" value"">
或者;
<label for="amount">Select the amount you wish to donate:</label>
<select name="amount" id="amount">
<option value="5.00">$5.00</option>
<option value="25.00">$25.00</option>
<option value="50.00">$50.00</option>
</select>
这篇关于“立即捐赠"的 Paypal 自定义金额按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!