gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 15:43:41 25 4
gpt4 key购买 nike

我一直在使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com