get the currency on the package from the order.

fixes #5746
closes #5753
Fix for failure of one of multiple payments.

This corrects an issue which would leave the user on the confirm page
when one of multiple payments failed. This would allow the user to
proceed through the confirm step with an invalid payment, not billing
them for the full amount required.

An example would be with the store credit payment method, where they are
able to pay for part of the order with store credit. Example, the
customer has $20 store credit available and is trying to purchase a $100
item.

Currently, if attempting to charge $80 to the credit card fails (due to
the card being declined), they $80 credit card payment will be flagged
invalid, leaving only the $20 payment. The user would remain on the
confirm page, which allows them to check out paying $20 on their store
credit. The user will beleieve that everything worked correctly, however
their $20 store credit has been consumed, but the order is still in a
balance due state.

This is fixed by only allowing an order to remain on the confirm page if
they have sufficient payments to pay for the entire order.

Closes #5754
speed up country creation

speed up state creation

fixes #5730
allow no variant products to be eligilbe in the exchange for

prevent n+1 query by using is_master

fixes #5749
fixes #5745
Fix state changes page.

Stop stupid assign_user callback.

Fixes #5763
activate the shared example adjustment_source_spec

add the AdjustmentSource concern to the free_shipping action.
move country default to a model

fixes #5765
Remove unused check on product images

Only the @product.variant_images are used in the view.

@product.images is just the images on the master variant, which is
included in @product.variant_images

fixes #5766
fix n+1 for admin product images

include the variant includes

fix inconsistent indentation

use map instead of collect

Don't load @variants on index

They aren't used on index, they're only used in the form.

Pull out eager loads on index from others

We only access images through the variant_images association, which
isn't covered through the variants_including_master

Variants_including_master will speed up the form, and this will speed up
the index.

Cache the result of has_products?

Rather than calling it twice... which will hit the database

fixes #5723
Fix issue on checkouts controller.

This is a bug which occurs preventing orders from moving past the
payment state when promotions, or other adjustments are applied to the
order.

order.total is the amount to be paid, order.amount is the total of the
line items.

This issue was introduced in #5754

fixes #5768
remove and return
fixes #5769