Changeset 2571061
- Timestamp:
- 07/23/2021 05:23:57 PM (5 years ago)
- Location:
- taxjar-simplified-taxes-for-woocommerce/trunk
- Files:
-
- 5 edited
-
CHANGELOG.md (modified) (1 diff)
-
includes/TaxCalculation/class-order-tax-applicator.php (modified) (9 diffs)
-
includes/class-wc-taxjar-nexus.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
taxjar-woocommerce.php (modified) (2 diffs)
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 1 4 # 3.2.10 (2021-06-17) 2 5 * Minor transaction sync performance improvement. -
taxjar-simplified-taxes-for-woocommerce/trunk/includes/TaxCalculation/class-order-tax-applicator.php
r2538727 r2571061 12 12 use Automattic\WooCommerce\Utilities\NumberUtil; 13 13 use WC_Tax, WC_Abstract_Order; 14 use \Exception; 14 15 15 16 if ( ! defined( 'ABSPATH' ) ) { … … 49 50 * 50 51 * @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. 51 55 */ 52 56 public function apply_tax( $tax_details ) { 53 57 $this->tax_details = $tax_details; 58 $this->check_tax_details_for_nexus(); 54 59 $this->remove_existing_tax(); 55 60 $this->apply_new_tax(); … … 57 62 58 63 /** 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 /** 59 78 * Remove existing tax on order. 60 79 */ … … 65 84 /** 66 85 * Apply new tax to order. 86 * 87 * @throws Exception If line item tax data not present in details. 67 88 */ 68 89 private function apply_new_tax() { … … 77 98 /** 78 99 * Apply tax to order line items. 100 * 101 * @throws Exception If line item tax data not present in details. 79 102 */ 80 103 private function apply_tax_to_line_items() { … … 89 112 * @param integer $item_key Index of line item. 90 113 * @param WC_Order_Item_Product $item Item to create rate for. 114 * 115 * @throws Exception If line item tax data not present in details. 91 116 */ 92 117 private function create_rate_and_apply_to_product_line_item( $item_key, $item ) { … … 105 130 * @param integer $item_key Array key of line item. 106 131 * @param WC_Order_Item_Product $item Item to create rate for. 132 * 133 * @throws Exception If line item tax data not present in details. 107 134 * 108 135 * @return array … … 143 170 * @param WC_Order_Item_Product $item Item to get tax rate for. 144 171 * 172 * @throws Exception If line item tax data not present in details. 173 * 145 174 * @return float|int 146 175 */ … … 149 178 $line_item_key = $product_id . '-' . $item_key; 150 179 $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 151 185 return 100 * $tax_detail_line_item->get_tax_rate(); 152 186 } -
taxjar-simplified-taxes-for-woocommerce/trunk/includes/class-wc-taxjar-nexus.php
r2502061 r2571061 56 56 57 57 $nexus_areas = $this->get_or_update_cached_nexus(); 58 59 if ( count( $nexus_areas ) == 0 ) {60 $has_nexus = true;61 }62 58 63 59 array_push( -
taxjar-simplified-taxes-for-woocommerce/trunk/readme.txt
r2549968 r2571061 3 3 Tags: woocommerce, taxjar, tax, taxes, sales tax, tax calculation, sales tax compliance, sales tax filing 4 4 Requires at least: 5.3 5 Tested up to: 5. 7.26 Stable tag: 3.2.1 05 Tested up to: 5.8 6 Stable tag: 3.2.11 7 7 License: GPLv2 or later 8 8 URI: http://www.gnu.org/licenses/gpl-2.0.html 9 WC requires at least: 4.9.010 WC tested up to: 5. 4.19 WC requires at least: 5.0.0 10 WC tested up to: 5.5.2 11 11 12 12 Trusted 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. … … 96 96 97 97 == Changelog == 98 99 = 3.2.11 (2021-07-23) 100 * Fix fatal error when no line items present on tax response. 98 101 99 102 = 3.2.10 (2021-06-17) -
taxjar-simplified-taxes-for-woocommerce/trunk/taxjar-woocommerce.php
r2549968 r2571061 4 4 * Plugin URI: https://www.taxjar.com/woocommerce-sales-tax-plugin/ 5 5 * 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.1 06 * Version: 3.2.11 7 7 * Author: TaxJar 8 8 * Author URI: https://www.taxjar.com 9 * WC requires at least: 4.9.010 * WC tested up to: 5. 4.19 * WC requires at least: 5.0.0 10 * WC tested up to: 5.5.2 11 11 * 12 12 * Copyright: © 2014-2019 TaxJar. TaxJar is a trademark of TPS Unlimited, Inc. … … 43 43 final class WC_Taxjar { 44 44 45 static $version = '3.2.1 0';46 public static $minimum_woocommerce_version = ' 4.9.0';45 static $version = '3.2.11'; 46 public static $minimum_woocommerce_version = '5.0.0'; 47 47 48 48 /**
Note: See TracChangeset
for help on using the changeset viewer.