简体   繁体   English

PHP添加到购物车贝宝按钮问题-我的金额问题

[英]php add to cart paypal button problem - problem with my amount

I have a paypal sandbox "Add to Cart" where if a user adds a particular product from a database into an account, it should display the price of that product based on what it is in the database. 我有一个Paypal沙箱“添加到购物车”,如果用户将数据库中的特定产品添加到帐户中,则应该根据数据库中的产品显示该产品的价格。

Say I have these two products; 说我有这两种产品;

prodID: 1 product: Hat price: £5.00 产品:1件:帽子价格:£5.00

prodID: 2 product: socks price: £3.00 产品编号:2产品:袜子价格:3.00英镑

however, when I add these products to cart in sandbox, its says they are £0.50 when they clearly are not. 但是,当我将这些产品添加到沙盒中的购物车中时,它说如果不是,则为0.50英镑。 Here is my code; 这是我的代码;

        <form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="7UCL9YCYYXL3J">
    <input type="hidden" name="item_name" value="<?php echo $row['product']; ?>">
    <input type="hidden" name="item_number" value="<?php echo $row['prodID']; ?>">
    <input type="hidden" name="amount" value="<?php echo $row['price']; ?>">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </form>

it seems this has the problem (i dont know how to handle the _s-xclick: 看来这有问题(我不知道如何处理_s-xclick:

<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7UCL9YCYYXL3J">

instead, this has not: 相反,它没有:

<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="youremail@yahoo.gr">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM