2011-03-18 71 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表單。在左側的按鈕導航下,您還可以生成「立即購買」,「添加到購物車」,「捐贈」,「購買禮券」和「訂閱」的代碼。