3

PayPalExpress 95.0 版ASP.Net & C#

CurrencyCodeType currency = (CurrencyCodeType)
   Enum.Parse(typeof(CurrencyCodeType), currencyCode.SelectedValue);
PaymentDetailsType paymentDetails = new PaymentDetailsType();
paymentDetails.ShippingTotal = new BasicAmountType(currency, shippingTotal.Value);
paymentDetails.ItemTotal = new BasicAmountType(currency, itemTotal.ToString());
paymentDetails.OrderTotal = new BasicAmountType(currency, orderTotal.ToString());

我只看到ShippingDiscount。我想知道如何ItemTotal/SubTotal 上应用折扣(而不是在单个项目上)。

在此处输入图像描述

我发现Paypal Express Checkout: Apply order discount in SO 但答案是关于单个商品的折扣。

感谢您的帮助!

4

1 回答 1

3

我的天啊!刚刚想通了!正确的是,您必须在您的商品中添加另一个商品作为折扣。困难的部分是让小/总计正确!

这是我的SUCCESS提交:

array(14) {
    //  ERROR AREA 1    //  Total Amount of Items (including -Discount) and shipping and tax
    ["PAYMENTREQUEST_0_AMT"]
            =>  string(4) "9.71"
    //  ERROR AREA 2    //  Total Amount of items ONLY, including the -Discount!
    ["PAYMENTREQUEST_0_ITEMAMT"]
            =>  string(4) "6.76"
    ["PAYMENTREQUEST_0_SHIPPINGAMT"]
            =>  string(4) "2.95"
    ["PAYMENTREQUEST_0_TAXAMT"]
            =>  string(1) "0"

    /*  ITEMS   */

        /*  ITEM 01 */
    ["L_PAYMENTREQUEST_0_NAME0"]
            =>  string(18) "Order # 987654"
    ["L_PAYMENTREQUEST_0_AMT0"]
            =>  float(12.51)
    ["L_PAYMENTREQUEST_0_NUMBER0"]
            =>  string(6) "987654"
    ["L_PAYMENTREQUEST_0_QTY0"]
            =>  float(1)
    ["L_PAYMENTREQUEST_0_ITEMCATEGORY0"]
            =>  string(8) "Physical"

        /*  ITEM 02 */
        /*  ¡THE DISCOUNT!  */
    ["L_PAYMENTREQUEST_0_NAME1"]
            =>  string(9) "PromoCode"
    ["L_PAYMENTREQUEST_0_AMT1"]
            =>  float(-5.75)
    ["L_PAYMENTREQUEST_0_NUMBER1"]
            =>  string(18) "Promo 123456"
    ["L_PAYMENTREQUEST_0_QTY1"]
            =>  float(1)
    ["L_PAYMENTREQUEST_0_ITEMCATEGORY1"]
            =>  string(8) "Physical"
}

成功!

array(6) {
    ["TOKEN"]
        =>  string(20) "NOTIMPORTANT"
    ["TIMESTAMP"]
        =>  string(20) "2014-10-03T12:39:06Z"
    ["CORRELATIONID"]
        =>  string(12) "NOTIMPORTANT"
    ["ACK"]
        =>  string(7) "SUCCESS"
    ["VERSION"]
        =>  string(2) "93"
    ["BUILD"]
        =>  string(8) "13154493"
}

是的,我知道这个问题很老,但我在其他任何地方都找不到答案。所以这是我的工作解决方案!

于 2014-10-03T12:51:55.010 回答