Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

PayPal cart item totals error- Solved?

 
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions
 
Thread Tools
  #1  
Old 11-18-2015, 10:38 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default PayPal cart item totals error- Solved?

Hi guys and gals,

I have spent the last 12 hours of my life stressing about a problem with XC5 and X-Payments, and I am reporting here to help others as well as get feedback on my ultimate solution.

Here is the setup:
One of my clients has been receiving complaints from customers that they receive the following PayPal error message when placing their order:

"10413: The totals of the cart item amounts do not match order amounts"

The client is using XC 5.2.9, and hosted X-Payments, with PayPal PayFlow Pro and iframe credit card form.

The problem only occurs when using the volume discounts module, and if the customer has a discounted item in their cart. Then the order item's "price" is different than the item's "itemNetPrice". When this happens, PayPal checks the item price and qty, and totals it up to see if it matches the cart total, and it doesn't.

To fix this, I edited the class XLite\Module\CDev\XPaymentsConnector\Core\Xpayment sClient

Line #637:
I changed:

'price' => $this->roundCurrency($item->getPrice()),

to:

'price' => $this->roundCurrency($item->getItemNetPrice()),

My thinking was that this is the file that sent the cart information to X-Payments, or at least prepared that info.And rather than send the price, I wanted to send the itemNetPrice which is what the cart total was being calculated from.

What do you think of this solution? Is there a better way? Should this fix be added to the core?

Thanks,

-Mike
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #2  
Old 11-18-2015, 11:15 AM
  ambal's Avatar 
ambal ambal is offline
 

X-Cart team
  
Join Date: Sep 2002
Posts: 4,126
 

Default Re: PayPal cart item totals error- Solved?

Hey Mike,

Upgrade of X-Payments to v2.2 should fix the issue, too.
It happens because of line items passed to PayPal from an integrated cart like X-Cart that do not match total of the order. The mismatch happens because of rounding.

X-Payments Hosted users can get upgrade to any new X-Payments version free of charge - just post us a ticket about that!
__________________
Sincerely yours,
Alex Mulin
VP of Business Development for X-Cart
X-Payments product manager

Last edited by ambal : 11-19-2015 at 12:04 AM.
Reply With Quote

The following user thanks ambal for this useful post:
totaltec (11-18-2015)
  #3  
Old 11-19-2015, 08:09 AM
  random's Avatar 
random random is offline
Advanced Staff Users
 

X-Cart team
  
Join Date: Dec 2008
Posts: 79
 

Default Re: PayPal cart item totals error- Solved?

Quote:
Originally Posted by ambal
Hey Mike,

Upgrade of X-Payments to v2.2 should fix the issue, too.
It happens because of line items passed to PayPal from an integrated cart like X-Cart that do not match total of the order. The mismatch happens because of rounding.

X-Payments Hosted users can get upgrade to any new X-Payments version free of charge - just post us a ticket about that!

Please note that this issue was fixed in 2.2 only for the PayPal Pro (Payflow API) gateway.
"Payflow Pro" itself left untouched since it is an universal module (e.g. it may use FDMS instead of PayPal), but this issue is only related to PayPal. We'll consider to change this behavior to avoid such issues in future.

But anyway, If you use PayPal through Payflow you'd better use PayPal Pro (Payflow API) module, since it is absolutely same as Payflow Pro, but supports PayPal-only features (like IPN).
__________________
Sincerely yours,
Vladimir Petrov
Senior X-Payments Developer
Reply With Quote

The following user thanks random for this useful post:
totaltec (11-19-2015)
  #4  
Old 07-17-2017, 11:31 AM
 
The Vinyl Spectrum The Vinyl Spectrum is offline
 

Member
  
Join Date: Dec 2014
Posts: 14
 

Default Re: PayPal cart item totals error- Solved?

Quote:
Originally Posted by random
Please note that this issue was fixed in 2.2 only for the PayPal Pro (Payflow API) gateway.
"Payflow Pro" itself left untouched since it is an universal module (e.g. it may use FDMS instead of PayPal), but this issue is only related to PayPal. We'll consider to change this behavior to avoid such issues in future.

But anyway, If you use PayPal through Payflow you'd better use PayPal Pro (Payflow API) module, since it is absolutely same as Payflow Pro, but supports PayPal-only features (like IPN).

Here we are years later and this problem still exists in the Payflow API module on 5.3.3.1. Very sad as we were the ones that paid the OP to work on this issue. I have filed a support ticket and would like this resolved please.
__________________
RUNNING: X-Cart Business 5.4.1.25
Reply With Quote
  #5  
Old 07-17-2017, 11:35 AM
  random's Avatar 
random random is offline
Advanced Staff Users
 

X-Cart team
  
Join Date: Dec 2008
Posts: 79
 

Default Re: PayPal cart item totals error- Solved?

Quote:
Originally Posted by The Vinyl Spectrum
Here we are years later and this problem still exists in the Payflow API module on 5.3.3.1. Very sad as we were the ones that paid the OP to work on this issue. I have filed a support ticket and would like this resolved please.

If you've mentioned the "PayPal Pro (Payflow Api)" payment gateway then it is powered by X-Payments and in case you're using an old version of X-Payments you still may face with that issue.
Please upgrade your X-Payments to the latest version to fix this issue.
__________________
Sincerely yours,
Vladimir Petrov
Senior X-Payments Developer
Reply With Quote
  #6  
Old 07-17-2017, 11:47 AM
 
The Vinyl Spectrum The Vinyl Spectrum is offline
 

Member
  
Join Date: Dec 2014
Posts: 14
 

Default Re: PayPal cart item totals error- Solved?

Perhaps it is... I will look into getting that upgraded. Thank you for the feedback.
__________________
RUNNING: X-Cart Business 5.4.1.25
Reply With Quote
Reply
   X-Cart forums > X-Payments > X-Payments issues & questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:25 AM.

   

 
X-Cart forums © 2001-2020