我正在尝试为我的网站创建一个paypal捐赠按钮,但它只允许您有一种货币可用,美元和我正在尝试包含多种货币...我该怎么做才能让人们付钱使用所有不同类型的货币
这是当前的代码:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="MNG6MMDEXT7KL">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
我能以某种方式改变它以包含更多货币吗? 还试图弄清楚如何从回调或其他东西中获取捐赠的金额,以便我可以更新网站上捐赠的金额......
答案 0 :(得分:2)
如果您的网站上已有付款按钮,则可以通过添加一行HTML代码将该按钮转换为其他货币。
<input type="hidden" name="currency_code" value="EUR">
示例代码
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="sales@@UKstore.com" >
<input type="hidden" name="item_name" value="Union Jack Flag">
<input type="hidden" name="amount" value="20">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="undefined_quantity" value="1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" border="0" name="submit" width="73" height="44">
</form>
另外,请查看Currencies and Values
答案 1 :(得分:0)
替换此行(如果有):
<input type="hidden" name="currency_code" value="USD">
用这个:
<select name="currency_code">
<option value="AUD">AUD $</option>
<option value="BRL">BRL R$</option>
<option value="CAD">CAD $</option>
<option value="CHF">CHF Fr.</option>
<option value="CZK">CZK Kč</option>
<option value="DKK">DKK kr.</option>
<option value="EUR">EUR €</option>
<option value="GBP">GBP £</option>
<option value="HKD">HKD $</option>
<option value="HUF">HUF Ft</option>
<option value="ILS">ILS ₪</option>
<option value="JPY">JPY ¥</option>
<option value="MXN">MXN $</option>
<option value="MYR">MYR RM</option>
<option value="NOK">NOK kr</option>
<option value="NZD">NZD $</option>
<option value="PHP">PHP ₱</option>
<option value="PLN">PLN gr</option>
<option value="RUB">RUB ₽</option>
<option value="SEK">SEK kr</option>
<option value="SGD">SGD $</option>
<option value="THB">THB ฿</option>
<option value="TWD">TWD $</option>
<option value="USD" selected>USD $</option>
</select>
这将为用户提供一个下拉框,供他们选择货币。
以下是完整代码的示例:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="business@gmail.com">
<input type="hidden" name="lc" value="IE">
<input type="hidden" name="item_name" value="BusinessName">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://i1.wp.com/www.paypalobjects.com/en_US/i/scr/pixel.gif?resize=1%2C1&ssl=1" data-recalc-dims="1">
Currency:
<select name="currency_code">
<option value="AUD">AUD $</option>
<option value="BRL">BRL R$</option>
<option value="CAD">CAD $</option>
<option value="CHF">CHF Fr.</option>
<option value="CZK">CZK Kč</option>
<option value="DKK">DKK kr.</option>
<option value="EUR">EUR €</option>
<option value="GBP">GBP £</option>
<option value="HKD">HKD $</option>
<option value="HUF">HUF Ft</option>
<option value="ILS">ILS ₪</option>
<option value="JPY">JPY ¥</option>
<option value="MXN">MXN $</option>
<option value="MYR">MYR RM</option>
<option value="NOK">NOK kr</option>
<option value="NZD">NZD $</option>
<option value="PHP">PHP ₱</option>
<option value="PLN">PLN gr</option>
<option value="RUB">RUB ₽</option>
<option value="SEK">SEK kr</option>
<option value="SGD">SGD $</option>
<option value="THB">THB ฿</option>
<option value="TWD">TWD $</option>
<option value="USD" selected>USD $</option>
</select>
</form>