Author Topic: paypal express error, amount not equal  (Read 11483 times)

Offline digitalt

  • Full Member
  • ***
  • Posts: 116
  • Karma: +20/-0
    • View Profile
Re: paypal express error, amount not equal
« Reply #15 on: October 08, 2016, 07:49:13 AM »
i have this:

      //Need to round price after discounts and specials
      //round main price to currency decimal_place setting (most common 2, but still...)
      $currency = $this->registry->get('currency')->getCurrency();
      $decimal_place = (int)$currency['decimal_place'];
      $decimal_place = !$decimal_place ? 2 : $decimal_place;
      $price = round($price, $decimal_place);

however it does nothing if I remove the rounding of the price calc.

See above

kolynet

  • Guest
Re: paypal express error, amount not equal
« Reply #16 on: October 08, 2016, 07:59:23 AM »
x
« Last Edit: March 10, 2023, 02:04:36 PM by kolynet »

Offline digitalt

  • Full Member
  • ***
  • Posts: 116
  • Karma: +20/-0
    • View Profile
Re: paypal express error, amount not equal
« Reply #17 on: October 08, 2016, 08:16:08 AM »
The DB thing is a logical suggestion as to why your having this problem.  It may be code related, but if nothing else, it will confirm whether the db decimal places is the cause or not.

kolynet

  • Guest
Re: paypal express error, amount not equal
« Reply #18 on: October 08, 2016, 08:16:48 AM »
x
« Last Edit: March 10, 2023, 02:04:42 PM by kolynet »

Offline digitalt

  • Full Member
  • ***
  • Posts: 116
  • Karma: +20/-0
    • View Profile
Re: paypal express error, amount not equal
« Reply #19 on: October 08, 2016, 08:35:19 AM »
How's your currency setup in Localization?  I bet you have to trim the conversion down to 2 decimal places.  Been on the right track, maybe just the wrong place.  Look at the screen shot. 


========

You might have to change the db xxx_currencies  It is "set" for 2 decimal places,but the value is 15,8.  This makes more sense looking at things a bit closer.


« Last Edit: October 08, 2016, 08:39:30 AM by digitalt »

kolynet

  • Guest
Re: paypal express error, amount not equal
« Reply #20 on: October 08, 2016, 08:43:35 AM »
x
« Last Edit: March 10, 2023, 02:04:47 PM by kolynet »

kolynet

  • Guest
Re: paypal express error, amount not equal
« Reply #21 on: October 08, 2016, 08:58:29 AM »
x
« Last Edit: March 10, 2023, 02:04:52 PM by kolynet »

Offline digitalt

  • Full Member
  • ***
  • Posts: 116
  • Karma: +20/-0
    • View Profile
Re: paypal express error, amount not equal
« Reply #22 on: October 08, 2016, 09:06:34 AM »
That's what I'm saying in the DB.  In xxx_currencies, "value" needs to be 15,2 not 15,8.  This forces 2 decimal places regardless of code.  It might not be the right fix, but it forces an output of 2 decimal places.

kolynet

  • Guest
Re: paypal express error, amount not equal
« Reply #23 on: October 08, 2016, 10:26:48 AM »
x
« Last Edit: March 10, 2023, 02:04:58 PM by kolynet »

Offline digitalt

  • Full Member
  • ***
  • Posts: 116
  • Karma: +20/-0
    • View Profile
Re: paypal express error, amount not equal
« Reply #24 on: October 08, 2016, 11:17:21 AM »
Look at your math. 83.05 is correct by the formatted total and the displayed total is correct with rounding.

Now, I don't understand what your getting at  Your example is correct both ways. It is displaying the correct amounts. 

You were looking at why Paypal gets a 3 decimal place number and throws an error.  I have suggested ways to correct it and things to look at.  This is getting away from the original question/topic.

kolynet

  • Guest
x
« Reply #25 on: October 08, 2016, 12:43:46 PM »
x
« Last Edit: March 10, 2023, 02:05:04 PM by kolynet »

 

Powered by SMFPacks Social Login Mod