2015-10-14 97 views
0

我想添加一個貝寶「立即購買」按鈕到我的網站。因爲我的產品的價格是每個訂單的客戶數量,所以我需要傳遞由變量{{ order.invoiceValue }}提供的自定義金額。我的代碼片段位於下方,但似乎無法被PayPal識別(請參見下面的截圖)。任何幫助,將不勝感激!貝寶按鈕與自定義金額

<form action="https://www.sandbox.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="XXXYYYZZZ"> 
    <input type="hidden" name="business" value="[email protected]"> 
    <input type="hidden" name="amount" value="{{ order.invoiceValue }}"> 
    <input type="hidden" name="quantity" value="1"> 


    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> 
    <img alt="" border="0"`enter code here` src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
</form> 

enter image description here

回答

0

你不需要添加代碼{{order.invoiceValue}}。相反,只需將該值留空即可。當你的客戶把這筆金額,它的價格將被傳遞給PP。