Paypal沙盒形式 - 空车

时间:2014-04-05 20:58:21

标签: paypal

我已经有很长一段时间了,但无论我尝试什么,都无法弄清楚错误。

<form action="https://www.sandbox.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="sales@mysite.co.uk">

<?php

$result = mysqli_query($DB, "SELECT * FROM salestemp WHERE id = '".$_REQUEST['sid'].
"' ") or die("Error: ".mysqli_error($DB));
$counter = 0;
while($row = mysqli_fetch_array($result))
{
$counter++;
?>
<input type="hidden" name="item_name_<?php echo $counter; ?>" 
value="<?php echo urlencode($row['name']); ?>">
<input type="hidden" name="ammount_<?php echo $counter; ?>" 
value="<?php echo urlencode($row['price']); ?>">

<input type="hidden" name="item_number_<?php echo $counter; ?>" 
value="MD<?php echo urlencode($row['pid']); ?>">
<input type="hidden" name="quantity" value="1">
<?php

}

?>

<input type="hidden" name="currency_code" value="GBP">
<!-- Enable override of buyers's address stored with PayPal . -->
<input type="hidden" name="address_override" value="1">
<!-- Set variables that override the address stored with PayPal. -->
<input type="hidden" name="first_name" value="John">
<input type="hidden" name="last_name" value="Doe">
<input type="hidden" name="address1" value="345 Lark Ave">
<input type="hidden" name="city" value="San Jose">
<input type="hidden" name="state" value="CA">
<input type="hidden" name="zip" value="95121">
<input type="hidden" name="country" value="US">
<input type="image" name="submit" border="0" 
src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" 
alt="PayPal - The safer, easier way to pay online">
</form>

提交表单时,我遇到了&#34;检测到错误:您的购物车是空的&#34;。

任何人都可以帮助我。非常感谢你提前。

1 个答案:

答案 0 :(得分:2)

你有'ammount'而不是'amount'。