Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Always work with Money objects instead of bare numbers #212

Open
flvrone opened this issue Jun 4, 2020 · 0 comments
Open

[BUG] Always work with Money objects instead of bare numbers #212

flvrone opened this issue Jun 4, 2020 · 0 comments

Comments

@flvrone
Copy link

flvrone commented Jun 4, 2020

Because Money objects take care of proper rounding depending on Currency#subunit_to_unit.

To make it clearer - we had to work with JPY currency and there are no subunits. So every time there are some fractional numbers - it ends up with an error from PayPal API, which is fair enough. :)

We also needed a REST API version of your controller (which is worth a separate issue).
Anyway, here's some draft code which demonstrates what needs to be done:
https://github.com/FunkyloverOne/better_spree_paypal_express/commit/1d39a029b213fa1bbfdd3f1240fb09e841e626f7

I could open a PR later.

However, another problem is that I have issues running your test suite.
I generate the dummy app, but it lacks some "iPad" link in tests, I do not yet know the details why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant