Mage_Exactor_Tax - Version 2013.07.24

Version Notes

Supported Magento 1.5.0.0 - 1.7.x, Magento Enterprise 1.8-1.12.x

Download this release

Release Info

Developer Exactor, Inc.
Extension Mage_Exactor_Tax
Version 2013.07.24
Comparing to
See all releases


Code changes from version 2013.06.06 to 2013.07.24

app/code/local/Exactor/Tax/Helper/Mapping.php CHANGED
@@ -48,6 +48,21 @@ class Exactor_Tax_Helper_Mapping extends Mage_Core_Helper_Abstract {
48
 
49
  const PRICE_TYPE_DYNAMIC = 0;
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  private function getLogger(){
52
  if ($this->logger==null)
53
  $this->logger = ExactorLoggingFactory::getInstance()->getLogger($this);
@@ -450,7 +465,7 @@ class Exactor_Tax_Helper_Mapping extends Mage_Core_Helper_Abstract {
450
  foreach ($magentoItems as $magentoItem) {
451
  $exactorLineItem = $this->buildLineItemForMagentoItem($magentoItem, $quoteAddress, $merchantSettings);
452
  if ($exactorLineItem == null) continue;
453
- $exactorLineItem->setId(self::INDEXED_LINE_ITEM_ID_PREFIX . $magentoItem->getId());
454
  // If this is non-multishipping request we should set
455
  // ship to address to billing address for VIRTUAL ITEMS
456
  if (!$isMultishipping){
@@ -647,7 +662,7 @@ class Exactor_Tax_Helper_Mapping extends Mage_Core_Helper_Abstract {
647
  $exactorLineItem = $this->buildLineItemForMagentoItem($magentoItem, new Mage_Sales_Model_Quote_Address(), $merchantSettings);
648
  if ($exactorLineItem != null){
649
  $exactorLineItem->setQuantity($magentoItem->getQtyOrdered());
650
- $exactorLineItem->setId(self::INDEXED_LINE_ITEM_ID_PREFIX . $magentoItem->getId());
651
  }
652
  $invoiceRequest->addLineItem($exactorLineItem);
653
  }
48
 
49
  const PRICE_TYPE_DYNAMIC = 0;
50
 
51
+ /**
52
+ * @param Mage_Sales_Model_Order_Item $magentoItem
53
+ * @return string
54
+ */
55
+ public function buildExactorItemId($magentoItem)
56
+ {
57
+ $itemId = $magentoItem->getId();
58
+ if ((defined('EXACTOR_BUILD_CUSTOM_ITEM_KEY') && constant('EXACTOR_BUILD_CUSTOM_ITEM_KEY')) || empty($itemId)){
59
+ $itemId = base64_encode(join(':', array($magentoItem->getSku(), $magentoItem->getProductId(),
60
+ $magentoItem->getRowTotal(), $magentoItem->getQtyOrdered())));
61
+ $this->getLogger()->info("Building custom item key: " . $itemId);
62
+ }
63
+ return self::INDEXED_LINE_ITEM_ID_PREFIX . $itemId;
64
+ }
65
+
66
  private function getLogger(){
67
  if ($this->logger==null)
68
  $this->logger = ExactorLoggingFactory::getInstance()->getLogger($this);
465
  foreach ($magentoItems as $magentoItem) {
466
  $exactorLineItem = $this->buildLineItemForMagentoItem($magentoItem, $quoteAddress, $merchantSettings);
467
  if ($exactorLineItem == null) continue;
468
+ $exactorLineItem->setId($this->buildExactorItemId($magentoItem));
469
  // If this is non-multishipping request we should set
470
  // ship to address to billing address for VIRTUAL ITEMS
471
  if (!$isMultishipping){
662
  $exactorLineItem = $this->buildLineItemForMagentoItem($magentoItem, new Mage_Sales_Model_Quote_Address(), $merchantSettings);
663
  if ($exactorLineItem != null){
664
  $exactorLineItem->setQuantity($magentoItem->getQtyOrdered());
665
+ $exactorLineItem->setId($this->buildExactorItemId($magentoItem));
666
  }
667
  $invoiceRequest->addLineItem($exactorLineItem);
668
  }
app/code/local/Exactor/Tax/Model/Sales/Total/Quote/Tax.php CHANGED
@@ -231,7 +231,7 @@ class Exactor_Tax_Model_Sales_Total_Quote_Tax extends Mage_Sales_Model_Quote_Add
231
  * @var Mage_Sales_Model_Quote_Item $item
232
  */
233
  foreach ($address->getAllItems() as $item){
234
- $taxResultItem = $invoice->getItemById(Exactor_Tax_Helper_Mapping::INDEXED_LINE_ITEM_ID_PREFIX . $item->getId());
235
  // If there is no item in response - set tax to 0
236
  if ($taxResultItem==null){
237
  $item->setTaxAmount(0);
231
  * @var Mage_Sales_Model_Quote_Item $item
232
  */
233
  foreach ($address->getAllItems() as $item){
234
+ $taxResultItem = $invoice->getItemById($this->exactorMappingHelper->buildExactorItemId($item));
235
  // If there is no item in response - set tax to 0
236
  if ($taxResultItem==null){
237
  $item->setTaxAmount(0);
lib/ExactorCommons/ExactorDomainObjects.php CHANGED
@@ -1109,6 +1109,7 @@ class TaxRequestType extends XmlSerializationSupport {
1109
  {
1110
  $this->setBindingRulesFor('$this')->xmlName('TaxRequest');
1111
  $this->setBindingRulesFor('pluginVersion')->xmlName('version')->toXmlAttribute();
 
1112
 
1113
  $this->setBindingRulesFor('InvoiceRequests')->objectType('array InvoiceRequestType')->xmlName('InvoiceRequest');
1114
  $this->setBindingRulesFor('CommitRequests')->objectType('array CommitRequestType')->xmlName('CommitRequest');
1109
  {
1110
  $this->setBindingRulesFor('$this')->xmlName('TaxRequest');
1111
  $this->setBindingRulesFor('pluginVersion')->xmlName('version')->toXmlAttribute();
1112
+ $this->setBindingRulesFor('pluginName')->xmlName('plugin')->toXmlAttribute();
1113
 
1114
  $this->setBindingRulesFor('InvoiceRequests')->objectType('array InvoiceRequestType')->xmlName('InvoiceRequest');
1115
  $this->setBindingRulesFor('CommitRequests')->objectType('array CommitRequestType')->xmlName('CommitRequest');
lib/ExactorCommons/config.php CHANGED
@@ -4,6 +4,7 @@
4
  * Date: 4/20/12
5
  * Time: 10:36 AM
6
  */
 
7
  /* Available config options */
8
  define('EXACTOR_CONFIG_EXEMPT_DISCOUNTS', 'exempt-descounts');
9
  define('EXACTOR_CONFIG_FEATURE_EXEMPT_DISCOUNTS', 'discount-exemptions');
@@ -15,7 +16,7 @@ define('EXACTOR_CONFIG_FEATURE_DISABLE_ESTIMATES', 'disable-estimates');
15
 
16
  /* Initializing factories */
17
  ExactorLoggingFactory::getInstance()->setup('MagentoLogger', IExactorLogger::DEBUG);
18
- ExactorConnectionFactory::getInstance()->setup('Magento','v20130606');
19
  ExactorProcessingServiceFactory::getInstance()->setup(new MagentoExactorCallback());
20
 
21
  /* Initializing configuration object */
4
  * Date: 4/20/12
5
  * Time: 10:36 AM
6
  */
7
+ define('EXACTOR_BUILD_CUSTOM_ITEM_KEY', false);
8
  /* Available config options */
9
  define('EXACTOR_CONFIG_EXEMPT_DISCOUNTS', 'exempt-descounts');
10
  define('EXACTOR_CONFIG_FEATURE_EXEMPT_DISCOUNTS', 'discount-exemptions');
16
 
17
  /* Initializing factories */
18
  ExactorLoggingFactory::getInstance()->setup('MagentoLogger', IExactorLogger::DEBUG);
19
+ ExactorConnectionFactory::getInstance()->setup('Magento','20130724');
20
  ExactorProcessingServiceFactory::getInstance()->setup(new MagentoExactorCallback());
21
 
22
  /* Initializing configuration object */
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Exactor_Tax</name>
4
- <version>2013.06.06</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -12,9 +12,9 @@ Once installed, neither the merchant, nor the customer, need to perform any addi
12
  For additional information, please refer to the Exactor Magento User Guide that is attached to the plug-in, or which you can download directly from the Exactor control panel (navigate to Account Management Integration Points &amp; PlugIns).</description>
13
  <notes>Supported Magento 1.5.0.0 - 1.7.x, Magento Enterprise 1.8-1.12.x</notes>
14
  <authors><author><name>Exactor, Inc.</name><user>exactor</user><email>support@exactor.com</email></author></authors>
15
- <date>2013-06-10</date>
16
- <time>15:35:06</time>
17
- <contents><target name="magelocal"><dir name="Exactor"><dir name="Core"><dir name="Helper"><file name="SessionCache.php" hash="72692a33574f8ba2f1858e2e93aa4edf"/></dir><dir name="Model"><file name="ExactorTransaction.php" hash="852aa20f6e3b7aa0001439d4bffe9724"/><file name="MerchantSettings.php" hash="71a7c2308f6f0eda102ae84dd90df751"/><dir name="Mysql4"><dir name="ExactorTransaction"><file name="Collection.php" hash="c7b890b4d3ab35e65a3856ae0e2fdf72"/></dir><file name="ExactorTransaction.php" hash="c91aebaae767613acf1c439a8b513c3b"/><dir name="MerchantSettings"><file name="Collection.php" hash="c1593f52e582e601409c4651c37495af"/><file name="Collection.php~" hash="d360e202eb30432ac41dc023ce13ffc0"/></dir><file name="MerchantSettings.php" hash="8f22b76bb64cdc7b1deb6f0e38889905"/></dir><dir name="Type"><file name="Onepage.php" hash="2441fb08bbeb579831cea4d3fbd31104"/></dir></dir><dir name="etc"><file name="config.xml" hash="98ecc82a5f7b74ac0bfc0f7ab512afdb"/></dir></dir><dir name="ExactorSettings"><dir name="Block"><file name="Form.php" hash="5ea1d72197306072fe5fad9b97d109e8"/></dir><dir name="Helper"><file name="Data.php" hash="a23bb9c251f0dbb77c107d01dde39e86"/><file name="VersionResolver.php" hash="14dce068dfe2a7d3364c4bd29e6f8431"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FormController.php" hash="c0985258b110e0314e6b6ea091ae8c19"/></dir><file name="AjaxController.php" hash="c07aeeca00e1408e52945fc027569793"/><file name="IndexController.php" hash="f47cbc274dd68c57c30b60bbee69259e"/></dir><dir name="etc"><file name="config.xml" hash="674c326bfc901d0becf7c94ddcdd1452"/></dir><dir name="sql"><dir name="ExactorSettings_setup"><file name="mysql4-install-14.04.2012.php" hash="f35af1e12921b57479cb4b5677937a0c"/><file name="upgrade-2012.06.14-2012.09.25.php" hash="174fda5224bc23cdf147fb059d079478"/></dir></dir></dir><dir name="Sales"><dir name="Model"><file name="Observer.php" hash="42de4489c7f93e2c1c9b6ea6e7309584"/></dir><dir name="etc"><file name="config.xml" hash="ba31618f5165dda20010c40e7ef8dad1"/></dir></dir><dir name="Tax"><dir name="Helper"><file name="Calculation.php" hash="29c5252bdd48b173c90588f449114024"/><file name="Mapping.php" hash="1bf0deb2c733390faf2de15d0256037f"/></dir><dir name="Model"><dir name="Sales"><dir name="Total"><dir name="Quote"><dir name="Nominal"><file name="Tax.php" hash="156eff380df5b16db55449759f193490"/></dir><file name="Tax.php" hash="8c79680737583ffb5c66658297d0a5a3"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="dac507a6a0437f511973c29646bd6a8d"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="exactorsettings.xml" hash="3707eac08d2393c8796eebf1cf7a0bd9"/><file name="exactoronestepcheckout.xml" hash="9fdfa1db5e4e60b4eec8f348c10aab07"/></dir><dir name="template"><dir name="ExactorSettings"><file name="settingsform.phtml" hash="3f6e14533076ab97dbb0c98ba770bf87"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="exactoronestepcheckout.xml" hash="9fdfa1db5e4e60b4eec8f348c10aab07"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Exactor.xml" hash="e8997e8e36a265141b37790caaef39d6"/></dir></target><target name="mageweb"><dir name="js"><dir name="exactor"><file name="exactor.js" hash="5c23e40f4034e50a6e0df5b1c708b7e1"/></dir></dir></target><target name="magelib"><dir name="ExactorCommons"><file name="ExactorCommons.php" hash="e97250a67e09082767f131ddc9e1d134"/><file name="ExactorDomainObjects.php" hash="642c46eb5e1c3daa624cce0f9329348a"/><file name="Magento.php" hash="76da7333fe0692053a47f8564c7b513a"/><file name="RegionResolver.php" hash="2537638a7895a169cee4b1df786d22fb"/><file name="XmlProcessing.php" hash="5d6393a68f86cf9a7d0f3b26b5b8f1e0"/><file name="config.php" hash="efa966b1accc695ccf6ef7ac47883252"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Exactor_Tax</name>
4
+ <version>2013.07.24</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
12
  For additional information, please refer to the Exactor Magento User Guide that is attached to the plug-in, or which you can download directly from the Exactor control panel (navigate to Account Management Integration Points &amp; PlugIns).</description>
13
  <notes>Supported Magento 1.5.0.0 - 1.7.x, Magento Enterprise 1.8-1.12.x</notes>
14
  <authors><author><name>Exactor, Inc.</name><user>exactor</user><email>support@exactor.com</email></author></authors>
15
+ <date>2013-07-25</date>
16
+ <time>13:12:37</time>
17
+ <contents><target name="magelocal"><dir name="Exactor"><dir name="Core"><dir name="Helper"><file name="SessionCache.php" hash="72692a33574f8ba2f1858e2e93aa4edf"/></dir><dir name="Model"><file name="ExactorTransaction.php" hash="852aa20f6e3b7aa0001439d4bffe9724"/><file name="MerchantSettings.php" hash="71a7c2308f6f0eda102ae84dd90df751"/><dir name="Mysql4"><dir name="ExactorTransaction"><file name="Collection.php" hash="c7b890b4d3ab35e65a3856ae0e2fdf72"/></dir><file name="ExactorTransaction.php" hash="c91aebaae767613acf1c439a8b513c3b"/><dir name="MerchantSettings"><file name="Collection.php" hash="c1593f52e582e601409c4651c37495af"/><file name="Collection.php~" hash="d360e202eb30432ac41dc023ce13ffc0"/></dir><file name="MerchantSettings.php" hash="8f22b76bb64cdc7b1deb6f0e38889905"/></dir><dir name="Type"><file name="Onepage.php" hash="2441fb08bbeb579831cea4d3fbd31104"/></dir></dir><dir name="etc"><file name="config.xml" hash="98ecc82a5f7b74ac0bfc0f7ab512afdb"/></dir></dir><dir name="ExactorSettings"><dir name="Block"><file name="Form.php" hash="5ea1d72197306072fe5fad9b97d109e8"/></dir><dir name="Helper"><file name="Data.php" hash="a23bb9c251f0dbb77c107d01dde39e86"/><file name="VersionResolver.php" hash="14dce068dfe2a7d3364c4bd29e6f8431"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FormController.php" hash="c0985258b110e0314e6b6ea091ae8c19"/></dir><file name="AjaxController.php" hash="c07aeeca00e1408e52945fc027569793"/><file name="IndexController.php" hash="f47cbc274dd68c57c30b60bbee69259e"/></dir><dir name="etc"><file name="config.xml" hash="674c326bfc901d0becf7c94ddcdd1452"/></dir><dir name="sql"><dir name="ExactorSettings_setup"><file name="mysql4-install-14.04.2012.php" hash="f35af1e12921b57479cb4b5677937a0c"/><file name="upgrade-2012.06.14-2012.09.25.php" hash="174fda5224bc23cdf147fb059d079478"/></dir></dir></dir><dir name="Sales"><dir name="Model"><file name="Observer.php" hash="42de4489c7f93e2c1c9b6ea6e7309584"/></dir><dir name="etc"><file name="config.xml" hash="ba31618f5165dda20010c40e7ef8dad1"/></dir></dir><dir name="Tax"><dir name="Helper"><file name="Calculation.php" hash="29c5252bdd48b173c90588f449114024"/><file name="Mapping.php" hash="1cf36e62ef36f90f83aba1fc38535ce0"/></dir><dir name="Model"><dir name="Sales"><dir name="Total"><dir name="Quote"><dir name="Nominal"><file name="Tax.php" hash="156eff380df5b16db55449759f193490"/></dir><file name="Tax.php" hash="aad011abbba00d014d411b4d2122977c"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="dac507a6a0437f511973c29646bd6a8d"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="exactorsettings.xml" hash="3707eac08d2393c8796eebf1cf7a0bd9"/><file name="exactoronestepcheckout.xml" hash="9fdfa1db5e4e60b4eec8f348c10aab07"/></dir><dir name="template"><dir name="ExactorSettings"><file name="settingsform.phtml" hash="3f6e14533076ab97dbb0c98ba770bf87"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="exactoronestepcheckout.xml" hash="9fdfa1db5e4e60b4eec8f348c10aab07"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Exactor.xml" hash="e8997e8e36a265141b37790caaef39d6"/></dir></target><target name="mageweb"><dir name="js"><dir name="exactor"><file name="exactor.js" hash="5c23e40f4034e50a6e0df5b1c708b7e1"/></dir></dir></target><target name="magelib"><dir name="ExactorCommons"><file name="ExactorCommons.php" hash="e97250a67e09082767f131ddc9e1d134"/><file name="ExactorDomainObjects.php" hash="a7ab4b08aab05061bc554f7c4405fde4"/><file name="Magento.php" hash="76da7333fe0692053a47f8564c7b513a"/><file name="RegionResolver.php" hash="2537638a7895a169cee4b1df786d22fb"/><file name="XmlProcessing.php" hash="5d6393a68f86cf9a7d0f3b26b5b8f1e0"/><file name="config.php" hash="30149d50b1999307d0cac51f37152ae6"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>