2011-03-18 70 views

回答

7

以下页面列出了立即购买按钮的最低要求信息。我已经包括了最简单的例子:

https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_techview_outside

<?php 
echo '<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_xclick"> 
<input type="hidden" name="business" value="[email protected]"> 
<input type="hidden" name="currency_code" value="USD"> 
<input type="hidden" name="item_name" value="Teddy Bear"> 
<input type="hidden" name="amount" value="12.99"> 
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!"> 
</form>'; 

不要忘了逃走的任何“'”字符(单引号)。

16

我也发现了,你可以通过信息在这样一个网址:

https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Hot Sauce-12+oz.+Bottle&item_number=12345&amount=5%2e95&currency_code=USD 

,你可以做这样的事情:

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&[email protected]&item_name=Hot Sauce-12+oz.+Bottle&item_number=12345&amount=5%2e95&currency_code=USD"> 
<img src="/buynow.png" /> 
</a> 
+0

啊真棒,我不知道! – 2011-03-18 07:08:53

+0

这是我需要的。谢谢。 – Samphors 2015-10-06 23:54:28

1

HTML代码中添加一个简单的贝宝现在购买按钮是这样的:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
    <!-- Identify your business so that you can collect the payments. --> 
    <input type="hidden" name="business" value="[email protected]"> 
    <!-- Specify a Buy Now button. --> 
    <input type="hidden" name="cmd" value="_xclick"> 
    <!-- Specify details about the item that buyers will purchase. --> 
    <input type="hidden" name="item_name" value="Demo Ebook"> 
    <input type="hidden" name="amount" value="5"> 
    <input type="hidden" name="currency_code" value="USD"> 
    <!-- Display the payment button. --> 
    <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online"> 
    <img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif"> 
</form> 

如果您想要动态更改项目,只需更改item_name值。与演示和下载链接

的更多信息,可以发现here

0

我知道它已经有一段时间,但是,这是最好的帮助:

https://www.paypal.com/cgi-bin/webscr?cmd=_singleitem-intro-outside

只需填写表格和PayPal将产生您的HTML表单。在左侧的按钮导航下,您还可以生成“立即购买”,“添加到购物车”,“捐赠”,“购买礼券”和“订阅”的代码。