0

20.00のアイテムを追加し、注文合計を22.00に設定しています

 paymentDetails.OrderTotal = new PayPalSandboxWS.BasicAmountType()
     {
         currencyID = ConvertProgramCurrencyToPayPalSandbox(currency),
         Value = "22.00"
     };

送料の合計を2.00に設定します

 paymentDetails.ShippingTotal = new PayPalSandboxWS.BasicAmountType()
     {
         currencyID = ConvertProgramCurrencyToPayPalSandbox(currency),
         Value = "2.00"
     };

しかし、私はこのエラーを受け取ります:The totals of the cart item amounts do not match order amounts.

手伝ってください

4

1 に答える 1

1

値の設定に失敗しましたItemTotal! それがこのエラーを引き起こしました:

double itemTot  = 20.0;
double tot      = 22.0;
double shipping = 2.0;
string desc     = "";
var paymentDetailsItemTypes = new List<PaymentDetailsItemType>();

PaymentDetailsType pdt = new PaymentDetailsType()
{        
    OrderDescription = desc,
    OrderTotal = new BasicAmountType()
    {
        currencyID = CurrencyCodeType.EUR,
        Value = tot.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)
    },
    PaymentDetailsItem = paymentDetailsItemTypes.ToArray(),
    ShippingTotal = new BasicAmountType()
    {
        currencyID = CurrencyCodeType.EUR,
        Value = shipping.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)
    },
    ItemTotal = new BasicAmountType()
    {
        currencyID = CurrencyCodeType.EUR,
        Value = itemTot.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture)
    }
};
于 2012-08-17T13:11:10.233 に答える