我已经研究了很长时间,但无论我怎么尝试都无法找出错误。
<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>
提交表单时遇到“检测到错误:您的购物车是空的”。
任何人都可以帮助我吗?非常感谢您。
最佳答案
你有 'ammount' 而不是 'amount'。
关于 Paypal 沙盒表格 - 空购物车,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22886727/