Version Notes
This release offers the following:
* Multistate tax rates loaded from all addresses in your TaxJar account
* Update API to HTTPS and newest routes
* Configures shipping tax rates for states where shipping is taxable
* Updated display to show which states are loaded
Download this release
Release Info
| Developer | TaxJar |
| Extension | Taxjar_Salestaxautomation |
| Version | 1.1.0 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.1.0
- app/code/community/Taxjar/.DS_Store +0 -0
- app/code/community/Taxjar/SalesTax/.DS_Store +0 -0
- app/code/community/Taxjar/SalesTax/Helper/Data.php +11 -0
- app/code/community/Taxjar/SalesTax/Model/Client.php +46 -0
- app/code/community/Taxjar/SalesTax/Model/Comment.php +85 -0
- app/code/community/Taxjar/{Salestaxautomation → SalesTax}/Model/Configuration.php +105 -30
- app/code/community/Taxjar/SalesTax/Model/Observer.php +175 -0
- app/code/community/Taxjar/SalesTax/Model/Rate.php +49 -0
- app/code/community/Taxjar/SalesTax/Model/Rule.php +35 -0
- app/code/community/Taxjar/SalesTax/etc/adminhtml.xml +23 -0
- app/code/community/Taxjar/SalesTax/etc/config.xml +89 -0
- app/code/community/Taxjar/{Salestaxautomation → SalesTax}/etc/system.xml +13 -12
- app/code/community/Taxjar/Salestaxautomation/Helper/Data.php +0 -4
- app/code/community/Taxjar/Salestaxautomation/Model/Client.php +0 -23
- app/code/community/Taxjar/Salestaxautomation/Model/Comment.php +0 -14
- app/code/community/Taxjar/Salestaxautomation/Model/Observer.php +0 -69
- app/code/community/Taxjar/Salestaxautomation/Model/Rate.php +0 -19
- app/code/community/Taxjar/Salestaxautomation/Model/Rule.php +0 -19
- app/code/community/Taxjar/Salestaxautomation/etc/config.xml +0 -75
- app/etc/modules/Taxjar_Salestaxautomation.xml +0 -9
- package.xml +13 -30
app/code/community/Taxjar/.DS_Store
CHANGED
|
Binary file
|
app/code/community/Taxjar/SalesTax/.DS_Store
ADDED
|
Binary file
|
app/code/community/Taxjar/SalesTax/Helper/Data.php
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* TaxJar helper
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Helper_Data extends Mage_Core_Helper_Abstract
|
| 9 |
+
{
|
| 10 |
+
|
| 11 |
+
}
|
app/code/community/Taxjar/SalesTax/Model/Client.php
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* TaxJar HTTP Client
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Model_Client {
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Connect to the API
|
| 12 |
+
*
|
| 13 |
+
* @param $string, $string
|
| 14 |
+
* @return JSON $string
|
| 15 |
+
*/
|
| 16 |
+
public function getResource( $apiKey, $url ) {
|
| 17 |
+
$response = $this->getClient( $apiKey, $url )->request();
|
| 18 |
+
|
| 19 |
+
if ( $response->isSuccessful() ) {
|
| 20 |
+
$json = $response->getBody();
|
| 21 |
+
|
| 22 |
+
return json_decode($json, true);
|
| 23 |
+
}
|
| 24 |
+
else {
|
| 25 |
+
throw new Exception('Could not connect to TaxJar.');
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* Client GET call
|
| 32 |
+
*
|
| 33 |
+
* @param $string, $string
|
| 34 |
+
* @return Varien_Http_Client $response
|
| 35 |
+
*/
|
| 36 |
+
private function getClient( $apiKey, $url ) {
|
| 37 |
+
$client = new Varien_Http_Client( $url );
|
| 38 |
+
$client->setMethod( Varien_Http_Client::GET );
|
| 39 |
+
$client->setHeaders( 'Authorization', 'Token token="' . $apiKey . '"' );
|
| 40 |
+
|
| 41 |
+
return $client;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
?>
|
app/code/community/Taxjar/SalesTax/Model/Comment.php
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* TaxJar Extension UI
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Model_Comment {
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Display Nexus states loaded and API Key setting
|
| 12 |
+
*
|
| 13 |
+
* @param void
|
| 14 |
+
* @return $string
|
| 15 |
+
*/
|
| 16 |
+
public function getCommentText() {
|
| 17 |
+
$regionId = Mage::getStoreConfig('shipping/origin/region_id');
|
| 18 |
+
$regionCode = Mage::getModel('directory/region')->load( $regionId )->getCode();
|
| 19 |
+
$lastUpdate = Mage::getStoreConfig('taxjar/config/last_update');
|
| 20 |
+
|
| 21 |
+
if( ! empty( $lastUpdate ) ){
|
| 22 |
+
$states = unserialize( Mage::getStoreConfig('taxjar/config/states') );
|
| 23 |
+
$statesHtml = $this->buildStatesHtml( $states, $regionCode );
|
| 24 |
+
return $this->buildInstalledHtml( $statesHtml, $lastUpdate );
|
| 25 |
+
}
|
| 26 |
+
else {
|
| 27 |
+
return $this->buildNotYetInstalledHtml( fullStateName( $regionCode ) );
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* Build String from State Abbr
|
| 34 |
+
*
|
| 35 |
+
* @param $string
|
| 36 |
+
* @return $string
|
| 37 |
+
*/
|
| 38 |
+
private function fullStateName( $stateCode ) {
|
| 39 |
+
$regionModel = Mage::getModel('directory/region')->loadByCode( $stateCode, 'US' );
|
| 40 |
+
return $regionModel->getDefaultName();
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* Build HTML for installed text
|
| 45 |
+
*
|
| 46 |
+
* @param $string, $string
|
| 47 |
+
* @return $string
|
| 48 |
+
*/
|
| 49 |
+
private function buildInstalledHtml( $statesHtml, $lastUpdate ) {
|
| 50 |
+
$htmlString = "<br/><p>TaxJar has <em>automatically</em> added rates for the following states to your Magento installation:<br/><ul class='messages'>". $statesHtml . "</ul>To manage your TaxJar states <a href='https://app.taxjar.com/account#states' target='_blank'>click here</a>.</p><p>Your sales tax rates were last updated on: <ul class='messages'><li class='info-msg'><ul><li><span style='font-size: 1.4em;'>" . $lastUpdate . "</span></li></ul></li></ul></p><p>If you would like to uninstall TaxJar, remove the API Token from the box above, then save the config. This will remove all the rates. You can then uninstall in the Magento Connect Manager.</p>";
|
| 51 |
+
return $htmlString;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Build HTML for not yet installed text
|
| 56 |
+
*
|
| 57 |
+
* @param $string
|
| 58 |
+
* @return $string
|
| 59 |
+
*/
|
| 60 |
+
private function buildNotYetInstalledHtml( $regionName ) {
|
| 61 |
+
$htmlString = "<br/><p>Enter your TaxJar API Token to import current sales tax rates for all zip codes in " . $regionName . ", your state of origin as set in Shipping Settings. We will also retrieve all other states from your TaxJar account. To get an API Token, go to <a href='https://app.taxjar.com/account' target='_blank'>TaxJar's Account Screen.</a></p><p>For more information on how your tax settings are changed, <a href='http://taxjar.com/magento/tax-settings' target='_blank'>click here</a>.</p>";
|
| 62 |
+
return $htmlString;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
/**
|
| 66 |
+
* Build HTML list of states
|
| 67 |
+
*
|
| 68 |
+
* @param $string, $string
|
| 69 |
+
* @return $string
|
| 70 |
+
*/
|
| 71 |
+
private function buildStatesHtml( $states, $regionCode ) {
|
| 72 |
+
$states[] = $regionCode;
|
| 73 |
+
sort( $states );
|
| 74 |
+
|
| 75 |
+
foreach ( array_unique( $states ) as $state ) {
|
| 76 |
+
if ( ( $stateName = $this->fullStateName( $state ) ) && ! empty( $stateName ) ){
|
| 77 |
+
$statesHtml .= '<li class="success-msg"><ul><li><span style="font-size: 1.4em;">' . $stateName . '</span></li></ul></li>';
|
| 78 |
+
}
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
return $statesHtml;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
}
|
| 85 |
+
?>
|
app/code/community/Taxjar/{Salestaxautomation → SalesTax}/Model/Configuration.php
RENAMED
|
@@ -1,23 +1,50 @@
|
|
| 1 |
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Model_Configuration {
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
$taxClass = 0;
|
| 7 |
-
|
|
|
|
| 8 |
$taxClass = 4;
|
| 9 |
}
|
| 10 |
-
|
|
|
|
| 11 |
}
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
$basis = 'shipping';
|
| 15 |
-
|
|
|
|
| 16 |
$basis = 'origin';
|
| 17 |
}
|
| 18 |
-
|
|
|
|
| 19 |
}
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
public function setDisplaySettings() {
|
| 22 |
$settings = array(
|
| 23 |
'tax/display/type',
|
|
@@ -26,23 +53,40 @@ class Taxjar_Salestaxautomation_Model_Configuration {
|
|
| 26 |
'tax/cart_display/subtotal',
|
| 27 |
'tax/cart_display/shipping'
|
| 28 |
);
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 31 |
}
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
$existingUserId = $apiUser->load('taxjar', 'username')->getUserId();
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
$
|
| 40 |
-
$this->
|
|
|
|
| 41 |
}
|
|
|
|
| 42 |
}
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
$apiRule = Mage::getModel('api/rules');
|
| 47 |
$apiRule->setRoleId($parentRoleId);
|
| 48 |
$apiRule->setResourceId($resource);
|
|
@@ -51,17 +95,24 @@ class Taxjar_Salestaxautomation_Model_Configuration {
|
|
| 51 |
$apiRule->save();
|
| 52 |
}
|
| 53 |
|
| 54 |
-
foreach($this->
|
| 55 |
$apiRule = Mage::getModel('api/rules');
|
| 56 |
$apiRule->setRoleId($parentRoleId);
|
| 57 |
$apiRule->setResourceId($resource);
|
| 58 |
$apiRule->setRoleType('G');
|
| 59 |
$apiRule->setApiPermission('deny');
|
| 60 |
$apiRule->save();
|
| 61 |
-
}
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
$parentApiRole = Mage::getModel('api/role');
|
| 66 |
$parentApiRole->setRoleName('taxjar_api');
|
| 67 |
$parentApiRole->setTreeLevel(1);
|
|
@@ -70,33 +121,53 @@ class Taxjar_Salestaxautomation_Model_Configuration {
|
|
| 70 |
$parentRoleId = $parentApiRole->getId();
|
| 71 |
|
| 72 |
$childApiRole = Mage::getModel('api/role');
|
| 73 |
-
$childApiRole->setRoleName('
|
| 74 |
$childApiRole->setTreeLevel(1);
|
| 75 |
$childApiRole->setParentId($parentRoleId);
|
| 76 |
$childApiRole->setRoleType('U');
|
| 77 |
$childApiRole->setUserId($apiUserId);
|
| 78 |
$childApiRole->save();
|
|
|
|
| 79 |
return $parentRoleId;
|
| 80 |
}
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
$apiUser = Mage::getModel('api/user');
|
| 84 |
$apiUser->setUsername('taxjar');
|
| 85 |
-
$apiUser->setFirstname('
|
| 86 |
-
$apiUser->setLastname('
|
| 87 |
-
$apiUser->setEmail('
|
| 88 |
$apiUser->setApiKey($apiKey);
|
| 89 |
$apiUser->setIsActive(1);
|
| 90 |
$apiUser->save();
|
|
|
|
| 91 |
return $apiUser->getUserId();
|
| 92 |
}
|
| 93 |
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
$config = new Mage_Core_Model_Config();
|
| 96 |
$config->saveConfig($path, $value, 'default', 0);
|
| 97 |
}
|
| 98 |
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
return array(
|
| 101 |
'sales',
|
| 102 |
'sales/order',
|
|
@@ -124,7 +195,13 @@ class Taxjar_Salestaxautomation_Model_Configuration {
|
|
| 124 |
);
|
| 125 |
}
|
| 126 |
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
return array(
|
| 129 |
'core',
|
| 130 |
'core/store',
|
|
@@ -250,7 +327,5 @@ class Taxjar_Salestaxautomation_Model_Configuration {
|
|
| 250 |
);
|
| 251 |
}
|
| 252 |
|
| 253 |
-
|
| 254 |
-
|
| 255 |
}
|
| 256 |
?>
|
| 1 |
<?php
|
|
|
|
| 2 |
|
| 3 |
+
/**
|
| 4 |
+
* TaxJar configuration setter
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Model_Configuration {
|
| 9 |
|
| 10 |
+
/**
|
| 11 |
+
* Sets shipping taxability in Magento
|
| 12 |
+
*
|
| 13 |
+
* @param JSON $string
|
| 14 |
+
* @return void
|
| 15 |
+
*/
|
| 16 |
+
public function setShippingTaxability( $configJson ) {
|
| 17 |
$taxClass = 0;
|
| 18 |
+
|
| 19 |
+
if( $configJson['freight_taxable'] ) {
|
| 20 |
$taxClass = 4;
|
| 21 |
}
|
| 22 |
+
|
| 23 |
+
$this->setConfig('tax/classes/shipping_tax_class', $taxClass);
|
| 24 |
}
|
| 25 |
|
| 26 |
+
/**
|
| 27 |
+
* Sets tax basis in Magento
|
| 28 |
+
*
|
| 29 |
+
* @param JSON $string
|
| 30 |
+
* @return void
|
| 31 |
+
*/
|
| 32 |
+
public function setTaxBasis( $configJson ) {
|
| 33 |
$basis = 'shipping';
|
| 34 |
+
|
| 35 |
+
if( $configJson['tax_source'] === 'origin' ) {
|
| 36 |
$basis = 'origin';
|
| 37 |
}
|
| 38 |
+
|
| 39 |
+
$this->setConfig('tax/calculation/based_on', $basis);
|
| 40 |
}
|
| 41 |
|
| 42 |
+
/**
|
| 43 |
+
* Set display settings for tax in Magento
|
| 44 |
+
*
|
| 45 |
+
* @param void
|
| 46 |
+
* @return void
|
| 47 |
+
*/
|
| 48 |
public function setDisplaySettings() {
|
| 49 |
$settings = array(
|
| 50 |
'tax/display/type',
|
| 53 |
'tax/cart_display/subtotal',
|
| 54 |
'tax/cart_display/shipping'
|
| 55 |
);
|
| 56 |
+
|
| 57 |
+
foreach( $settings as $setting ) {
|
| 58 |
+
$this->setConfig($setting, 1);
|
| 59 |
}
|
| 60 |
+
|
| 61 |
}
|
| 62 |
|
| 63 |
+
/**
|
| 64 |
+
* Setup the TaxJar API user
|
| 65 |
+
*
|
| 66 |
+
* @param $string
|
| 67 |
+
* @return void
|
| 68 |
+
*/
|
| 69 |
+
public function setApiSettings( $apiKey ) {
|
| 70 |
+
$apiUser = Mage::getModel('api/user');
|
| 71 |
$existingUserId = $apiUser->load('taxjar', 'username')->getUserId();
|
| 72 |
+
|
| 73 |
+
if( !$existingUserId ) {
|
| 74 |
+
$apiUserId = $this->createApiUser($apiKey);
|
| 75 |
+
$parentRoleId = $this->createApiRoles($apiUserId);
|
| 76 |
+
$this->createApiRules($parentRoleId);
|
| 77 |
}
|
| 78 |
+
|
| 79 |
}
|
| 80 |
|
| 81 |
+
/**
|
| 82 |
+
* Set the API resources for our API user
|
| 83 |
+
*
|
| 84 |
+
* @param void
|
| 85 |
+
* @return void
|
| 86 |
+
*/
|
| 87 |
+
private function createApiRules( $parentRoleId ) {
|
| 88 |
+
|
| 89 |
+
foreach( $this->resourcesToAllow() as $resource ) {
|
| 90 |
$apiRule = Mage::getModel('api/rules');
|
| 91 |
$apiRule->setRoleId($parentRoleId);
|
| 92 |
$apiRule->setResourceId($resource);
|
| 95 |
$apiRule->save();
|
| 96 |
}
|
| 97 |
|
| 98 |
+
foreach( $this->resourcesToDeny() as $resource ) {
|
| 99 |
$apiRule = Mage::getModel('api/rules');
|
| 100 |
$apiRule->setRoleId($parentRoleId);
|
| 101 |
$apiRule->setResourceId($resource);
|
| 102 |
$apiRule->setRoleType('G');
|
| 103 |
$apiRule->setApiPermission('deny');
|
| 104 |
$apiRule->save();
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
}
|
| 108 |
|
| 109 |
+
/**
|
| 110 |
+
* Set the roles for our API User
|
| 111 |
+
*
|
| 112 |
+
* @param $integer
|
| 113 |
+
* @return $integer
|
| 114 |
+
*/
|
| 115 |
+
private function createApiRoles( $apiUserId ) {
|
| 116 |
$parentApiRole = Mage::getModel('api/role');
|
| 117 |
$parentApiRole->setRoleName('taxjar_api');
|
| 118 |
$parentApiRole->setTreeLevel(1);
|
| 121 |
$parentRoleId = $parentApiRole->getId();
|
| 122 |
|
| 123 |
$childApiRole = Mage::getModel('api/role');
|
| 124 |
+
$childApiRole->setRoleName('TaxJar');
|
| 125 |
$childApiRole->setTreeLevel(1);
|
| 126 |
$childApiRole->setParentId($parentRoleId);
|
| 127 |
$childApiRole->setRoleType('U');
|
| 128 |
$childApiRole->setUserId($apiUserId);
|
| 129 |
$childApiRole->save();
|
| 130 |
+
|
| 131 |
return $parentRoleId;
|
| 132 |
}
|
| 133 |
|
| 134 |
+
/**
|
| 135 |
+
* Set the API resources for our API user
|
| 136 |
+
*
|
| 137 |
+
* @param void
|
| 138 |
+
* @return void
|
| 139 |
+
*/
|
| 140 |
+
private function createApiUser( $apiKey ) {
|
| 141 |
$apiUser = Mage::getModel('api/user');
|
| 142 |
$apiUser->setUsername('taxjar');
|
| 143 |
+
$apiUser->setFirstname('TaxJar');
|
| 144 |
+
$apiUser->setLastname('Magento');
|
| 145 |
+
$apiUser->setEmail('support@taxjar.com');
|
| 146 |
$apiUser->setApiKey($apiKey);
|
| 147 |
$apiUser->setIsActive(1);
|
| 148 |
$apiUser->save();
|
| 149 |
+
|
| 150 |
return $apiUser->getUserId();
|
| 151 |
}
|
| 152 |
|
| 153 |
+
/**
|
| 154 |
+
* Store config
|
| 155 |
+
*
|
| 156 |
+
* @param $string, $mixed
|
| 157 |
+
* @return void
|
| 158 |
+
*/
|
| 159 |
+
private function setConfig( $path, $value ) {
|
| 160 |
$config = new Mage_Core_Model_Config();
|
| 161 |
$config->saveConfig($path, $value, 'default', 0);
|
| 162 |
}
|
| 163 |
|
| 164 |
+
/**
|
| 165 |
+
* resources to allow for our API user
|
| 166 |
+
*
|
| 167 |
+
* @param void
|
| 168 |
+
* @return $array
|
| 169 |
+
*/
|
| 170 |
+
private function resourcesToAllow() {
|
| 171 |
return array(
|
| 172 |
'sales',
|
| 173 |
'sales/order',
|
| 195 |
);
|
| 196 |
}
|
| 197 |
|
| 198 |
+
/**
|
| 199 |
+
* resources to deny for our API user
|
| 200 |
+
*
|
| 201 |
+
* @param void
|
| 202 |
+
* @return $array
|
| 203 |
+
*/
|
| 204 |
+
private function resourcesToDeny() {
|
| 205 |
return array(
|
| 206 |
'core',
|
| 207 |
'core/store',
|
| 327 |
);
|
| 328 |
}
|
| 329 |
|
|
|
|
|
|
|
| 330 |
}
|
| 331 |
?>
|
app/code/community/Taxjar/SalesTax/Model/Observer.php
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* TaxJar Observer.
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Model_Observer {
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* TaxJar observer
|
| 12 |
+
*
|
| 13 |
+
* @param Varien_Event_Observer $observer
|
| 14 |
+
* @return void
|
| 15 |
+
*/
|
| 16 |
+
public function execute( $observer ) {
|
| 17 |
+
$session = Mage::getSingleton( 'adminhtml/session' );
|
| 18 |
+
$storeId = Mage::getModel('core/store')->load( $observer->getEvent()->getStore() )->getStoreId();
|
| 19 |
+
$apiKey = Mage::getStoreConfig('taxjar/config/apikey', $storeId);
|
| 20 |
+
$apiKey = preg_replace( '/\s+/', '', $apiKey );
|
| 21 |
+
|
| 22 |
+
if ( $apiKey ) {
|
| 23 |
+
$this->version = 'v1';
|
| 24 |
+
$client = Mage::getModel('taxjar/client');
|
| 25 |
+
$configuration = Mage::getModel('taxjar/configuration');
|
| 26 |
+
$regionId = Mage::getStoreConfig('shipping/origin/region_id', $storeId);
|
| 27 |
+
$this->storeZip = Mage::getStoreConfig('shipping/origin/postcode', $storeId);
|
| 28 |
+
$this->regionCode = Mage::getModel('directory/region')->load( $regionId )->getCode();
|
| 29 |
+
$validZip = preg_match( "/(\d{5}-\d{4})|(\d{5})/", $this->storeZip );
|
| 30 |
+
|
| 31 |
+
if( isset( $this->regionCode ) ) {
|
| 32 |
+
$configJson = $client->getResource( $apiKey, $this->apiUrl( 'config' ) );
|
| 33 |
+
}
|
| 34 |
+
else {
|
| 35 |
+
throw new Exception( "Please check that you have set a Region/State in Shipping Settings." );
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
if( ! $configJson['allow_update'] ) {
|
| 39 |
+
return;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
if( $validZip === 1 && isset( $this->storeZip ) && trim( $this->storeZip ) !== '' ) {
|
| 43 |
+
$ratesJson = $client->getResource( $apiKey, $this->apiUrl( 'rates' ));
|
| 44 |
+
}
|
| 45 |
+
else {
|
| 46 |
+
throw new Exception("Please check that your zip code is a valid US zip code in Shipping Settings.");
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
Mage::getModel('core/config')
|
| 50 |
+
->saveConfig('taxjar/config/states', serialize( explode( ',', $configJson['states'] ) ));
|
| 51 |
+
$configuration->setTaxBasis($configJson);
|
| 52 |
+
$configuration->setShippingTaxability($configJson);
|
| 53 |
+
$configuration->setDisplaySettings();
|
| 54 |
+
$configuration->setApiSettings($apiKey);
|
| 55 |
+
Mage::getModel('core/config')
|
| 56 |
+
->saveConfig( 'taxjar/config/freight_taxable', $configJson['freight_taxable'] );
|
| 57 |
+
$this->purgeExisting();
|
| 58 |
+
|
| 59 |
+
if ( false !== file_put_contents( $this->getTempFileName(), serialize( $ratesJson ) ) ) {
|
| 60 |
+
Mage::dispatchEvent('taxjar_salestax_import_rates');
|
| 61 |
+
}
|
| 62 |
+
else {
|
| 63 |
+
// We need to be able to store the file...
|
| 64 |
+
throw new Exception("Could not write to your Magento temp directory. Please check permissions for " . Mage::getBaseDir('tmp') . ".");
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
}
|
| 68 |
+
else {
|
| 69 |
+
$this->purgeExisting();
|
| 70 |
+
$this->setLastUpdateDate(NULL);
|
| 71 |
+
}
|
| 72 |
+
// Clearing the cache to avoid UI elements not loading
|
| 73 |
+
Mage::app()->getCacheInstance()->flush();
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Read our file and import all the rates, triggered via taxjar_salestax_import_rates
|
| 78 |
+
*
|
| 79 |
+
* @param void
|
| 80 |
+
* @return void
|
| 81 |
+
*/
|
| 82 |
+
public function importRates() {
|
| 83 |
+
// This process can take a while
|
| 84 |
+
@set_time_limit( 0 );
|
| 85 |
+
@ignore_user_abort( true );
|
| 86 |
+
|
| 87 |
+
$this->newRates = array();
|
| 88 |
+
$this->freightTaxableRates = array();
|
| 89 |
+
$rate = Mage::getModel('taxjar/rate');
|
| 90 |
+
$filename = $this->getTempFileName();
|
| 91 |
+
$rule = Mage::getModel('taxjar/rule');
|
| 92 |
+
$shippingTaxable = Mage::getStoreConfig('taxjar/config/freight_taxable');
|
| 93 |
+
$ratesJson = unserialize( file_get_contents( $filename ) );
|
| 94 |
+
|
| 95 |
+
foreach( $ratesJson as $rateJson ) {
|
| 96 |
+
$rateIdWithShippingId = $rate->create( $rateJson );
|
| 97 |
+
|
| 98 |
+
if ( $rateIdWithShippingId[1] ) {
|
| 99 |
+
$this->freightTaxableRates[] = $rateIdWithShippingId[1];
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
$this->newRates[] = $rateIdWithShippingId[0];
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
$this->setLastUpdateDate( date( 'm-d-Y' ) );
|
| 106 |
+
$rule->create( 'Retail Customer-Taxable Goods-Rate 1', 2, 1, $this->newRates );
|
| 107 |
+
|
| 108 |
+
if ( $shippingTaxable ) {
|
| 109 |
+
$rule->create( 'Retail Customer-Shipping-Rate 1', 4, 2, $this->freightTaxableRates );
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
@unlink( $filename );
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
/**
|
| 116 |
+
* Build URL string
|
| 117 |
+
*
|
| 118 |
+
* @param $string
|
| 119 |
+
* @return $string
|
| 120 |
+
*/
|
| 121 |
+
private function apiUrl( $type ) {
|
| 122 |
+
$apiHost = 'https://api.taxjar.com/';
|
| 123 |
+
$prefix = $apiHost . 'magento/' . $this->version . '/';
|
| 124 |
+
|
| 125 |
+
if ( $type == 'config' ) {
|
| 126 |
+
return $prefix . 'get_configuration/' . $this->regionCode;
|
| 127 |
+
}
|
| 128 |
+
elseif ( $type == 'rates' ) {
|
| 129 |
+
return $prefix . 'get_rates/' . $this->regionCode . '/' . $this->storeZip;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* Purges the rates and rules
|
| 136 |
+
*
|
| 137 |
+
* @param void
|
| 138 |
+
* @return void
|
| 139 |
+
*/
|
| 140 |
+
private function purgeExisting() {
|
| 141 |
+
$paths = array('tax/calculation', 'tax/calculation_rate', 'tax/calculation_rule');
|
| 142 |
+
|
| 143 |
+
foreach( $paths as $path ) {
|
| 144 |
+
$existingRecords = Mage::getModel($path)->getCollection();
|
| 145 |
+
|
| 146 |
+
foreach( $existingRecords as $record ) {
|
| 147 |
+
$record->delete();
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
/**
|
| 155 |
+
* Set the last updated date
|
| 156 |
+
*
|
| 157 |
+
* @param $string || NULL
|
| 158 |
+
* @return void
|
| 159 |
+
*/
|
| 160 |
+
private function setLastUpdateDate( $date ) {
|
| 161 |
+
Mage::getModel('core/config')->saveConfig('taxjar/config/last_update', $date);
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
/**
|
| 165 |
+
* Set the filename
|
| 166 |
+
*
|
| 167 |
+
* @param void
|
| 168 |
+
* @return $string
|
| 169 |
+
*/
|
| 170 |
+
private function getTempFileName() {
|
| 171 |
+
return Mage::getBaseDir('tmp') . DS . "tj_tmp.dat";
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
}
|
| 175 |
+
?>
|
app/code/community/Taxjar/SalesTax/Model/Rate.php
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Create and parse rates from JSON obj
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Model_Rate {
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Display Nexus states loaded and API Key setting
|
| 12 |
+
*
|
| 13 |
+
* @param JSON $string
|
| 14 |
+
* @return array
|
| 15 |
+
*/
|
| 16 |
+
public function create( $rateJson ) {
|
| 17 |
+
$zip = $rateJson['zip'];
|
| 18 |
+
$regionCode = $rateJson['state'];
|
| 19 |
+
$rate = $rateJson['rate'];
|
| 20 |
+
|
| 21 |
+
if ( isset( $rateJson['country'] ) ) {
|
| 22 |
+
$countryCode = $rateJson['country'];
|
| 23 |
+
}
|
| 24 |
+
else {
|
| 25 |
+
$countryCode = 'US';
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
$regionId = Mage::getModel('directory/region')->loadByCode($regionCode, $countryCode)->getId();
|
| 29 |
+
$rateModel = Mage::getModel('tax/calculation_rate');
|
| 30 |
+
|
| 31 |
+
$rateModel->setTaxCountryId($countryCode);
|
| 32 |
+
$rateModel->setTaxRegionId($regionId);
|
| 33 |
+
$rateModel->setTaxPostcode($zip);
|
| 34 |
+
$rateModel->setCode($countryCode . '-' . $regionCode . '-' . $zip);
|
| 35 |
+
$rateModel->setRate($rate);
|
| 36 |
+
$rateModel->save();
|
| 37 |
+
|
| 38 |
+
if ( $rateJson['freight_taxable'] ) {
|
| 39 |
+
$shippingRateId = $rateModel->getId();
|
| 40 |
+
}
|
| 41 |
+
else {
|
| 42 |
+
$shippingRateId = 0;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
return array( $rateModel->getId(), $shippingRateId );
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
}
|
| 49 |
+
?>
|
app/code/community/Taxjar/SalesTax/Model/Rule.php
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* Create tax rules
|
| 5 |
+
*
|
| 6 |
+
* @author Taxjar (support@taxjar.com)
|
| 7 |
+
*/
|
| 8 |
+
class Taxjar_SalesTax_Model_Rule {
|
| 9 |
+
|
| 10 |
+
/**
|
| 11 |
+
* Display Nexus states loaded and API Key setting
|
| 12 |
+
*
|
| 13 |
+
* @param $string, $integer, $integer, $array
|
| 14 |
+
* @return void
|
| 15 |
+
*/
|
| 16 |
+
public function create( $code, $productClass, $position, $newRates ) {
|
| 17 |
+
$ruleModel = Mage::getSingleton('tax/calculation_rule');
|
| 18 |
+
|
| 19 |
+
$attributes = array(
|
| 20 |
+
'code' => $code,
|
| 21 |
+
'tax_customer_class' => array( 3 ),
|
| 22 |
+
'tax_product_class' => array( $productClass ),
|
| 23 |
+
'tax_rate' => $newRates,
|
| 24 |
+
'priority' => 1,
|
| 25 |
+
'position' => $position
|
| 26 |
+
);
|
| 27 |
+
|
| 28 |
+
$ruleModel->setData( $attributes );
|
| 29 |
+
$ruleModel->setCalculateSubtotal( 0 );
|
| 30 |
+
$ruleModel->save();
|
| 31 |
+
$ruleModel->saveCalculationData();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
}
|
| 35 |
+
?>
|
app/code/community/Taxjar/SalesTax/etc/adminhtml.xml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" ?>
|
| 2 |
+
<config>
|
| 3 |
+
<!-- repeated in config.xml for compatibility -->
|
| 4 |
+
<acl>
|
| 5 |
+
<resources>
|
| 6 |
+
<admin>
|
| 7 |
+
<children>
|
| 8 |
+
<system>
|
| 9 |
+
<children>
|
| 10 |
+
<config>
|
| 11 |
+
<children>
|
| 12 |
+
<taxjar>
|
| 13 |
+
<title>TaxJar Sales Tax Automation</title>
|
| 14 |
+
</taxjar>
|
| 15 |
+
</children>
|
| 16 |
+
</config>
|
| 17 |
+
</children>
|
| 18 |
+
</system>
|
| 19 |
+
</children>
|
| 20 |
+
</admin>
|
| 21 |
+
</resources>
|
| 22 |
+
</acl>
|
| 23 |
+
</config>
|
app/code/community/Taxjar/SalesTax/etc/config.xml
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* Taxjar_SalesTax
|
| 5 |
+
* www.taxjar.com
|
| 6 |
+
-->
|
| 7 |
+
<config>
|
| 8 |
+
<modules>
|
| 9 |
+
<Taxjar_SalesTax><version>0.2.0</version></Taxjar_SalesTax>
|
| 10 |
+
</modules>
|
| 11 |
+
<global>
|
| 12 |
+
<helpers>
|
| 13 |
+
<taxjar>
|
| 14 |
+
<class>Taxjar_SalesTax_Helper</class>
|
| 15 |
+
</taxjar>
|
| 16 |
+
</helpers>
|
| 17 |
+
<models>
|
| 18 |
+
<taxjar>
|
| 19 |
+
<class>Taxjar_SalesTax_Model</class>
|
| 20 |
+
</taxjar>
|
| 21 |
+
</models>
|
| 22 |
+
<blocks>
|
| 23 |
+
<taxjar>
|
| 24 |
+
<class>Taxjar_SalesTax_Block</class>
|
| 25 |
+
</taxjar>
|
| 26 |
+
</blocks>
|
| 27 |
+
<events>
|
| 28 |
+
<admin_system_config_changed_section_taxjar>
|
| 29 |
+
<observers>
|
| 30 |
+
<taxjar_salestax_model_observer>
|
| 31 |
+
<type>singleton</type>
|
| 32 |
+
<class>taxjar/observer</class>
|
| 33 |
+
<method>execute</method>
|
| 34 |
+
</taxjar_salestax_model_observer>
|
| 35 |
+
</observers>
|
| 36 |
+
</admin_system_config_changed_section_taxjar>
|
| 37 |
+
<taxjar_salestax_import_rates>
|
| 38 |
+
<observers>
|
| 39 |
+
<taxjar_salestax_model_observer>
|
| 40 |
+
<type>singleton</type>
|
| 41 |
+
<class>taxjar/observer</class>
|
| 42 |
+
<method>importRates</method>
|
| 43 |
+
</taxjar_salestax_model_observer>
|
| 44 |
+
</observers>
|
| 45 |
+
</taxjar_salestax_import_rates>
|
| 46 |
+
</events>
|
| 47 |
+
</global>
|
| 48 |
+
<frontend>
|
| 49 |
+
<routers>
|
| 50 |
+
<taxjar>
|
| 51 |
+
<use>standard</use>
|
| 52 |
+
<args>
|
| 53 |
+
<module>Taxjar_SalesTax</module>
|
| 54 |
+
<frontName>taxjar</frontName>
|
| 55 |
+
</args>
|
| 56 |
+
</taxjar>
|
| 57 |
+
</routers>
|
| 58 |
+
</frontend>
|
| 59 |
+
<adminhtml>
|
| 60 |
+
<acl>
|
| 61 |
+
<resources>
|
| 62 |
+
<admin>
|
| 63 |
+
<children>
|
| 64 |
+
<system>
|
| 65 |
+
<children>
|
| 66 |
+
<config>
|
| 67 |
+
<children>
|
| 68 |
+
<taxjar>
|
| 69 |
+
<title>TaxJar Sales Tax Automation</title>
|
| 70 |
+
</taxjar>
|
| 71 |
+
</children>
|
| 72 |
+
</config>
|
| 73 |
+
</children>
|
| 74 |
+
</system>
|
| 75 |
+
</children>
|
| 76 |
+
</admin>
|
| 77 |
+
</resources>
|
| 78 |
+
</acl>
|
| 79 |
+
</adminhtml>
|
| 80 |
+
<crontab>
|
| 81 |
+
<jobs>
|
| 82 |
+
<taxjar>
|
| 83 |
+
<schedule><cron_expr>0 8 1 * *</cron_expr></schedule>
|
| 84 |
+
<run><model>taxjar/observer::execute</model></run>
|
| 85 |
+
</taxjar>
|
| 86 |
+
</jobs>
|
| 87 |
+
</crontab>
|
| 88 |
+
|
| 89 |
+
</config>
|
app/code/community/Taxjar/{Salestaxautomation → SalesTax}/etc/system.xml
RENAMED
|
@@ -1,43 +1,44 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
<tabs>
|
| 4 |
-
<
|
| 5 |
<label>TaxJar</label>
|
| 6 |
-
<sort_order>
|
| 7 |
-
</
|
| 8 |
</tabs>
|
| 9 |
<sections>
|
| 10 |
-
<
|
| 11 |
<label>Sales Tax Automation</label>
|
| 12 |
-
<tab>
|
| 13 |
<frontend_type>text</frontend_type>
|
| 14 |
<sort_order>1000</sort_order>
|
| 15 |
<show_in_default>1</show_in_default>
|
| 16 |
<show_in_website>1</show_in_website>
|
| 17 |
-
<show_in_store>1</show_in_store>
|
| 18 |
<groups>
|
| 19 |
<config translate="label">
|
| 20 |
-
<label>
|
| 21 |
<frontend_type>text</frontend_type>
|
| 22 |
<sort_order>1</sort_order>
|
| 23 |
<show_in_default>1</show_in_default>
|
| 24 |
<show_in_website>1</show_in_website>
|
| 25 |
-
<show_in_store>1</show_in_store>
|
|
|
|
| 26 |
<fields>
|
| 27 |
-
<
|
| 28 |
<label>API Token</label>
|
| 29 |
<comment>
|
| 30 |
-
<model>
|
| 31 |
</comment>
|
| 32 |
<frontend_type>text</frontend_type>
|
| 33 |
<sort_order>1</sort_order>
|
| 34 |
<show_in_default>1</show_in_default>
|
| 35 |
<show_in_website>1</show_in_website>
|
| 36 |
<show_in_store>1</show_in_store>
|
| 37 |
-
</
|
| 38 |
</fields>
|
| 39 |
</config>
|
| 40 |
</groups>
|
| 41 |
-
</
|
| 42 |
</sections>
|
| 43 |
</config>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<config>
|
| 3 |
<tabs>
|
| 4 |
+
<taxjar translate="label" module="taxjar">
|
| 5 |
<label>TaxJar</label>
|
| 6 |
+
<sort_order>0</sort_order>
|
| 7 |
+
</taxjar>
|
| 8 |
</tabs>
|
| 9 |
<sections>
|
| 10 |
+
<taxjar translate="label" module="taxjar">
|
| 11 |
<label>Sales Tax Automation</label>
|
| 12 |
+
<tab>taxjar</tab>
|
| 13 |
<frontend_type>text</frontend_type>
|
| 14 |
<sort_order>1000</sort_order>
|
| 15 |
<show_in_default>1</show_in_default>
|
| 16 |
<show_in_website>1</show_in_website>
|
| 17 |
+
<show_in_store>1</show_in_store>
|
| 18 |
<groups>
|
| 19 |
<config translate="label">
|
| 20 |
+
<label>TaxJar Options</label>
|
| 21 |
<frontend_type>text</frontend_type>
|
| 22 |
<sort_order>1</sort_order>
|
| 23 |
<show_in_default>1</show_in_default>
|
| 24 |
<show_in_website>1</show_in_website>
|
| 25 |
+
<show_in_store>1</show_in_store>
|
| 26 |
+
<expanded>1</expanded>
|
| 27 |
<fields>
|
| 28 |
+
<apikey translate="label">
|
| 29 |
<label>API Token</label>
|
| 30 |
<comment>
|
| 31 |
+
<model>taxjar/comment</model>
|
| 32 |
</comment>
|
| 33 |
<frontend_type>text</frontend_type>
|
| 34 |
<sort_order>1</sort_order>
|
| 35 |
<show_in_default>1</show_in_default>
|
| 36 |
<show_in_website>1</show_in_website>
|
| 37 |
<show_in_store>1</show_in_store>
|
| 38 |
+
</apikey>
|
| 39 |
</fields>
|
| 40 |
</config>
|
| 41 |
</groups>
|
| 42 |
+
</taxjar>
|
| 43 |
</sections>
|
| 44 |
</config>
|
app/code/community/Taxjar/Salestaxautomation/Helper/Data.php
DELETED
|
@@ -1,4 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
-
{
|
| 4 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Taxjar/Salestaxautomation/Model/Client.php
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Model_Client {
|
| 3 |
-
|
| 4 |
-
public function getResource($apiKey, $url) {
|
| 5 |
-
$response = $this->_getClient($apiKey, $url)->request();
|
| 6 |
-
if ($response->isSuccessful()) {
|
| 7 |
-
$json = $response->getBody();
|
| 8 |
-
return json_decode($json, true);
|
| 9 |
-
} else {
|
| 10 |
-
throw new Exception('Could not connect to TaxJar.');
|
| 11 |
-
}
|
| 12 |
-
}
|
| 13 |
-
|
| 14 |
-
private function _getClient($apiKey, $url) {
|
| 15 |
-
$client = new Varien_Http_Client($url);
|
| 16 |
-
$client->setMethod(Varien_Http_Client::GET);
|
| 17 |
-
$client->setHeaders('Authorization', 'Token token="' . $apiKey . '"');
|
| 18 |
-
return $client;
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Taxjar/Salestaxautomation/Model/Comment.php
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Model_Comment{
|
| 3 |
-
public function getCommentText(){ //this method must exits. It returns the text for the comment
|
| 4 |
-
$regionId = Mage::getStoreConfig('shipping/origin/region_id');
|
| 5 |
-
$regionName = Mage::getModel('directory/region')->load($regionId)->getDefaultName();
|
| 6 |
-
$lastUpdate = Mage::getStoreConfig('salestaxautomation/config/last_update');
|
| 7 |
-
if($lastUpdate){
|
| 8 |
-
return "<br/><p>Your " . $regionName . " sales tax rates were last updated on: <ul><li>" . $lastUpdate . "</li></ul></p><p>If you would like to uninstall TaxJar, remove the API Token from the box above, then save the config. This will remove all the rates. You can then uninstall in the Magento Connect Manager.</p>";
|
| 9 |
-
} else {
|
| 10 |
-
return "<br/><p>Enter your TaxJar API Token to import current sales tax rates for all zip codes in " . $regionName . ", your state of origin as set in Shipping Settings. To get an API Token, go to <a href='https://app.taxjar.com/account' target='_blank'>TaxJar's Account Screen.</a></p><p>For more information on how your tax settings are changed, <a href='http://taxjar.com/magento/tax-settings' target='_blank'>click here</a>.</p>";
|
| 11 |
-
}
|
| 12 |
-
}
|
| 13 |
-
}
|
| 14 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Taxjar/Salestaxautomation/Model/Observer.php
DELETED
|
@@ -1,69 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Model_Observer {
|
| 3 |
-
|
| 4 |
-
public function execute($observer) {
|
| 5 |
-
$apiKey = Mage::getStoreConfig('salestaxautomation/config/salestaxautomation_apikey');
|
| 6 |
-
if ($apiKey){
|
| 7 |
-
$this->newRates = array();
|
| 8 |
-
$client = Mage::getModel('salestaxautomation/client');
|
| 9 |
-
$configuration = Mage::getModel('salestaxautomation/configuration');
|
| 10 |
-
$rule = Mage::getModel('salestaxautomation/rule');
|
| 11 |
-
$regionId = Mage::getStoreConfig('shipping/origin/region_id');
|
| 12 |
-
$regionCode = Mage::getModel('directory/region')->load($regionId)->getCode();
|
| 13 |
-
$storeZip = Mage::getStoreConfig('shipping/origin/postcode');
|
| 14 |
-
$apiHost = 'http://api.taxjar.com';
|
| 15 |
-
$configJson = $client->getResource(
|
| 16 |
-
$apiKey,
|
| 17 |
-
$apiHost . '/magento/get_configuration/' . $regionCode
|
| 18 |
-
);
|
| 19 |
-
if(!$configJson['allow_update']) {
|
| 20 |
-
return;
|
| 21 |
-
}
|
| 22 |
-
$ratesJson = $client->getResource(
|
| 23 |
-
$apiKey,
|
| 24 |
-
$apiHost . '/magento/get_rates/' . $regionCode . '/' . $storeZip
|
| 25 |
-
);
|
| 26 |
-
$configuration->setTaxBasis($configJson);
|
| 27 |
-
$configuration->setShippingTaxability($configJson);
|
| 28 |
-
$configuration->setDisplaySettings();
|
| 29 |
-
$configuration->setApiSettings($apiKey);
|
| 30 |
-
$this->_purgeExisting();
|
| 31 |
-
$this->_createRates($regionId, $regionCode, $ratesJson);
|
| 32 |
-
$rule->create('Retail Customer-Taxable Goods-Rate 1', 2, 1, $this->newRates);
|
| 33 |
-
if($configJson['freight_taxable']) {
|
| 34 |
-
$rule->create('Retail Customer-Shipping-Rate 1', 4, 2, $this->newRates);
|
| 35 |
-
}
|
| 36 |
-
} else {
|
| 37 |
-
$this->_purgeExisting();
|
| 38 |
-
$this->_setLastUpdateDate(NULL);
|
| 39 |
-
}
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
private function _purgeExisting() {
|
| 45 |
-
$paths = array('tax/calculation', 'tax/calculation_rate', 'tax/calculation_rule');
|
| 46 |
-
foreach($paths as $path){
|
| 47 |
-
$existingRecords = Mage::getModel($path)->getCollection();
|
| 48 |
-
foreach($existingRecords as $record) {
|
| 49 |
-
$record->delete();
|
| 50 |
-
}
|
| 51 |
-
}
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
private function _createRates($regionId, $regionCode, $ratesJson) {
|
| 55 |
-
$rate = Mage::getModel('salestaxautomation/rate');
|
| 56 |
-
foreach($ratesJson as $rateJson) {
|
| 57 |
-
$this->newRates[] = $rate->create($regionId, $regionCode, $rateJson);
|
| 58 |
-
}
|
| 59 |
-
$this->_setLastUpdateDate(date('m-d-Y'));
|
| 60 |
-
}
|
| 61 |
-
|
| 62 |
-
private function _setLastUpdateDate($date) {
|
| 63 |
-
Mage::getModel('core/config')->saveConfig('salestaxautomation/config/last_update', $date);
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
}
|
| 69 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Taxjar/Salestaxautomation/Model/Rate.php
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Model_Rate {
|
| 3 |
-
|
| 4 |
-
public function create($regionId, $regionCode, $rateJson) {
|
| 5 |
-
$zip = $rateJson['zip'];
|
| 6 |
-
$rate = $rateJson['rate'];
|
| 7 |
-
$rateModel = Mage::getModel('tax/calculation_rate');
|
| 8 |
-
$rateModel->setTaxCountryId('US');
|
| 9 |
-
$rateModel->setTaxRegionId($regionId);
|
| 10 |
-
$rateModel->setTaxPostcode($zip);
|
| 11 |
-
$rateModel->setCode('US-' . $regionCode . '-' . $zip);
|
| 12 |
-
$rateModel->setRate($rate);
|
| 13 |
-
$rateModel->save();
|
| 14 |
-
|
| 15 |
-
return $rateModel->getId();
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
}
|
| 19 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Taxjar/Salestaxautomation/Model/Rule.php
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
class Taxjar_Salestaxautomation_Model_Rule {
|
| 3 |
-
public function create($code, $productClass, $position, $newRates) {
|
| 4 |
-
$ruleModel = Mage::getSingleton('tax/calculation_rule');
|
| 5 |
-
$attributes = array(
|
| 6 |
-
'code' => $code,
|
| 7 |
-
'tax_customer_class' => array(3),
|
| 8 |
-
'tax_product_class' => array($productClass),
|
| 9 |
-
'tax_rate' => $newRates,
|
| 10 |
-
'priority' => 1,
|
| 11 |
-
'position' => $position
|
| 12 |
-
);
|
| 13 |
-
$ruleModel->setData($attributes);
|
| 14 |
-
$ruleModel->setCalculateSubtotal(0);
|
| 15 |
-
$ruleModel->save();
|
| 16 |
-
$ruleModel->saveCalculationData();
|
| 17 |
-
}
|
| 18 |
-
}
|
| 19 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Taxjar/Salestaxautomation/etc/config.xml
DELETED
|
@@ -1,75 +0,0 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<config>
|
| 3 |
-
<modules>
|
| 4 |
-
<Taxjar_Salestaxautomation><version>0.1.0</version></Taxjar_Salestaxautomation>
|
| 5 |
-
</modules>
|
| 6 |
-
<global>
|
| 7 |
-
<helpers>
|
| 8 |
-
<salestaxautomation>
|
| 9 |
-
<class>Taxjar_Salestaxautomation_Helper</class>
|
| 10 |
-
</salestaxautomation>
|
| 11 |
-
</helpers>
|
| 12 |
-
<models>
|
| 13 |
-
<salestaxautomation>
|
| 14 |
-
<class>Taxjar_Salestaxautomation_Model</class>
|
| 15 |
-
</salestaxautomation>
|
| 16 |
-
</models>
|
| 17 |
-
<blocks>
|
| 18 |
-
<salestaxautomation>
|
| 19 |
-
<class>Taxjar_Salestaxautomation_Block</class>
|
| 20 |
-
</salestaxautomation>
|
| 21 |
-
</blocks>
|
| 22 |
-
<events>
|
| 23 |
-
<admin_system_config_changed_section_salestaxautomation>
|
| 24 |
-
<observers>
|
| 25 |
-
<taxjar_salestaxautomation_model_observer>
|
| 26 |
-
<type>singleton</type>
|
| 27 |
-
<class>Taxjar_Salestaxautomation_Model_Observer</class>
|
| 28 |
-
<method>execute</method>
|
| 29 |
-
</taxjar_salestaxautomation_model_observer>
|
| 30 |
-
</observers>
|
| 31 |
-
</admin_system_config_changed_section_salestaxautomation>
|
| 32 |
-
</events>
|
| 33 |
-
</global>
|
| 34 |
-
<frontend>
|
| 35 |
-
<routers>
|
| 36 |
-
<salestaxautomation>
|
| 37 |
-
<use>standard</use>
|
| 38 |
-
<args>
|
| 39 |
-
<module>Taxjar_Salestaxautomation</module>
|
| 40 |
-
<frontName>salestaxautomation</frontName>
|
| 41 |
-
</args>
|
| 42 |
-
</salestaxautomation>
|
| 43 |
-
</routers>
|
| 44 |
-
</frontend>
|
| 45 |
-
<adminhtml>
|
| 46 |
-
<acl>
|
| 47 |
-
<resources>
|
| 48 |
-
<admin>
|
| 49 |
-
<children>
|
| 50 |
-
<system>
|
| 51 |
-
<children>
|
| 52 |
-
<config>
|
| 53 |
-
<children>
|
| 54 |
-
<salestaxautomation>
|
| 55 |
-
<title>Store Sales Tax Wizard Module Section</title>
|
| 56 |
-
</salestaxautomation>
|
| 57 |
-
</children>
|
| 58 |
-
</config>
|
| 59 |
-
</children>
|
| 60 |
-
</system>
|
| 61 |
-
</children>
|
| 62 |
-
</admin>
|
| 63 |
-
</resources>
|
| 64 |
-
</acl>
|
| 65 |
-
</adminhtml>
|
| 66 |
-
<crontab>
|
| 67 |
-
<jobs>
|
| 68 |
-
<salestaxautomation>
|
| 69 |
-
<schedule><cron_expr>0 8 1 * *</cron_expr></schedule>
|
| 70 |
-
<run><model>salestaxautomation/observer::execute</model></run>
|
| 71 |
-
</salestaxautomation>
|
| 72 |
-
</jobs>
|
| 73 |
-
</crontab>
|
| 74 |
-
|
| 75 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/etc/modules/Taxjar_Salestaxautomation.xml
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
<config>
|
| 2 |
-
<modules>
|
| 3 |
-
<Taxjar_Salestaxautomation>
|
| 4 |
-
<active>true</active>
|
| 5 |
-
<codePool>community</codePool>
|
| 6 |
-
<depends></depends>
|
| 7 |
-
</Taxjar_Salestaxautomation>
|
| 8 |
-
</modules>
|
| 9 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
|
@@ -1,39 +1,22 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Taxjar_Salestaxautomation</name>
|
| 4 |
-
<version>1.0
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MITL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>Easily collect sales tax without altering your Magento store’s checkout experience or performance.
|
| 10 |
-
|
| 11 |
-
<
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
- No setup fee 
|
| 21 |
-
</description>
|
| 22 |
-
<notes>Collect sales tax without changing your Magento Store’s checkout process. 
|
| 23 |
-
TaxJar’s Sales Tax Automation makes collecting sales tax easy by removing complex configuration and 
|
| 24 |
-
providing accurate rates and reporting that eliminate precious hours wasted on filing sales tax returns. 
|
| 25 |
-
Sales Tax Automation Benefits: 
|
| 26 |
-
- Easy first-time install 
|
| 27 |
-
- Automated sales tax configuration 
|
| 28 |
-
- Avoid shopping cart abandonment 
|
| 29 |
-
- Calculations don’t impact store’s performance 
|
| 30 |
-
- Free rates for your state 
|
| 31 |
-
- No setup fee 
|
| 32 |
-
</notes>
|
| 33 |
-
<authors><author><name>Bernd Ustorf</name><user>taxjar</user><email>bernd@taxjar.com</email></author></authors>
|
| 34 |
-
<date>2014-04-29</date>
|
| 35 |
-
<time>17:33:56</time>
|
| 36 |
-
<contents><target name="magecommunity"><dir name="Taxjar"><dir name="Salestaxautomation"><dir name="Helper"><file name="Data.php" hash="96c03874cb66ac342e1ae67bc38f2a7c"/></dir><dir name="Model"><file name="Client.php" hash="07f565045e3c7937e62cca95519f4bb3"/><file name="Comment.php" hash="36c5c9d31dff176eb5e956d3a4edb077"/><file name="Configuration.php" hash="db8cf6bea02ee957c3d1e056349aabed"/><file name="Observer.php" hash="fea56df8ecd51073ce5e65a6d5c44a5c"/><file name="Rate.php" hash="c3056aa1c1097da7ac739653d38fe2c3"/><file name="Rule.php" hash="0b4153d8bc244b4ab585e3d4d3368713"/></dir><dir name="etc"><file name="config.xml" hash="bfdcf1e88dd36890cdee269bb1a59932"/><file name="system.xml" hash="6fbac6eab4308d515c7b4a03ec50c593"/></dir></dir><file name=".DS_Store" hash="13f08486f093ac8c1a2548de0ec42bb6"/></dir></target><target name="mageetc"><dir name="modules"><file name="Taxjar_Salestaxautomation.xml" hash="85eafb00fd56cb0b36130a9dcad1f859"/></dir></target></contents>
|
| 37 |
<compatible/>
|
| 38 |
-
<dependencies><required><php><min>5.
|
| 39 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Taxjar_Salestaxautomation</name>
|
| 4 |
+
<version>1.1.0</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MITL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
+
<summary>Easily collect sales tax without altering your Magento store’s checkout experience or performance. </summary>
|
| 10 |
+
<description>Collect sales tax without changing your Magento Store’s checkout process. Sales Tax Automation by TaxJar is free to use for 30 days. If you choose to pay for TaxJar, pricing starts at $29.95/month. Pricing is based on the number of transactions your store does per month. We feature both monthly rates and annual plans that offer a 2-month discount if you prepay for the year.</description>
|
| 11 |
+
<notes>This release offers the following:
|
| 12 |
+
* Multistate tax rates loaded from all addresses in your TaxJar account
|
| 13 |
+
* Update API to HTTPS and newest routes
|
| 14 |
+
* Configures shipping tax rates for states where shipping is taxable
|
| 15 |
+
* Updated display to show which states are loaded</notes>
|
| 16 |
+
<authors><author><name>TaxJar</name><user>taxjar</user><email>support@taxjar.com</email></author></authors>
|
| 17 |
+
<date>2014-10-24</date>
|
| 18 |
+
<time>16:33:00</time>
|
| 19 |
+
<contents><target name="magecommunity"><dir name="Taxjar"><dir name="SalesTax"><dir name="Helper"><file name="Data.php" hash="565812e7d6927df4c91bfb69b79b1b09"/></dir><dir name="Model"><file name="Client.php" hash="6c3339bcc33670b0d41ded468b72e77b"/><file name="Comment.php" hash="17aff283061029f60c301b0cfea0ec04"/><file name="Configuration.php" hash="1ed6e9467ac8c5ca6e906753071a9161"/><file name="Observer.php" hash="ae343a43043edc2c49ef7ef7bc3f7b65"/><file name="Rate.php" hash="4f1f62e6696f10f34f58d7104936223d"/><file name="Rule.php" hash="ae33149080b3182e62b56607f7b30da4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="4ea028ad6b00688d99531597e8d3c404"/><file name="config.xml" hash="c5a45ce71a64756cf987fc9bd079ac67"/><file name="system.xml" hash="ee3a92f70e11453ffcac2ef985654669"/></dir><file name=".DS_Store" hash="f291190ac228acaede15fefc49edb6e5"/></dir><file name=".DS_Store" hash="e385b6a995c1af38f899669fa136a12e"/></dir></target></contents>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
<compatible/>
|
| 21 |
+
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
| 22 |
</package>
|
