Credit card API amount paid rounding error.

Bug #1474566 reported by Bill Erickson on 2015-07-14
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

Evergreen 2.8, affects all versions.

Not to be confused with bug #1282751, which I'm fairly certain is a different issue.

This error occurs when calculating the total amount to pay for CC payments in the payments API. The total is created by adding all of the individual fines for the transactions in question, some of which are decimal amounts. The logic is not protected by forcing integer math. This results in rare cases with CC payments of amounts like "9.99999999999", which for us is rejected by PayPal with an "Invalid amount" error.

Branch en route.

Bill Erickson (berick) wrote :

Fix pushed:;a=shortlog;h=refs/heads/user/berick/lp1474566-cc-amount-rounding

Basic testing shows no negative effects. Will test more w/ live data and known troublesome data soon and will report back.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Bill Erickson (berick) wrote :

Fixed the commit message so that it refers to the correct bug, rebased to master, and force pushed back to the same branch. Added pullrequest tag.

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.10-beta
Jason Stephenson (jstephenson) wrote :

Is this something that should be backported to 2.9 and 2.8?

Ben Shum (bshum) wrote :

Pushed to master and also backported to rel_2_9 and rel_2_8 as a bug fix.

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers