Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

another penny issue! #2296

Closed
chadwhitacre opened this issue Apr 18, 2014 · 1 comment · Fixed by #2298
Closed

another penny issue! #2296

chadwhitacre opened this issue Apr 18, 2014 · 1 comment · Fixed by #2298

Comments

@chadwhitacre
Copy link
Contributor

I can't believe I'm doing this. See also: #1673 #2029 #2198 #2209.

Now I believe I'm seeing some sort of problem about the fee calculation when we adjust for eat-a-penny.

@chadwhitacre
Copy link
Contributor Author

If we get a target of 1.28 or 4.85 then we see 1.25 + 0.03 and 4.75 + 0.10, and we drop to 1.24 + 0.03 and 4.74 + 0.10. The problem is that 1.02 x 1.24 is only 1.2648 and 1.02 x 4.74 is only 4.8348. PayPal appears to do a straight round, so we end up with 1.26 instead of 1.27 and 4.83 instead of 4.84.

chadwhitacre added a commit that referenced this issue Apr 18, 2014
It turns out there's another twist to the MassPay penny saga: in some
situations (when amounts are small enough?), the fee is rounded to what
we wanted it to be anyway. See #2296 for a description.

This commit takes a whole 'nother approach to fee computation. Instead
of computing / 1.02 of the target and then fudging it from there, we
take a much simpler approach. We start at a penny under the target and
work down from there a penny at a time until we find a value that works.
Less efficient but safer.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant