0

我有下面的代码从贝宝获取令牌,但不知何故贝宝不断向我发送一个错误,说购物车项目的总数与订单金额不匹配。我在这里做错了什么?

                    <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>
4

1 回答 1

1

好的,所以我需要包含 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>
于 2013-10-17T09:24:59.443 回答