php
  • upload
  • paypal
  • shopping-cart
  • 2013-03-07 91 views 0 likes 
    0

    我試圖用以下代碼上傳一個購物車,但是當用戶點擊「立即購買」按鈕時,而不是顯示PayPal的訂單摘要頁面,用戶可以登錄付款,我得到一個錯誤說Your shopping cart is empty.PayPal使用一個按鈕簡單上傳購物車 - 爲什麼購物車是空的?

    這是我的代碼,它有什麼問題?

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
    <a href='cart.php?type=current' class='buttonlink previous'>Edit Order</a>&nbsp;&nbsp;<a href='checkout4_confirm.php' class='buttonlink next'>Submit Order</a> 
    <input type="hidden" name="cmd" value="_cart"> 
    <input type="hidden" name="hosted_button_id" value="JRECLRTYAJDKY"> 
    <input type="hidden" name="upload" value="1"> 
    <input type="hidden" name="business" value="[email protected]"> 
    <input type="hidden" name="item_name_1" value="<?php echo $order_number; ?>"> 
    <input type="hidden" name="item_number_1" value="1"> 
    <input type="hidden" name="quantity_1" value="1"> 
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.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步中的選項以將按鈕保存到PayPal。然後一旦生成代碼,請單擊鏈接以刪除代碼保護。這將創建一個明確的文字非託管按鈕。那麼你應該可以修改按鈕。

    +0

    但它不會安全,會嗎? – user961627 2013-03-07 17:09:40

    +1

    這取決於你對安全的描述。對於客戶的信用卡信息,它仍然是安全的。就某人可以右鍵單擊該頁面並查看源代碼而言,這並不安全。保存它,然後修改金額並處理較少金額的付款。使用非託管按鈕的商家只需讓他們的系統執行IPN檢查並退還不完全金額的交易。您也可以隨時創建託管按鈕,並在當時傳遞您的信息,而不是在之後進行修改。 – 2013-03-07 18:11:52

    相關問題