【问题标题】:How to set shipping charges in Paypal SOAP API express checkout如何在 Paypal SOAP API 快速结账中设置运费
【发布时间】:2012-08-10 04:00:29
【问题描述】:

我正在添加 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.

请帮忙

【问题讨论】:

  • 我的情况完全一样,想知道您是否找到了解决方案?在文档中找不到任何关于它的内容:cms.paypal.com/us/cgi-bin/…
  • 你是否也有:SetExpressCheckoutRequestDetailsType sdt = new SetExpressCheckoutRequestDetailsType(); sdt.ShippingMethod = ShippingServiceCodeType.CustomCode; sdt.ShippingMethodSpecified = true;

标签: c#-4.0 paypal express-checkout paypal-soap


【解决方案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)
    }
};

【讨论】:

    猜你喜欢
    • 2015-12-29
    • 2018-04-15
    • 2015-09-26
    • 2014-04-15
    • 2013-05-17
    • 2012-07-02
    • 2020-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多