asp.net-mvc-3 - 为什么 PayPal 忽略 discount_amount_cart?

标签 asp.net-mvc-3 paypal

我一直在使用 PayPal 支付标准。一切都很好。现在我想添加对优惠券折扣的支持。

根据documentation ,discount_amount_cart 变量似乎是我想要的:

Single discount amount charged cart-wide. It must be less than the selling price of all items combined in the cart. This variable overrides any individual item discount_amount_x values, if present. Applies only to the Cart Upload command.

因此,我将变量添加到我的表单中:

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

    <input id="business" name="business" type="hidden" value="kelly@hopskipdesign.com">
    <input id="custom" name="custom" type="hidden" value="Client">
    <input id="discount_amount_cart" name="discount_amount_cart" 
        type="hidden" value="$4.00">
    <input id="tax_cart" name="tax_cart" type="hidden" value="$1.65">
    <input id="currency_code" name="currency_code" type="hidden" value="USD">

    <input id="return" name="return" type="hidden" value="http://www.hopskipphotography.com/Order/Confirm/Client">
    <input id="cancel_return" name="cancel_return" type="hidden" value="http://www.hopskipphotography.com/Order/Cart/Client">
    <input id="cbt" name="cbt" type="hidden" value="Place Order">

    <input id="item_name_1" name="item_name_1" type="hidden" value="Photo #6">
    <input id="amount_1" name="amount_1" type="hidden" value="$20.00">
    <input id="item_number_1" name="item_number_1" type="hidden" value="B49A8382">
    <input id="quantity_1" name="quantity_1" type="hidden" value="1">

    <input id="item_name_2" name="item_name_2" type="hidden" value="Photo #10">
    <input id="amount_2" name="amount_2" type="hidden" value="$20.00">
    <input id="item_number_2" name="item_number_2" type="hidden" value="B49A8428">
    <input id="quantity_2" name="quantity_2" type="hidden" value="1">

    <div class="checkout-button">
        <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="Check out with PayPal">
    </div>
</form>

但是当我点击按钮时,除了折扣之外,一切都出现:

Your order summary - Total $41.65 USD

我发现了一个类似的问题,其中 answer是使用 tax_cart 变量而不是 tax_x。但我已经在使用 tax_cart。

关于为什么 discount_amount_cart 不起作用的任何其他想法?

最佳答案

与其他金额变量不同,discount_amount_cart 不喜欢美元符号。

当我将字段更改为:

<input id="discount_amount_cart" name="discount_amount_cart" 
    type="hidden" value="4.00">

PayPal 显示折扣:

Your order summary - Discount -$4.00 - Total $37.65 USD

关于asp.net-mvc-3 - 为什么 PayPal 忽略 discount_amount_cart?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17494168/

相关文章:

Paypal - 简单的 IPN

asp.net-mvc - 是否自定义成员(member)

asp.net-mvc - Mvc3 Antiforgery token 多标签

asp.net-mvc-3 - 带有 MVC3 ASP.NET 的 PayPal PayFlow

android - 使用移动支付库的 PayPal 交易

php - 将自定义变量传递给 Paypal IPN

php - 为什么我在 paypal 沙箱上收到 payment_status 待处理?

.net - WCF Web API 与 ASP.NET MVC JSON Web 服务

asp.net-mvc - 如何禁用特定 Controller /操作的自动 ModelState 验证?

asp.net - JSON 在 IE7 中未定义