Skip to content

Commit

Permalink
Merge branch 'AVI-AVIP-688' into 'release/3.5.3'
Browse files Browse the repository at this point in the history
Avi avip 688



See merge request !27
  • Loading branch information
marynychsv committed Jul 12, 2017
2 parents 20c8abb + 591c18b commit 06565dc
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ protected function _getExportColumns()
'request',
'result',
'additional',
'created_at'
'created_at',
'soap_request',
'soap_request_headers',
'soap_result',
'soap_result_headers'
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ abstract class OnePica_AvaTax_Model_Service_Avatax_Abstract extends OnePica_AvaT
* @param mixed $additional any other info
* @return $this
*/
protected function _log($type, $request, $result, $storeId = null, $additional = null)
protected function _log(
$type, $request, $result, $storeId = null,
$additional = null, $connection = null)
{
if ($result->getResultCode() == SeverityLevel::$Success) {
switch ($this->_getHelper()->getLogMode($storeId)) {
Expand All @@ -126,6 +128,17 @@ protected function _log($type, $request, $result, $storeId = null, $additional =
break;
}
}
$soapRequest = null;
$soapRequestHeaders = null;
$soapResponse = null;
$soapResponseHeaders = null;

if ($connection) {
$soapRequest = $connection->__getLastRequest();
$soapRequestHeaders = $connection->__getLastRequestHeaders();
$soapResponse = $connection->__getLastResponse();
$soapResponseHeaders = $connection->__getLastResponseHeaders();
}

if (in_array($type, $this->_getHelper()->getLogType($storeId))) {
Mage::getModel('avatax_records/log')
Expand All @@ -135,8 +148,13 @@ protected function _log($type, $request, $result, $storeId = null, $additional =
->setRequest(print_r($request, true))
->setResult(print_r($result, true))
->setAdditional($additional)
->setSoapRequest($soapRequest)
->setSoapRequestHeaders($soapRequestHeaders)
->setSoapResult($soapResponse)
->setSoapResultHeaders($soapResponseHeaders)
->save();
}

return $this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ protected function _send($storeId)
$this->_request,
$result,
$storeId,
$config->getParams()
$config->getParams(),
$connection
);

return $result;
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/OnePica/AvaTax/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<config>
<modules>
<OnePica_AvaTax>
<version>3.5.0.0</version>
<version>3.5.0.1</version>
</OnePica_AvaTax>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* OnePica_AvaTax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0), a
* copy of which is available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @category OnePica
* @package OnePica_AvaTax
* @author OnePica Codemaster <[email protected]>
* @copyright Copyright (c) 2015 One Pica, Inc.
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var $this Mage_Core_Model_Resource_Setup */

$installer = $this;
$installer->startSetup();

$installer->run("
ALTER TABLE `" . $this->getTable('avatax_records/log') . "`
ADD `soap_request` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SOAP request' ,
ADD `soap_request_headers` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SOAP request headers' ,
ADD `soap_result` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SOAP result' ,
ADD `soap_result_headers` MEDIUMTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SOAP result headers' ,
CHANGE COLUMN `request` `request` MEDIUMTEXT NULL COMMENT 'Request';"
);

$installer->endSetup();
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,105 @@
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Request'); ?></h4>
</div>
<div id="log_details_fieldset" class="log-details">
<textarea readonly style="width:100%; height:300px"><?php echo $this->escapeHtml(
$event->getRequest()
); ?></textarea>
<div class="columns">
<div class="side-col" id="page:left">
<ul id="request_tabs" class="tabs">
<li>
<a href="#" id="request_tabs_main" name="main"
title="<?php echo $this->__('Request'); ?>" class="tab-item-link">
<span><?php echo $this->__('Request'); ?></span>
</a>

</li>
<li>
<a href="#" id="request_tabs_soap" name="labels"
title="<?php echo $this->__('SOAP Request'); ?>" class="tab-item-link active">
<span><?php echo $this->__('SOAP Request'); ?></span>
</a>
</li>
<li>
<a href="#" id="request_tabs_soapheaders" name="labels"
title="<?php echo $this->__('SOAP Request Headers'); ?>" class="tab-item-link active">
<span><?php echo $this->__('SOAP Request Headers'); ?></span>
</a>
</li>
</ul>
<script type="text/javascript">
request_tabsJsTabs = new varienTabs('request_tabs', 'request_tabs_content', 'request_tabs_main', []);
</script>
</div>
<div class="main-col" id="content" style="min-height: 250px; padding: 0 0 0 25px;">
<div id="request_tabs_content">
<div id="request_tabs_main_content" style="display: none;">
<textarea readonly style="width:100%; height:300px"><?php
echo $this->escapeHtml($event->getRequest());
?></textarea>
</div>
<div id="request_tabs_soap_content">
<textarea readonly style="width:100%; height:300px"><?php
echo $this->escapeHtml($event->getSoapRequest());
?></textarea>
</div>
<div id="request_tabs_soapheaders_content">
<textarea readonly style="width:100%; height:300px"><?php
echo $this->escapeHtml($event->getSoapRequestHeaders());
?></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="entry-edit-head">
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Response'); ?></h4>
</div>
<div id="log_details_fieldset" class="log-details">
<textarea readonly style="width:100%; height:300px"><?php echo $this->escapeHtml(
$event->getResult()
); ?></textarea>
<div class="columns">
<div class="side-col" id="page:left">
<ul id="result_tabs" class="tabs">
<li>
<a href="#" id="result_tabs_main" name="main"
title="<?php echo $this->__('Result'); ?>" class="tab-item-link">
<span><?php echo $this->__('Result'); ?></span>
</a>

</li>
<li>
<a href="#" id="result_tabs_soap" name="labels"
title="<?php echo $this->__('SOAP Result'); ?>" class="tab-item-link active">
<span><?php echo $this->__('SOAP Result'); ?></span>
</a>
</li>
<li>
<a href="#" id="result_tabs_soapheaders" name="labels"
title="<?php echo $this->__('SOAP Result Headers'); ?>" class="tab-item-link active">
<span><?php echo $this->__('SOAP Result Headers'); ?></span>
</a>
</li>
</ul>
<script type="text/javascript">
result_tabsJsTabs = new varienTabs('result_tabs', 'result_tabs_content', 'result_tabs_main', []);
</script>
</div>
<div class="main-col" id="content" style="min-height: 250px; padding: 0 0 0 25px;">
<div id="result_tabs_content">
<div id="result_tabs_main_content" style="display: none;">
<textarea readonly style="width:100%; height:300px"><?php
echo $this->escapeHtml($event->getResult());
?></textarea>
</div>
<div id="result_tabs_soap_content">
<textarea readonly style="width:100%; height:300px"><?php
echo $this->escapeHtml($event->getSoapResult());
?></textarea>
</div>
<div id="result_tabs_soapheaders_content">
<textarea readonly style="width:100%; height:300px"><?php
echo $this->escapeHtml($event->getSoapResultHeaders());
?></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="entry-edit-head">
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Additional'); ?></h4>
Expand Down

0 comments on commit 06565dc

Please sign in to comment.