This keeps the `OrderBalance` abstraction but removes the old code now
that the feature is enabled for all users in all instances and there are
no bugs reported. It's become dead code.
The previous mechanism didn't seem to work and newer Rails versions have
an easier config for this now.
Also fixing all i18n errors which were now failing specs.
We observed invalid payment states in Bugsnag but we don't actually know
in which state the payment intent was in. From the context we can guess
that it was "succeeded" but it would be good to validate this. And in
the future it would be good to know if there are other invalid states we
can end up in.
The notification to Bugsnag happens in another part of the code.
This fixes the following deprecation warning
```
[DEPRECATION] `html` is deprecated - use `html_wrap` instead. Please
note that `html_wrap` will wrap all parts of currency and if you use
`with_currency` option, currency element class changes from `currency`
to `money-currency`.
```
This removes millions of deprecation warnings like the following
```
[DEPRECATION] `symbol_position: :before` is deprecated - you can replace it with `format: %u %n`
```
from the build. It gets printed every time a `Spree::Money` is instantiated.
This should result in a non-negligible speed up of the test suite.
This is already tested by the top-most before block and besides, we
there's no OFN in Japan. We don't need to test all supported currencies
but ensure that the various arguments work as intended.
Previously we were creating order objects that were not actually complete, and manually setting the `completed_at` field. This meant the order objects being tested were not actually in the correct state, ie: pre-checkout orders that had not been processed properly.
This is quite hard and tedious due to its tight coupling with
Permissions::Order but sets the path to adding more of these and
eventually refactoring this class in the future.
I saw the row were returned not respecting any ordering when refreshing
the page locally. It made it hard to debug whether or not the customer
balance was right.
It's less than ideal to use `allow_any_instance_of` but with this legacy
and very coupled code, it's the best we can do.
This enables toggling features as best fits us in each case. With this
new approach we can then toggle :customer_balance to an entire instance,
which is what we want in France.