Skip to content

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

Description

@flvrone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions