Product based discounts break the PayPal EC API request

Created on 6 January 2016, almost 10 years ago
Updated 18 August 2025, 2 months ago

When a product based discount is applied to an order, the [PAYMENTREQUEST_0_AMT] value in the API request is incorrect because the discount value is applied to it twice.

Example error request where [PAYMENTREQUEST_0_AMT] should be 31.46

[METHOD] => SetExpressCheckout
[PAYMENTREQUEST_0_PAYMENTACTION] => Sale
[PAYMENTREQUEST_0_AMT] => 17.97
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_INVNUM] => #####
[RETURNURL] => https://....
[CANCELURL] => https://.....
[L_PAYMENTREQUEST_0_NAME0] => Product title
[L_PAYMENTREQUEST_0_AMT0] => 31.47
[L_PAYMENTREQUEST_0_QTY0] => 1
[L_PAYMENTREQUEST_0_NUMBER0] => 11182015
[L_PAYMENTREQUEST_0_NAME1] => Fixed amount discount
[L_PAYMENTREQUEST_0_AMT1] => -13.49
[L_PAYMENTREQUEST_0_QTY1] => 1
[L_PAYMENTREQUEST_0_NUMBER1] => 
[PAYMENTREQUEST_0_ITEMAMT] => 17.97
[PAYMENTREQUEST_0_TAXAMT] => 0.00
[PAYMENTREQUEST_0_SHIPTONAME] =>  
[PAYMENTREQUEST_0_SHIPTOSTREET] => 
[PAYMENTREQUEST_0_SHIPTOSTREET2] => 
[PAYMENTREQUEST_0_SHIPTOCITY] => 
[PAYMENTREQUEST_0_SHIPTOSTATE] => 
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => US
[PAYMENTREQUEST_0_SHIPTOZIP] => 
[NOSHIPPING] => 1
πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

PayPal EC

Created by

πŸ‡ΊπŸ‡ΈUnited States andyg5000 North Carolina, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024