Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
This removes the logic from the API class and moves all the calls to the
order_params method to our new module.
|
|
This leaves the API class to just be resonsible for calling the right
methods on the TaxJar gem.
|
|
|
|
|
|
There's no reason for both the TaxCalculator and the API to have nearly
the same logic... so I unified that while was in there.
|
|
This allows stores to specify their own discount calculator in an
initializer, by doing something like the following:
SuperGood::SolidusTaxJar.discount_calculator = MyStore::CustomDiscountCalculator
The class's constructor should take in a line item and have a #discount
method that returns the discount amount (which should be a negative
number.)
|
|
This extracts the functionality of calculating the discount for a line
item in the interest of making this behaviour configurable for stores
that would like to factor in order level adjustments in some way.
|
|
|
|
|
|
|
|
TaxJar API is not keen on orders with no line items and will throw
errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It's not necessary because we're sending line items.
|
|
Oops, was grabbing the total shipping tax for the order and using that
as the tax, instead of grabbing the collectable tax from the breakdown.
That makes more sense.
|
|
|
|
This is partially a refactor, and also handles the unlikely scenario
where there is a shipping tax, but no breakdown.
|
|
|
|
This adds the functionality to the calculator required to map per line
item taxes coming from the TaxJar API to the taxes required for each
line item in an order.
The calculator does not yet support shipping taxes.
|
|
|
|
|
|
Unfortunately bundler (1.x and 2.x) seems to be horrible at resolving
the dependencies here.
I chatted with someone who knows a fair bit more than me about how
bundler's algorithm works, and he suggested that the issue was that it
was having trouble locking down to a specific Rails version.
This allows us to specify the Rails version we want ("~> 5.1.0" does the
trick) which causes bundler to not struggle for 15 minutes to resolve
dependencies anymore.
|
|
|
|
|
|
|
|
|
|
I renamed this class to be less confusing.
|
|
Because I hadn't set up database cleaner, there was some junk in my
local test database that was causing tests to pass.
|
|
|
|
This allows us to calculate the tax for a Solidus order using the TaxJar
API. It's currently hardcoded to use the sandbox, and provides no
caching.
|
|
|
|
This implements the interface required by Solidus, however it currently
just reports no taxes.
|
|
Just load the dummy app environment instead of explicitly requiring
things.
|
|
We don't really need it. Let's keep things simple.
|
|
Also alphabetize things, because who doesn't love the alphabet, you
know?
|
|
Let's leave it open ended, and also require the version of Solidus that
introduced the configurable tax interface that this extension relies on.
|
|
|
|
|
|
|