From f1ea3b45138cb8315ee16abc3d7ef6f9ae33b8fa Mon Sep 17 00:00:00 2001
From: Ryan R <44789510+ryanreeves-taxjar@users.noreply.github.com>
Date: Fri, 1 May 2020 15:18:52 -0600
Subject: [PATCH 1/3] Remove "plus_only" flag and uses of /plus endpoint (#124)
* Remove "plus_only" flag and uses of /plus endpoint
Removes the "plus_only" flag from the tj_product_tax_categories table. Also removes the use of the /plus endpoint and references to "plus" in the /verify endpoint.
* Revert changes w/ plus flag and /verify endpoint
---
Block/Adminhtml/AddressValidation.php | 2 +-
Controller/Adminhtml/Config/Connect.php | 2 +-
Observer/ImportCategories.php | 1 -
Setup/UpgradeSchema.php | 15 +++++++++++++++
etc/module.xml | 3 ++-
5 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/Block/Adminhtml/AddressValidation.php b/Block/Adminhtml/AddressValidation.php
index 24025121..5c17de46 100644
--- a/Block/Adminhtml/AddressValidation.php
+++ b/Block/Adminhtml/AddressValidation.php
@@ -86,7 +86,7 @@ protected function _cacheElementValue(AbstractElement $element)
}
/**
- * TaxJar Plus authorization check
+ * TaxJar address validation authorization check
*
* @return bool
*/
diff --git a/Controller/Adminhtml/Config/Connect.php b/Controller/Adminhtml/Config/Connect.php
index 453156af..8b286118 100644
--- a/Controller/Adminhtml/Config/Connect.php
+++ b/Controller/Adminhtml/Config/Connect.php
@@ -119,7 +119,7 @@ public function execute()
}
/**
- * Verify if user is subscribed to Plus
+ * Verify if user has a valid subscription
*
* @param string $apiKey
* @return bool
diff --git a/Observer/ImportCategories.php b/Observer/ImportCategories.php
index 13cdf0a0..d8dd23b3 100644
--- a/Observer/ImportCategories.php
+++ b/Observer/ImportCategories.php
@@ -150,7 +150,6 @@ private function _importCategories()
$category->setProductTaxCode($categoryData['product_tax_code']);
$category->setName($categoryData['name']);
$category->setDescription($categoryData['description']);
- $category->setPlusOnly((strpos($categoryData['description'], '*(PLUS ONLY)*') !== false));
$this->categoryResourceModel->save($category);
}
}
diff --git a/Setup/UpgradeSchema.php b/Setup/UpgradeSchema.php
index 3df4d881..e69dac8b 100644
--- a/Setup/UpgradeSchema.php
+++ b/Setup/UpgradeSchema.php
@@ -135,5 +135,20 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
$installer->endSetup();
}
+
+ if (version_compare($context->getVersion(), '1.0.4', '<')) {
+ $installer = $setup;
+ $installer->startSetup();
+
+ /**
+ * Update table 'tj_product_tax_categories'
+ */
+ $installer->getConnection()->dropColumn(
+ $installer->getTable('tj_product_tax_categories'),
+ 'plus_only'
+ );
+
+ $installer->endSetup();
+ }
}
}
diff --git a/etc/module.xml b/etc/module.xml
index 24efa913..8f94fcbe 100644
--- a/etc/module.xml
+++ b/etc/module.xml
@@ -18,7 +18,7 @@
-->
-
+
@@ -27,3 +27,4 @@
+
From 8f69a3dafa9f0a62a5cab9baa1aa6c25e5cd6e8f Mon Sep 17 00:00:00 2001
From: Ryan R <44789510+ryanreeves-taxjar@users.noreply.github.com>
Date: Fri, 1 May 2020 15:19:06 -0600
Subject: [PATCH 2/3] Update the default customer_id in Smartcalcs (#126)
Change the default customer_id in Smartcalcs from 0 to ''
---
Model/Smartcalcs.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Model/Smartcalcs.php b/Model/Smartcalcs.php
index 209865f9..96e712b9 100644
--- a/Model/Smartcalcs.php
+++ b/Model/Smartcalcs.php
@@ -209,7 +209,7 @@ public function getTaxForOrder(
'shipping' => $shipping - abs($shippingDiscount),
'line_items' => $this->_getLineItems($quote, $quoteTaxDetails),
'nexus_addresses' => $this->_getNexusAddresses($quote->getStoreId()),
- 'customer_id' => $quote->getCustomerId() ? $quote->getCustomerId() : 0,
+ 'customer_id' => $quote->getCustomerId() ? $quote->getCustomerId() : '',
'plugin' => 'magento'
]);
From 769496fbb76aafc3cefd440f49ecd8b7dc30156e Mon Sep 17 00:00:00 2001
From: Ryan Reeves
Date: Fri, 1 May 2020 16:49:26 -0600
Subject: [PATCH 3/3] Version 1.5.0
---
CHANGELOG.md | 7 ++++++-
Model/Configuration.php | 2 +-
composer.json | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fbef8c20..254f432e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
+## [1.5.0] - 2020-05-01
+- Fix a bug where customer_id was passed as 0 instead of an empty string
+- Update product tax categories to remove the plus_only flag
+
## [1.4.10] - 2020-04-16
- Fix transaction sync not respecting website/store scope when backfilling transactions
- Fix the max discount per line item ignoring line item quantities
@@ -171,7 +175,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- **Initial release of our Magento 2 extension.** Sales tax calculations at checkout with backup zip-based rates powered by TaxJar. Supports product exemptions, shipping taxability, sourcing logic, and international calculations in more than 30 countries.
- **Special promo sales tax calculations for Magento merchants.** Existing M2 beta users must upgrade to this version to receive special promo calculations at checkout using our new API endpoint.
-[Unreleased]: https://github.com/taxjar/taxjar-magento2-extension/compare/v1.4.10...HEAD
+[Unreleased]: https://github.com/taxjar/taxjar-magento2-extension/compare/v1.5.0...HEAD
+[1.5.0]: https://github.com/taxjar/taxjar-magento2-extension/compare/v1.4.10...v1.5.0
[1.4.10]: https://github.com/taxjar/taxjar-magento2-extension/compare/v1.4.9...v1.4.10
[1.4.9]: https://github.com/taxjar/taxjar-magento2-extension/compare/v1.4.8...v1.4.9
[1.4.8]: https://github.com/taxjar/taxjar-magento2-extension/compare/v1.4.7...v1.4.8
diff --git a/Model/Configuration.php b/Model/Configuration.php
index e4faa7e7..f2a8eb24 100644
--- a/Model/Configuration.php
+++ b/Model/Configuration.php
@@ -21,7 +21,7 @@
class Configuration
{
- const TAXJAR_VERSION = '1.4.10';
+ const TAXJAR_VERSION = '1.5.0';
const TAXJAR_AUTH_URL = 'https://app.taxjar.com';
const TAXJAR_API_URL = 'https://api.taxjar.com/v2';
const TAXJAR_FEED_URL = 'www.taxjar.com/magento2/feed.xml';
diff --git a/composer.json b/composer.json
index 7768b232..68ebf578 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "taxjar/module-taxjar",
"description": "TaxJar Sales Tax Module for Magento 2",
"type": "magento2-module",
- "version": "1.4.10",
+ "version": "1.5.0",
"license": "OSL-3.0",
"require": {
"magento/framework": "^100.1.0|^101.0.0|^102.0.0"