Paypal在上传购物车时显示无效数量错误

时间:2013-04-13 10:11:33

标签: html paypal e-commerce

我已经将自定义购物车上传到paypal,因此客户可以使用payapal付款,但每次我尝试使用它时,我在paypal网站上收到以下错误:

“您输入的数量值无效。数量值必须是大于或等于1的整数。”

这是我的代码:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="upload" value="1">
    <input type="hidden"name="business" value="websales@myemail.co.uk">
    <input type="hidden" name="item_name_1" value="Multi-Purpose Grease - Renolit" >
    <input type="hidden" name="amount_1" value="4.13" >
    <input type="hidden" name="shipping_1" value="1.00" >
    <input type="hidden" name="quantity_1" value="1" >
    <input type="hidden" name="item_name_2" value="Blue Roll six pack, seconds" >
    <input type="hidden" name="amount_2" value="8.00" >
    <input type="hidden" name="shipping_2" value="1.00" >
    <input type="hidden" name="quantity_2" value="1" >
    <input type="hidden" name=" currency_code " value="GBP">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
    <input type="hidden" name="hosted_button_id" value="KJXKVWA5MPEBY">
    <input type= "image"src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
</form>

如果有人有任何想法,我会非常感激,这让我很生气!

1 个答案:

答案 0 :(得分:1)

您正在使用购物车上传命令混合购物车上传按钮。购物车上传命令中不应包含托管按钮ID变量。它需要如下所示。

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="my_email@my_site.com">

<input type="hidden" name="item_name_1" value="Football T-Shirt">
<input type="hidden" name="quantity_1" value="4">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="on0_1" value="Color">
<input type="hidden" name="os0_1" value="Red">
<input type="hidden" name="on1_1" value="Size">
<input type="hidden" name="os1_1" value="Small">

<input type="hidden" name="item_name_2" value="Notebook">
<input type="hidden" name="quantity_2" value="2">
<input type="hidden" name="amount_2" value="2.00">
<input type="hidden" name="on0_2" value="Number of Pages">
<input type="hidden" name="os0_2" value="200">
<input type="hidden" name="on1_2" value="Type">
<input type="hidden" name="os1_2" value="3 Ring">

<input type="submit" value="PayPal">
</form>