PayPal 折扣无法发挥作用

发布于 2024-09-06 21:27:23 字数 2882 浏览 2 评论 0原文

我正在尝试使用 PayPal + Codeigniter 为整个购物车设置折扣,我在没有折扣的情况下也能正常工作。

据我读过,我唯一需要做的就是设置一个隐藏字段discount_amount_cart,正如我所看到的此处

这是我的表单:

<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal_form">
     <input type="hidden" name="rm" value="2" />
     <input type="hidden" name="cmd" value="_cart" />
     <input type="hidden" name="upload" value="1" />
     <input type="hidden" name="currency_code" value="EUR" />
     <input type="hidden" name="business" value="[email protected]" />
     <input type="hidden" name="return" value="http://xxxxxx.com/website/pt/paypal/success/8/4c237a03897e0" />
     <input type="hidden" name="cancel_return" value="http://xxxxxxx.com/website/pt/paypal/cancel/8/4c237a03897e0" />
     <input type="hidden" name="notify_url" value="http://xxxxxx.com/website/pt/paypal/ipn" />
     <input type="hidden" name="custom" value="" />
     <input type="hidden" name="no_shipping" value="1" />
     <input type="hidden" name="cpp_header_image" value="http://xxxxxxxxx.com/images/logo.png" />
     <input type="hidden" name="image_url" value="http://xxxxxxxxx.com/images/logo.png" />
     <input type="hidden" name="invoice" value="4c237a03897e0" />
     <input type="hidden" name="no_note" value="1" />
     <input type="hidden" name="discount_rate_cart" value="10.00" />
     <input type="hidden" name="first_name" value="Foo Bar" />
     <input type="hidden" name="city" value="xxxx" />
     <input type="hidden" name="address1" value="xxxxxx" />
     <input type="hidden" name="zip" value="xxxxxx" />
     <input type="hidden" name="lc" value="pt" />
     <input type="hidden" name="email" value="[email protected]" />
     <input type="hidden" name="country" value="PT" />
     <input type="hidden" name="item_name_1" value="Cloud Hosting WIN Business 25GB" />
     <input type="hidden" name="item_number_1" value="200.00000003" />
     <input type="hidden" name="amount_1" value="156" />
     <input type="hidden" name="quantity_1" value="1" />
     <input type="hidden" name="tax_rate_1" value="20" />
     <p><input type="submit" name="pp_submit" value="Pagar" class="submit" /></p>
    </form>

但是,当我“发布”字段时,折扣线不会出现,我是否需要激活商家帐户中的某些内容,我做错了什么吗?

干杯

I'm trying to setup a discount for a the whole cart using PayPal + Codeigniter, I got this working withouth the discounts.

As far as I've read the only thing that I would need to do is set a hidden field discount_amount_cart as I saw here

Here is my form:

<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal_form">
     <input type="hidden" name="rm" value="2" />
     <input type="hidden" name="cmd" value="_cart" />
     <input type="hidden" name="upload" value="1" />
     <input type="hidden" name="currency_code" value="EUR" />
     <input type="hidden" name="business" value="[email protected]" />
     <input type="hidden" name="return" value="http://xxxxxx.com/website/pt/paypal/success/8/4c237a03897e0" />
     <input type="hidden" name="cancel_return" value="http://xxxxxxx.com/website/pt/paypal/cancel/8/4c237a03897e0" />
     <input type="hidden" name="notify_url" value="http://xxxxxx.com/website/pt/paypal/ipn" />
     <input type="hidden" name="custom" value="" />
     <input type="hidden" name="no_shipping" value="1" />
     <input type="hidden" name="cpp_header_image" value="http://xxxxxxxxx.com/images/logo.png" />
     <input type="hidden" name="image_url" value="http://xxxxxxxxx.com/images/logo.png" />
     <input type="hidden" name="invoice" value="4c237a03897e0" />
     <input type="hidden" name="no_note" value="1" />
     <input type="hidden" name="discount_rate_cart" value="10.00" />
     <input type="hidden" name="first_name" value="Foo Bar" />
     <input type="hidden" name="city" value="xxxx" />
     <input type="hidden" name="address1" value="xxxxxx" />
     <input type="hidden" name="zip" value="xxxxxx" />
     <input type="hidden" name="lc" value="pt" />
     <input type="hidden" name="email" value="[email protected]" />
     <input type="hidden" name="country" value="PT" />
     <input type="hidden" name="item_name_1" value="Cloud Hosting WIN Business 25GB" />
     <input type="hidden" name="item_number_1" value="200.00000003" />
     <input type="hidden" name="amount_1" value="156" />
     <input type="hidden" name="quantity_1" value="1" />
     <input type="hidden" name="tax_rate_1" value="20" />
     <p><input type="submit" name="pp_submit" value="Pagar" class="submit" /></p>
    </form>

But when I "post" the fields the discount line won't appear, do I need to activate something in the merchant account, am I doing something wrong?

Cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁与争疯 2024-09-13 21:27:23

明白了,

来自 PayPal 文档:

当您使用合并折扣金额时,您应在tax_cart 中指定合并税值。如果您没有指定税值,而您的个人资料指定了税率,则在应用合并折扣值后应用您的个人资料税率。

因此,我需要使用 tax_cart 定义购物车的“全局”税额。

Got it,

From the PayPal documentation:

When you use consolidated discount amounts, you should specify a consolidated tax value in tax_cart. If you do not specify a tax value and your profile specifies a tax rate, your profile tax rate is applied after the consolidated discount value is applied.

So I need to define my "global" tax amount for the cart with tax_cart.

吃素的狼 2024-09-13 21:27:23

您输入的折扣名称似乎有误:

<input type="hidden" name="discount_rate_cart" value="10.00" />

应该是:

<input type="hidden" name="discount_amount_cart" value="10" />

使用discount_amount_cart充值
整个单次折扣金额
购物车。

使用discount_amount_x设置
与商品 x 相关的折扣金额

使用discount_rate_cart收费
单一折扣百分比
整个购物车。

discount_rate_cart - 适用于
然而,整个购物车,这个变量
仅适用于“上传”
方法。不是标准的 添加到购物车
变量。

如果您
包括任何个人销售税
您的上传方式中的金额或费率
代码。这是因为销售税
后需要计算
折扣适用于您的商品
因此,折扣适用于
项目小计,而不是总计。

注意,如果您只是使用标准
添加到购物车按钮,没有折扣
整个购物车的变量。作为
他们“仅”将折扣应用于
单个项目。

The name of your discount input appears to be wrong:

<input type="hidden" name="discount_rate_cart" value="10.00" />

should be:

<input type="hidden" name="discount_amount_cart" value="10" />

Use discount_amount_cart to charge a
single discount amount for the entire
cart.

Use discount_amount_x to set a
discount amount associated with item x

Use discount_rate_cart to charge a
single discount percentage for the
entire cart.

discount_rate_cart - Applies to
entire cart however, this variable
will only work with the "Upload"
Method. Not the standard Add to Cart
variables.

This variable will be ignored if you
are including any individual sales tax
amount or rate in your upload method
code. This is because the sales tax
needs to be calculated after the
discount is applied to your items
therefore, the discount is applied to
the item Subtotal, not the Total.

Note, If you just using the standard
Add to Cart buttons, there no Discount
variables for the entire cart. as
they "only" apply a Discount to an
individual item.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文