Paypal(NVP API)如何为订单打折?

时间:2016-03-15 02:01:19

标签: paypal paypal-sandbox

例如,这是我的请求参数,订单总数是270.00,如果我想使用优惠券($ 10.00)来折扣这个订单,那么订单总数必须是260.00,但现在,我找不到任何关于此api(https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/)中的折扣AMT参数,我忽略了它?

Array(        
    [PAYMENTREQUEST_0_CURRENCYCODE] => USD
    [PAYMENTREQUEST_0_PAYMENTACTION] => Sale
    [PAYMENTREQUEST_0_AMT] => 270.00
    **[some parameter? DISCOUNT_AMT ?] => 10.00 // have this parameter ??**
    [PAYMENTREQUEST_0_ITEMAMT] => 219.00
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 39.00
    [PAYMENTREQUEST_0_HANDLINGAMT] => 12.00
    [L_PAYMENTREQUEST_0_AMT0] => 219.00
    [L_PAYMENTREQUEST_0_QTY0] => 1
    [L_PAYMENTREQUEST_0_NAME0] => Goods title
    [L_PAYMENTREQUEST_0_DESC0] => Goods description
);

抱歉我的英语不好,谢谢你的朋友。

1 个答案:

答案 0 :(得分:4)

您需要将折扣添加为具有负值的附加订单项,然后相应地调整ITEMAMT和AMT。

Array(        
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[PAYMENTREQUEST_0_AMT] => 260.00
[PAYMENTREQUEST_0_ITEMAMT] => 209.00
[PAYMENTREQUEST_0_SHIPPINGAMT] => 39.00
[PAYMENTREQUEST_0_HANDLINGAMT] => 12.00
[L_PAYMENTREQUEST_0_AMT0] => 219.00
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_NAME0] => Goods title
[L_PAYMENTREQUEST_0_DESC0] => Goods description
[L_PAYMENTREQUEST_0_AMT1] => -10.00
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_NAME1] => Discount
[L_PAYMENTREQUEST_0_DESC1] => Coupon Code ABC123

);