gpt4 book ai didi

java - SetExpressCheckout with tax, 购物车商品总金额与订单金额不匹配

转载 作者:太空宇宙 更新时间:2023-11-03 16:33:21 26 4
gpt4 key购买 nike

我有下面的代码可以从 paypal 获取 token ,但不知何故 paypal 一直向我发送错误消息,提示购物车商品总数与订单金额不符。我在这里做错了什么?

                    <ebl:PaymentDetails>
<ebl:OrderTotal currencyID="USD">21.70</ebl:OrderTotal>
<ebl:TaxTotal currencyID="USD">1.70</ebl:TaxTotal>
<ebl:ButtonSource>PayPal_SDK</ebl:ButtonSource>
<ebl:PaymentDetailsItem>
<ebl:Name>Product A</ebl:Name>
<ebl:Quantity>1</ebl:Quantity>
<ebl:Tax currencyID="USD">1.70</ebl:Tax>
<ebl:Amount currencyID="USD">20.00</ebl:Amount>
</ebl:PaymentDetailsItem>
</ebl:PaymentDetails>

如果我合并税金和金额,它会按预期工作(参见下面的示例)。我想单独征税,以便用户知道他们为产品支付了多少税。

                    <ebl:PaymentDetails>
<ebl:OrderTotal currencyID="USD">21.70</ebl:OrderTotal>
<ebl:ButtonSource>PayPal_SDK</ebl:ButtonSource>
<ebl:PaymentDetailsItem>
<ebl:Name>Product A</ebl:Name>
<ebl:Quantity>1</ebl:Quantity>
<ebl:Amount currencyID="USD">21.70</ebl:Amount>
</ebl:PaymentDetailsItem>
</ebl:PaymentDetails>

最佳答案

好的,所以我需要包含 itemTotal、taxTotal 和 orderTotal 才能使其正常工作。

                    <ebl:PaymentDetails>
<ebl:OrderTotal currencyID="USD">43.40</ebl:OrderTotal>
<ebl:ItemTotal currencyID="USD">40.00</ebl:ItemTotal>
<ebl:TaxTotal currencyID="USD">3.40</ebl:TaxTotal>
<ebl:ButtonSource>PayPal_SDK</ebl:ButtonSource>
<ebl:PaymentDetailsItem>
<ebl:Name>Product A</ebl:Name>
<ebl:Quantity>1</ebl:Quantity>
<ebl:Tax currencyID="USD">1.70</ebl:Tax>
<ebl:Amount currencyID="USD">20.00</ebl:Amount>
</ebl:PaymentDetailsItem>
<ebl:PaymentDetailsItem>
<ebl:Name></ebl:Name>
<ebl:Quantity>2</ebl:Quantity>
<ebl:Tax currencyID="USD">0.85</ebl:Tax>
<ebl:Amount currencyID="USD">10.00</ebl:Amount>
</ebl:PaymentDetailsItem>
</ebl:PaymentDetails>

关于java - SetExpressCheckout with tax, 购物车商品总金额与订单金额不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19420250/

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