2012-02-09 65 views
0

在我的本地机器上,当我提交此表单并且我确实在$_SESSION['cart']内有项目时,沙盒确实会识别其中的项目。但是当我在现场服务器上尝试它时,我在$_SESSION['cart']里面有一个项目时提交了表单,沙箱上说我的购物车是空的......为什么?为什么PayPal沙箱会告诉我我的购物车是空的?

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" <?php if(empty($_SESSION['cart'])){echo "onsubmit=\"return false;\"";} ?>> 
    <input type="hidden" name="cmd" value="_cart" /> 
    <input type="hidden" name="upload" value="1" /> 
    <input type="hidden" name="business" value="<?=$ppemail['email']?>" /> 
    <?php 
     $i = 1; 
     foreach($_SESSION['cart'] as $id => $qty): 
      $product = $myCart->getProduct($id); 
    ?> 
      <input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $product['ProductName']; ?>"> 
      <input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $product['ProductID']; ?>"> 
      <input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $product['ProductOverridePrice']; ?>"> 
      <input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $qty; ?>"> 
    <?php 
      $i++; 
     endforeach; 
    ?> 
    <input type="hidden" name="currency_code" value="USD"> 
    <input type="hidden" name="lc" value="US"> 
    <input type="hidden" name="rm" value="2"> 
    <input type="hidden" name="shipping_1" value="<?php echo $shipping; ?>"> 
    <input type="hidden" name="return" value="<?php echo $the_class->settings[0]['DomainName'];?>shopping-cart-details.php"> 
    <input type="hidden" name="cancel_return" value="<?php echo $the_class->settings[0]['DomainName'];?>"> 
    <input type="hidden" name="notify_url" value="<?php echo $the_class->settings[0]['DomainName'];?>classes/paypal.php"> 
    <input type="image" src="images/continue-btn.png" name="pay now" value="pay" /> 
</form> 

回答

0

我发现的bug ......这是在直播服务器的表....我的意思,字段名的一个小caps..errr