Plugin Directory

Changeset 2571061


Ignore:
Timestamp:
07/23/2021 05:23:57 PM (5 years ago)
Author:
taxjar
Message:

Preparing for 3.2.11 release

Location:
taxjar-simplified-taxes-for-woocommerce/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • taxjar-simplified-taxes-for-woocommerce/trunk/CHANGELOG.md

    r2549968 r2571061  
     1# 3.2.11 (2021-07-23)
     2* Fix fatal error when no line items present on tax response.
     3
    14# 3.2.10 (2021-06-17)
    25* Minor transaction sync performance improvement.
  • taxjar-simplified-taxes-for-woocommerce/trunk/includes/TaxCalculation/class-order-tax-applicator.php

    r2538727 r2571061  
    1212use Automattic\WooCommerce\Utilities\NumberUtil;
    1313use WC_Tax, WC_Abstract_Order;
     14use \Exception;
    1415
    1516if ( ! defined( 'ABSPATH' ) ) {
     
    4950     *
    5051     * @param Tax_Details $tax_details Tax details to apply to order.
     52     *
     53     * @throws Tax_Calculation_Exception If tax detail does not indicate nexus for the transaction.
     54     * @throws Exception If line item tax data not present in details.
    5155     */
    5256    public function apply_tax( $tax_details ) {
    5357        $this->tax_details = $tax_details;
     58        $this->check_tax_details_for_nexus();
    5459        $this->remove_existing_tax();
    5560        $this->apply_new_tax();
     
    5762
    5863    /**
     64     * Check that response from TaxJar API indicates transaction has nexus.
     65     *
     66     * @throws Tax_Calculation_Exception If tax detail does not indicate nexus for the transaction.
     67     */
     68    private function check_tax_details_for_nexus() {
     69        if ( ! $this->tax_details->has_nexus() ) {
     70            throw new Tax_Calculation_Exception(
     71                'no_nexus',
     72                __( 'Tax response for order does not have nexus.', 'taxjar' )
     73            );
     74        }
     75    }
     76
     77    /**
    5978     * Remove existing tax on order.
    6079     */
     
    6584    /**
    6685     * Apply new tax to order.
     86     *
     87     * @throws Exception If line item tax data not present in details.
    6788     */
    6889    private function apply_new_tax() {
     
    7798    /**
    7899     * Apply tax to order line items.
     100     *
     101     * @throws Exception If line item tax data not present in details.
    79102     */
    80103    private function apply_tax_to_line_items() {
     
    89112     * @param integer               $item_key Index of line item.
    90113     * @param WC_Order_Item_Product $item Item to create rate for.
     114     *
     115     * @throws Exception If line item tax data not present in details.
    91116     */
    92117    private function create_rate_and_apply_to_product_line_item( $item_key, $item ) {
     
    105130     * @param integer               $item_key Array key of line item.
    106131     * @param WC_Order_Item_Product $item Item to create rate for.
     132     *
     133     * @throws Exception If line item tax data not present in details.
    107134     *
    108135     * @return array
     
    143170     * @param WC_Order_Item_Product $item Item to get tax rate for.
    144171     *
     172     * @throws Exception If line item tax data not present in details.
     173     *
    145174     * @return float|int
    146175     */
     
    149178        $line_item_key        = $product_id . '-' . $item_key;
    150179        $tax_detail_line_item = $this->tax_details->get_line_item( $line_item_key );
     180
     181        if ( false === $tax_detail_line_item ) {
     182            throw new Exception( 'Line item not present in tax details.' );
     183        }
     184
    151185        return 100 * $tax_detail_line_item->get_tax_rate();
    152186    }
  • taxjar-simplified-taxes-for-woocommerce/trunk/includes/class-wc-taxjar-nexus.php

    r2502061 r2571061  
    5656
    5757        $nexus_areas = $this->get_or_update_cached_nexus();
    58 
    59         if ( count( $nexus_areas ) == 0 ) {
    60             $has_nexus = true;
    61         }
    6258
    6359        array_push(
  • taxjar-simplified-taxes-for-woocommerce/trunk/readme.txt

    r2549968 r2571061  
    33Tags: woocommerce, taxjar, tax, taxes, sales tax, tax calculation, sales tax compliance, sales tax filing
    44Requires at least: 5.3
    5 Tested up to: 5.7.2
    6 Stable tag: 3.2.10
     5Tested up to: 5.8
     6Stable tag: 3.2.11
    77License: GPLv2 or later
    88URI: http://www.gnu.org/licenses/gpl-2.0.html
    9 WC requires at least: 4.9.0
    10 WC tested up to: 5.4.1
     9WC requires at least: 5.0.0
     10WC tested up to: 5.5.2
    1111
    1212Trusted by more than 20,000 businesses, TaxJar’s award-winning solution makes it easy to automate sales tax reporting and filing, and determine economic nexus with a single click.
     
    9696
    9797== Changelog ==
     98
     99= 3.2.11 (2021-07-23)
     100* Fix fatal error when no line items present on tax response.
    98101
    99102= 3.2.10 (2021-06-17)
  • taxjar-simplified-taxes-for-woocommerce/trunk/taxjar-woocommerce.php

    r2549968 r2571061  
    44 * Plugin URI: https://www.taxjar.com/woocommerce-sales-tax-plugin/
    55 * Description: Save hours every month by putting your sales tax on autopilot. Automated, multi-state sales tax calculation, collection, and filing.
    6  * Version: 3.2.10
     6 * Version: 3.2.11
    77 * Author: TaxJar
    88 * Author URI: https://www.taxjar.com
    9  * WC requires at least: 4.9.0
    10  * WC tested up to: 5.4.1
     9 * WC requires at least: 5.0.0
     10 * WC tested up to: 5.5.2
    1111 *
    1212 * Copyright: © 2014-2019 TaxJar. TaxJar is a trademark of TPS Unlimited, Inc.
     
    4343final class WC_Taxjar {
    4444
    45     static $version = '3.2.10';
    46     public static $minimum_woocommerce_version = '4.9.0';
     45    static $version = '3.2.11';
     46    public static $minimum_woocommerce_version = '5.0.0';
    4747
    4848    /**
Note: See TracChangeset for help on using the changeset viewer.