summaryrefslogtreecommitdiff
path: root/spec/super_good
AgeCommit message (Collapse)Author
2020-02-03Add support for modifying order paramsJared Norman
2020-01-22Avoid raising unnecessary errors with incomplete addressandrea longhi
When validating addresses, it may happen that the address has no country, so trying to fetch the country ISO raises an unnecessary error. Using ruby safe navigation prevents this to happen. Of course, the address will still result invalid eventually.
2020-01-14Add tax rate calculator classandrea longhi
This new calculator allows to retrieve tax rate information starting from a `Spree::Address` model. It shares some logic with the tax calculator, for example the ability to handle exceptions using `SolidusTaxJar.exception_handler` lambda.
2020-01-14Add SolidusTaxJar::API#tax_rate_forandrea longhi
When calculating tax rates, the recommended endpoint from TaxJar support for live calculations is `/v2/taxes`, the same used for calculating order taxes, as it accounts for all factors like sourcing or nexus, while the `/v2/rates` endpoint will return the full combined rate for the queried location.
2020-01-14Add SolidusTaxJar::APIParams.tax_rate_address_paramsandrea longhi
This helper converts a `Spree::Address` to address params that can be used to retrieve the tax rate for that location.
2019-06-25Make cache key a stringJared Norman
2019-05-28Make use of taxable order checkJared Norman
This just uses the taxable order check configuration added in the parent commit to provide a hook to short circuit order tax checks.
2019-05-28Add configuration option for order tax checkJared Norman
This will allow apps to use properties of an order to determine whether an order is taxable.
2019-05-13Sort the rest of the thingsJared Norman
2019-05-13Fix wack indentationJared Norman
1-space?????
2019-05-13Send customer_id to TaxJar APIJared Norman
This is required to support per-customer exemptions through the TaxJar API.
2019-05-13Sort some thingsJared Norman
I like sorted things.
2019-04-24More hacks to handle zero dollar ordersJared Norman
I have a plan for how to handle these better in v1.0 though!
2019-04-24Report no tax collected when order zeroed outJared Norman
2019-04-11Avoid sending negative order totalsJared Norman
If an order is adjusted to zero, we don't want to subtract the tax from it... because that don't make no sense. A better solution that properly factors in order level adjustments will be coming eventually, this is just a hack to process some orders immediately.
2019-04-11Avoid sending 0 quantity line itemsJared Norman
2019-04-11Fix typoJared Norman
2019-03-19Report full line item list for transactionsJared Norman
This sends the full list of line items in the order with their SKUs and tax codes when creating/updating transactions in TaxJar.
2019-03-14Add test that covers behaviour with TaxLocationJared Norman
When an order doesn't have a tax_address, it will rely on the order's store to build a "TaxAddress" for use as the "tax address which in an ideal world would be much more address-like... but unfortunately it's not.
2019-03-14Add guard clause for TaxLocation addressesJuan Carlos Ruiz
From Solidus Documentation: An order's tax_address can – through duck typing – be a Spree::TaxLocation instead of the shipping address. This adds a guard clause that validates if the tax_address is a TaxLocation, in this case we know that the address is incomplete.
2019-03-12Add incomplete_address? check methodJuan Carlos Ruiz
Solidus has deprecated the `empty?` method on https://github.com/solidusio/solidus/pull/1686 . This adds a private `incomplete_address?` method for avoid future problems and remove the deprecation warning in projects that uses this gem.
2019-02-06Provide Spree line items to label makerv0.6.0Jared Norman
2019-02-05Make labels customizable.Jared Norman
2019-02-05Make shipping tax label configurableJared Norman
2019-02-05Add specs for configJared Norman
2019-02-05Introduce configurable taxable address checkv0.5.0Jared Norman
2019-02-05Move exception handler configurationJared Norman
2019-01-31Add ability to create refundsJared Norman
2019-01-30Add missing #'sJared Norman
2019-01-30Add support for deleting order transactionsJared Norman
2019-01-30Add support for updating order transactionsJared Norman
2019-01-30Add ability to create order transactionsJared Norman
2019-01-30Extract address lookup params as wellJared Norman
2019-01-30Integrate APIParams classJared Norman
This removes the logic from the API class and moves all the calls to the order_params method to our new module.
2019-01-30Introduce class to handle param generationJared Norman
This leaves the API class to just be resonsible for calling the right methods on the TaxJar gem.
2019-01-28Add test mode for disabling calculatorJared Norman
2019-01-28Introduce DiscountCalculatorJared Norman
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.
2019-01-23Handle situation where there are no line itemsJared Norman
TaxJar API is not keen on orders with no line items and will throw errors.
2019-01-23Add support for fetching tax rates by locationJared Norman
2019-01-22Use promo total instead of adjustment totalJared Norman
2019-01-21Handle errors gracefullyJared Norman
2019-01-21Cache requests for ten minutesJared Norman
2019-01-20Don't send amountJared Norman
It's not necessary because we're sending line items.
2019-01-20Use correctly value for shipping taxJared Norman
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.
2019-01-20Use more correct test dataJared Norman
2019-01-20Improve tax handlingJared Norman
This is partially a refactor, and also handles the unlikely scenario where there is a shipping tax, but no breakdown.
2019-01-18Support shipping taxesJared Norman
2019-01-10Flesh out Calculator behaviourJared Norman
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.
2019-01-09Rename methodJared Norman
2019-01-09Fix spec issuesJared Norman
Because I hadn't set up database cleaner, there was some junk in my local test database that was causing tests to pass.