Version Notes
Simplify sales and use tax calculation, compliance, and management in the cloud!
Download this release
Release Info
Developer | Ken Nunes |
Extension | SalesTax_Connector |
Version | 3.1.7 |
Comparing to | |
See all releases |
Code changes from version 3.1.4 to 3.1.7
- app/code/community/Harapartners/ConnectorHub/Block/Adminhtml/System/Config/Form/Field/Json.php +59 -0
- app/code/community/Harapartners/ConnectorHub/Helper/Connector/Config.php +21 -0
- app/code/{local → community}/Harapartners/ConnectorHub/Helper/Connector/Core.php +6 -7
- app/code/{local → community}/Harapartners/ConnectorHub/Helper/Mcrypt.php +0 -0
- app/code/{local → community}/Harapartners/ConnectorHub/Helper/Object.php +0 -0
- app/code/community/Harapartners/ConnectorHub/Model/Observer.php +257 -0
- app/code/{local → community}/Harapartners/ConnectorHub/Model/Rewrite/Paypal/Api/Nvp.php +0 -0
- app/code/{local → community}/Harapartners/ConnectorHub/Model/Rewrite/Paypal/Config.php +0 -0
- app/code/{local → community}/Harapartners/ConnectorHub/etc/config.xml +22 -3
- app/code/{local → community}/Harapartners/SpeedTax/Block/Adminhtml/System/Config/Form/Field/Authentication.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Helper/Connector/Data.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Helper/Connector/Speedtax.php +7 -4
- app/code/{local → community}/Harapartners/SpeedTax/Helper/Data.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Helper/Processor.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Model/Observer.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Model/Rewrite/Tax/Sales/Total/Quote/Tax.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Model/Session.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/Model/Source/Usregions.php +0 -0
- app/code/{local → community}/Harapartners/SpeedTax/controllers/Adminhtml/System/Config/AjaxController.php +9 -1
- app/code/{local → community}/Harapartners/SpeedTax/etc/config.xml +1 -1
- app/code/{local → community}/Harapartners/SpeedTax/etc/system.xml +2 -2
- app/code/{local → community}/Harapartners/SpeedTax/sql/speedtax_setup/mysql4-upgrade-3.0.9-3.1.0.php +0 -0
- app/etc/modules/Harapartners_SpeedTax.xml +3 -0
- package.xml +9 -9
app/code/community/Harapartners/ConnectorHub/Block/Adminhtml/System/Config/Form/Field/Json.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the End User Software Agreement (EULA).
|
6 |
+
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://www.harapartners.com/license [^]
|
8 |
+
* If you did not receive a copy of the license and are unable to
|
9 |
+
* obtain it through the world-wide-web, please send an email
|
10 |
+
* to eula@harapartners.com so we can send you a copy immediately.
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
|
14 |
+
class Harapartners_ConnectorHub_Block_Adminhtml_System_Config_Form_Field_Json extends Mage_Adminhtml_Block_System_Config_Form_Field {
|
15 |
+
|
16 |
+
protected function _toHtml() {
|
17 |
+
$element = $this->getData('element');
|
18 |
+
$elementData = (string)$element->getValue();
|
19 |
+
$jsonValidateData = json_decode(trim($element->getValue()), true);
|
20 |
+
if(!$jsonValidateData){
|
21 |
+
if($elementJsonConfig['structure'] == 'list'){
|
22 |
+
$elementData = "[]";
|
23 |
+
}else{
|
24 |
+
$elementData = "{}";
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
$hiddenInput = '<input type="hidden" id="'.$element->getHtmlId().'" name="'.$element->getName()
|
29 |
+
.'" value="'.$element->getEscapedValue().'" '.$this->serialize($element->getHtmlAttributes()).'/>'."\n";
|
30 |
+
|
31 |
+
$elementFieldConfig = $element->getFieldConfig();
|
32 |
+
$elementJsonConfig = array(
|
33 |
+
'structure' => (string)$elementFieldConfig->frontend_json_structure,
|
34 |
+
'key_label' => (string)$elementFieldConfig->frontend_json_key_label,
|
35 |
+
'value_label' => (string)$elementFieldConfig->frontend_json_value_label,
|
36 |
+
);
|
37 |
+
$elementJsonConfig = json_encode($elementJsonConfig);
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
$htmlContent = <<< HTML_CONTENT
|
42 |
+
$hiddenInput
|
43 |
+
<div id="{$element->getHtmlId()}_json_config_widget" class="json_config_widget_container"></div>
|
44 |
+
<script type="text/javascript">
|
45 |
+
var {$element->getHtmlId()} = new JsonConfigWidget();
|
46 |
+
{$element->getHtmlId()}.init("{$element->getHtmlId()}", $elementData, $elementJsonConfig);
|
47 |
+
</script>
|
48 |
+
HTML_CONTENT;
|
49 |
+
return $htmlContent;
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element){
|
53 |
+
$this->addData(array(
|
54 |
+
'element' => $element
|
55 |
+
));
|
56 |
+
return $this->_toHtml();
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
app/code/community/Harapartners/ConnectorHub/Helper/Connector/Config.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the End User Software Agreement (EULA).
|
6 |
+
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://www.harapartners.com/license [^]
|
8 |
+
* If you did not receive a copy of the license and are unable to
|
9 |
+
* obtain it through the world-wide-web, please send an email
|
10 |
+
* to eula@harapartners.com so we can send you a copy immediately.
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
class Harapartners_ConnectorHub_Helper_Connector_Config
|
14 |
+
{
|
15 |
+
|
16 |
+
public function getConnectorHubRootUrl()
|
17 |
+
{
|
18 |
+
//return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . "ConnectorHub/";
|
19 |
+
return "https://connectorhub.harapartners.com/";
|
20 |
+
}
|
21 |
+
}
|
app/code/{local → community}/Harapartners/ConnectorHub/Helper/Connector/Core.php
RENAMED
@@ -10,7 +10,7 @@
|
|
10 |
* to eula@harapartners.com so we can send you a copy immediately.
|
11 |
*
|
12 |
*/
|
13 |
-
abstract class Harapartners_ConnectorHub_Helper_Connector_Core
|
14 |
|
15 |
const REQUEST_ACTION_AUTHENTICATION = 'authentication';
|
16 |
|
@@ -65,15 +65,15 @@ abstract class Harapartners_ConnectorHub_Helper_Connector_Core extends Mage_Core
|
|
65 |
// -------------- Process response -------------- //
|
66 |
if(!$response){
|
67 |
if($curlRawResponse){
|
68 |
-
throw new Exception('
|
69 |
}
|
70 |
-
throw new Exception('Connection failed.');
|
71 |
}
|
72 |
//For now treat reauth the same as fail, the notification will prompt the admin user to update their credentials
|
73 |
switch($response->meta->status){
|
74 |
case self::RESPONSE_STATUS_FAIL:
|
75 |
case self::RESPONSE_STATUS_REAUTH:
|
76 |
-
throw new Exception($response->meta->message);
|
77 |
break;
|
78 |
case self::RESPONSE_STATUS_SUCCESS:
|
79 |
break;
|
@@ -101,7 +101,7 @@ abstract class Harapartners_ConnectorHub_Helper_Connector_Core extends Mage_Core
|
|
101 |
|
102 |
//service_mode can be '0'
|
103 |
if(is_null($response->meta->service_mode) || !$response->meta->auth_token || !$response->meta->data_token){
|
104 |
-
throw new Exception(
|
105 |
}
|
106 |
|
107 |
$this->saveTokens($response);
|
@@ -176,8 +176,7 @@ abstract class Harapartners_ConnectorHub_Helper_Connector_Core extends Mage_Core
|
|
176 |
}
|
177 |
|
178 |
protected function _getConnectorHubRootUrl(){
|
179 |
-
|
180 |
-
// return "https://connectorhub.harapartners.com/";
|
181 |
}
|
182 |
|
183 |
}
|
10 |
* to eula@harapartners.com so we can send you a copy immediately.
|
11 |
*
|
12 |
*/
|
13 |
+
abstract class Harapartners_ConnectorHub_Helper_Connector_Core {
|
14 |
|
15 |
const REQUEST_ACTION_AUTHENTICATION = 'authentication';
|
16 |
|
65 |
// -------------- Process response -------------- //
|
66 |
if(!$response){
|
67 |
if($curlRawResponse){
|
68 |
+
throw new Exception('Connector Hub: There is an error processing the request.');
|
69 |
}
|
70 |
+
throw new Exception('Connector Hub: Connection failed.');
|
71 |
}
|
72 |
//For now treat reauth the same as fail, the notification will prompt the admin user to update their credentials
|
73 |
switch($response->meta->status){
|
74 |
case self::RESPONSE_STATUS_FAIL:
|
75 |
case self::RESPONSE_STATUS_REAUTH:
|
76 |
+
throw new Exception("Connector Hub ({$this->getServiceType()}): " . $response->meta->message);
|
77 |
break;
|
78 |
case self::RESPONSE_STATUS_SUCCESS:
|
79 |
break;
|
101 |
|
102 |
//service_mode can be '0'
|
103 |
if(is_null($response->meta->service_mode) || !$response->meta->auth_token || !$response->meta->data_token){
|
104 |
+
throw new Exception("Connector Hub ({$this->getServiceType()}): Authentication failed.");
|
105 |
}
|
106 |
|
107 |
$this->saveTokens($response);
|
176 |
}
|
177 |
|
178 |
protected function _getConnectorHubRootUrl(){
|
179 |
+
return Mage::helper('connectorhub/connector_config')->getConnectorHubRootUrl();
|
|
|
180 |
}
|
181 |
|
182 |
}
|
app/code/{local → community}/Harapartners/ConnectorHub/Helper/Mcrypt.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/ConnectorHub/Helper/Object.php
RENAMED
File without changes
|
app/code/community/Harapartners/ConnectorHub/Model/Observer.php
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the End User Software Agreement (EULA).
|
6 |
+
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://www.harapartners.com/license
|
8 |
+
* If you did not receive a copy of the license and are unable to
|
9 |
+
* obtain it through the world-wide-web, please send an email
|
10 |
+
* to eula@harapartners.com so we can send you a copy immediately.
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
|
14 |
+
class Harapartners_ConnectorHub_Model_Observer {
|
15 |
+
|
16 |
+
// ============================== Observers ============================== //
|
17 |
+
public function adminhtmlOnlyCoreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer){
|
18 |
+
$block = $observer->getEvent()->getBlock();
|
19 |
+
$transportObject = $observer->getEvent()->getTransport();
|
20 |
+
if($block instanceof Mage_Page_Block_Html_Head){
|
21 |
+
$html = $transportObject->getHtml();
|
22 |
+
$html .= $this->_getJsonConfigWidgetCss();
|
23 |
+
$html .= $this->_getJsonConfigWidgetJs();
|
24 |
+
$transportObject->setHtml($html);
|
25 |
+
}
|
26 |
+
return;
|
27 |
+
}
|
28 |
+
|
29 |
+
protected function _getJsonConfigWidgetCss() {
|
30 |
+
$jsonConfigWidgetCss = <<< JSON_CONFIG_WIDGET_CSS
|
31 |
+
<style>
|
32 |
+
.json_config_widget_container thead{
|
33 |
+
background-color:#DFDFDF;
|
34 |
+
}
|
35 |
+
.json_config_widget_container th, .json_config_widget_container td{
|
36 |
+
padding:2px;
|
37 |
+
}
|
38 |
+
.json_config_widget_container td input{
|
39 |
+
text-align:right
|
40 |
+
}
|
41 |
+
.json_config_widget_container button{
|
42 |
+
margin:5px;
|
43 |
+
}
|
44 |
+
.json_config_widget_message_container .success{
|
45 |
+
font-weight: bold;
|
46 |
+
color: #3D6611
|
47 |
+
}
|
48 |
+
</style>
|
49 |
+
JSON_CONFIG_WIDGET_CSS;
|
50 |
+
return $jsonConfigWidgetCss;
|
51 |
+
}
|
52 |
+
|
53 |
+
protected function _getJsonConfigWidgetJs() {
|
54 |
+
$jsonConfigWidgetJs = <<< JSON_CONFIG_WIDGET_JS
|
55 |
+
<script type="text/javascript">
|
56 |
+
function JsonConfigWidget() {
|
57 |
+
|
58 |
+
var _const;
|
59 |
+
var _config;
|
60 |
+
var _elementId;
|
61 |
+
var _elementData; //JSON for maps, ARRAY for lists
|
62 |
+
var _renderMode;
|
63 |
+
|
64 |
+
// ==================== Controllers ==================== //
|
65 |
+
this.init = function (elementId, elementValue, elementConfig) {
|
66 |
+
this._const = {
|
67 |
+
contentMode: 0,
|
68 |
+
editMode: 1,
|
69 |
+
mapStructure: 'map',
|
70 |
+
listStructure: 'list'
|
71 |
+
}
|
72 |
+
this._elementId = elementId;
|
73 |
+
this._elementData = elementValue;
|
74 |
+
this._config = elementConfig;
|
75 |
+
this._renderMode = this._const.contentMode; //Default is content mode
|
76 |
+
|
77 |
+
var tableHead = "";
|
78 |
+
if(this._config.structure == this._const.mapStructure){
|
79 |
+
tableHead = "<tr><th>" + this._config.key_label + "</th><th>" + this._config.value_label + "</th></tr>";
|
80 |
+
}else if(this._config.structure == this._const.listStructure){
|
81 |
+
tableHead = "<tr><th>" + this._config.value_label + "</th></tr>";
|
82 |
+
}
|
83 |
+
var contentTemplate = '<div class="json_config_widget_message_container"></div>'
|
84 |
+
+ '<table border="1" style="border-collapse:collapse; text-align:right">'
|
85 |
+
+ '<thead class="json_config_widget_thead">' + tableHead + '</thead>'
|
86 |
+
+ '<tbody class="json_config_widget_tbody"></tbody>'
|
87 |
+
+ '</table>'
|
88 |
+
+ '<button type="button" class="scalable add json_config_widget_button_add" style="display: none"><span>Add Entry</span></button>'
|
89 |
+
+ '<button type="button" class="scalable save json_config_widget_button_confirm"><span>Edit</span></button>';
|
90 |
+
|
91 |
+
$(this._elementId + "_json_config_widget").update(contentTemplate);
|
92 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_add").first().observe('click', this.addInputObserver.bind(this));
|
93 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_confirm").first().observe('click', this.toggleViewObserver.bind(this));
|
94 |
+
this.renderContentView();
|
95 |
+
}
|
96 |
+
|
97 |
+
// ==================== Models ==================== //
|
98 |
+
this.processEditData = function () {
|
99 |
+
var tempDataDump = [];
|
100 |
+
$$("div#" + this._elementId + "_json_config_widget tbody.json_config_widget_tbody input").each(function (item){
|
101 |
+
tempDataDump[tempDataDump.length] = item.value;
|
102 |
+
});
|
103 |
+
if(this._config.structure == this._const.mapStructure){
|
104 |
+
if(tempDataDump.length%2 != 0){
|
105 |
+
this.showMessage('error', 'Invalid inputs.');
|
106 |
+
return false;
|
107 |
+
}
|
108 |
+
this._elementData = {};
|
109 |
+
for (var tempIndex=0; tempIndex<tempDataDump.length; tempIndex += 2){
|
110 |
+
cleanedJsonKey = tempDataDump[tempIndex].trim();
|
111 |
+
cleanedJsonValue = tempDataDump[tempIndex + 1].trim();
|
112 |
+
if(cleanedJsonKey.length == 0 && cleanedJsonValue.length == 0){
|
113 |
+
//Both empty rows are ignored
|
114 |
+
continue;
|
115 |
+
}
|
116 |
+
if(cleanedJsonKey.length == 0 || cleanedJsonValue.length == 0){
|
117 |
+
//Otherwise, either empty will be an error
|
118 |
+
this.showMessage('error', 'Missing input keys or values.');
|
119 |
+
return false;
|
120 |
+
}
|
121 |
+
this._elementData[cleanedJsonKey] = cleanedJsonValue;
|
122 |
+
}
|
123 |
+
}else if(this._config.structure == this._const.listStructure){
|
124 |
+
this._elementData = [];
|
125 |
+
for (var tempIndex=0; tempIndex<tempDataDump.length; tempIndex ++){
|
126 |
+
cleanedJsonValue = tempDataDump[tempIndex].trim();
|
127 |
+
if(cleanedJsonValue.length == 0){
|
128 |
+
continue;
|
129 |
+
}
|
130 |
+
this._elementData[tempIndex] = cleanedJsonValue;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
this.showMessage('success', 'Content udpated. Please make sure to save config.');
|
135 |
+
return true;
|
136 |
+
}
|
137 |
+
|
138 |
+
// ==================== Views ==================== //
|
139 |
+
this.showMessage = function (messageClass, messageContent) {
|
140 |
+
$$("div#" + this._elementId + "_json_config_widget div.json_config_widget_message_container").first().update('<span class="' + messageClass + '">' + messageContent + '</span>');
|
141 |
+
}
|
142 |
+
|
143 |
+
this.renderContentView = function () {
|
144 |
+
var tableContent = "";
|
145 |
+
if(this._config.structure == this._const.mapStructure){
|
146 |
+
for(jsonKey in this._elementData){
|
147 |
+
if(this._elementData.hasOwnProperty(jsonKey)){
|
148 |
+
jsonValue = this._elementData[jsonKey];
|
149 |
+
tableContent += "<tr><td>" + jsonKey + "</td><td>" + jsonValue + "</td></tr>";
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}else if(this._config.structure == this._const.listStructure){
|
153 |
+
for(var tempIndex = 0; tempIndex < this._elementData.length; tempIndex ++){
|
154 |
+
tableContent += "<tr><td>" + this._elementData[tempIndex] + "</td></tr>";
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
$$("div#" + this._elementId + "_json_config_widget tbody.json_config_widget_tbody").first().update(tableContent);
|
159 |
+
this._renderMode = this._const.contentMode;
|
160 |
+
};
|
161 |
+
|
162 |
+
this.renderEditView = function () {
|
163 |
+
var tableContent = "";
|
164 |
+
if(this._config.structure == this._const.mapStructure){
|
165 |
+
var dummyId = 0;
|
166 |
+
for(jsonKey in this._elementData){
|
167 |
+
if(this._elementData.hasOwnProperty(jsonKey)){
|
168 |
+
jsonValue = this._elementData[jsonKey];
|
169 |
+
tableContent += "<tr><td><input name='" + this._elementId + "_json_key_'" + dummyId + " value='" + jsonKey + "'/></td>"
|
170 |
+
+ "<td><input name='" + this._elementId + "_json_value_'" + dummyId + " value='" + jsonValue + "'/></td>";
|
171 |
+
dummyId ++;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}else if(this._config.structure == this._const.listStructure){
|
175 |
+
for(var tempIndex = 0; tempIndex < this._elementData.length; tempIndex ++){
|
176 |
+
tableContent += "<tr>"
|
177 |
+
+ "<td><input name='" + this._elementId + "_json_value_'" + tempIndex + " value='" + this._elementData[tempIndex] + "'/></td>";
|
178 |
+
}
|
179 |
+
}
|
180 |
+
$$("div#" + this._elementId + "_json_config_widget tbody.json_config_widget_tbody").first().update(tableContent);
|
181 |
+
|
182 |
+
//Automatically add input fields if the data is completely empty
|
183 |
+
if(this.isElementDataEmpty()){
|
184 |
+
this.addInput();
|
185 |
+
}
|
186 |
+
|
187 |
+
this._renderMode = this._const.editMode;
|
188 |
+
};
|
189 |
+
|
190 |
+
this.toggleView = function () {
|
191 |
+
if(this._renderMode == this._const.contentMode){
|
192 |
+
this.renderEditView();
|
193 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_add").first().show();
|
194 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_confirm").first().update("<span>Validate</span>");
|
195 |
+
return true;
|
196 |
+
}else if(this._renderMode == this._const.editMode){
|
197 |
+
//Basic validations
|
198 |
+
if(!this.processEditData()){
|
199 |
+
return false;
|
200 |
+
}
|
201 |
+
this.renderContentView();
|
202 |
+
$(this._elementId).writeAttribute('value', JSON.stringify(this._elementData));
|
203 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_add").first().hide();
|
204 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_confirm").first().update("<span>Edit</span>");
|
205 |
+
return true;
|
206 |
+
}
|
207 |
+
//Unknown status, default back to content view
|
208 |
+
this.renderContentView();
|
209 |
+
$$("div#" + this._elementId + "_json_config_widget button.json_config_widget_button_confirm").first().update("<span>Edit</span>");
|
210 |
+
return true;
|
211 |
+
}
|
212 |
+
|
213 |
+
this.addInput = function () {
|
214 |
+
var tempDataDump = [];
|
215 |
+
$$("div#" + this._elementId + "_json_config_widget tbody.json_config_widget_tbody input").each(function (item){
|
216 |
+
tempDataDump[tempDataDump.length] = item.value;
|
217 |
+
});
|
218 |
+
|
219 |
+
var tableContent = "";
|
220 |
+
if(this._config.structure == this._const.mapStructure){
|
221 |
+
tableContent += "<tr><td><input name='" + this._elementId + "_json_key_'" + (tempDataDump.length + 1) + " value=''/></td>"
|
222 |
+
+ "<td><input name='" + this._elementId + "_json_value_'" + (tempDataDump.length + 2) + " value=''/></td>";
|
223 |
+
}else if(this._config.structure == this._const.listStructure){
|
224 |
+
tableContent += "<tr><td><input name='" + this._elementId + "_json_value_'" + (tempDataDump.length + 1) + " value=''/></td>";
|
225 |
+
}
|
226 |
+
|
227 |
+
$$("div#" + this._elementId + "_json_config_widget tbody.json_config_widget_tbody").first().insert(tableContent);
|
228 |
+
return true;
|
229 |
+
}
|
230 |
+
|
231 |
+
// ==================== Oberservers ==================== //
|
232 |
+
this.toggleViewObserver = function (event) {
|
233 |
+
this.toggleView();
|
234 |
+
}
|
235 |
+
|
236 |
+
this.addInputObserver = function (event) {
|
237 |
+
this.addInput();
|
238 |
+
}
|
239 |
+
|
240 |
+
// ==================== Utilities ==================== //
|
241 |
+
this.isElementDataEmpty = function () {
|
242 |
+
if (this._elementData == null) return true;
|
243 |
+
if (this._elementData.length > 0) return false;
|
244 |
+
if (this._elementData.length === 0) return true;
|
245 |
+
for (var jsonKey in this._elementData) {
|
246 |
+
if (this._elementData.hasOwnProperty(jsonKey)) return false;
|
247 |
+
}
|
248 |
+
return true;
|
249 |
+
}
|
250 |
+
|
251 |
+
}
|
252 |
+
</script>
|
253 |
+
JSON_CONFIG_WIDGET_JS;
|
254 |
+
return $jsonConfigWidgetJs;
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
app/code/{local → community}/Harapartners/ConnectorHub/Model/Rewrite/Paypal/Api/Nvp.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/ConnectorHub/Model/Rewrite/Paypal/Config.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/ConnectorHub/etc/config.xml
RENAMED
@@ -19,6 +19,11 @@
|
|
19 |
</Harapartners_ConnectorHub>
|
20 |
</modules>
|
21 |
<global>
|
|
|
|
|
|
|
|
|
|
|
22 |
<models>
|
23 |
<connectorhub>
|
24 |
<class>Harapartners_ConnectorHub_Model</class>
|
@@ -37,11 +42,25 @@
|
|
37 |
</connectorhub>
|
38 |
</helpers>
|
39 |
</global>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<default>
|
41 |
<connectorhub>
|
42 |
-
<
|
43 |
-
<
|
44 |
-
</
|
45 |
</connectorhub>
|
46 |
<paypal>
|
47 |
<!-- /* Compatibility for Staging server SSL verification */ -->
|
19 |
</Harapartners_ConnectorHub>
|
20 |
</modules>
|
21 |
<global>
|
22 |
+
<blocks>
|
23 |
+
<connectorhub>
|
24 |
+
<class>Harapartners_ConnectorHub_Block</class>
|
25 |
+
</connectorhub>
|
26 |
+
</blocks>
|
27 |
<models>
|
28 |
<connectorhub>
|
29 |
<class>Harapartners_ConnectorHub_Model</class>
|
42 |
</connectorhub>
|
43 |
</helpers>
|
44 |
</global>
|
45 |
+
<adminhtml>
|
46 |
+
<events>
|
47 |
+
<core_block_abstract_to_html_after>
|
48 |
+
<!-- Modifying admin layouts, e.g. adding buttons to widgets -->
|
49 |
+
<observers>
|
50 |
+
<connectorhub_adminhtml_only_core_block_abstract_to_html_after>
|
51 |
+
<type>singleton</type>
|
52 |
+
<class>connectorhub/observer</class>
|
53 |
+
<method>adminhtmlOnlyCoreBlockAbstractToHtmlAfter</method>
|
54 |
+
</connectorhub_adminhtml_only_core_block_abstract_to_html_after>
|
55 |
+
</observers>
|
56 |
+
</core_block_abstract_to_html_after>
|
57 |
+
</events>
|
58 |
+
</adminhtml>
|
59 |
<default>
|
60 |
<connectorhub>
|
61 |
+
<global_config>
|
62 |
+
<service_base_url>https://connectorhub.harapartners.com/</service_base_url>
|
63 |
+
</global_config>
|
64 |
</connectorhub>
|
65 |
<paypal>
|
66 |
<!-- /* Compatibility for Staging server SSL verification */ -->
|
app/code/{local → community}/Harapartners/SpeedTax/Block/Adminhtml/System/Config/Form/Field/Authentication.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Helper/Connector/Data.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Helper/Connector/Speedtax.php
RENAMED
@@ -43,17 +43,20 @@ class Harapartners_SpeedTax_Helper_Connector_Speedtax extends Harapartners_Conne
|
|
43 |
|
44 |
protected function _prepareCredentials(){
|
45 |
$username = Mage::getStoreConfig($this->_getConfigDataBasePath('username'));
|
46 |
-
$password = Mage::getStoreConfig($this->_getConfigDataBasePath('password'));
|
47 |
-
$password = Mage::helper('core')->decrypt($password);
|
48 |
-
|
49 |
$companyCode = Mage::getStoreConfig($this->_getConfigDataBasePath('company_code'));
|
50 |
$isTestMode = Mage::getStoreConfig($this->_getConfigDataBasePath('is_test_mode'));
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
$credentials = array(
|
53 |
'username' => $username,
|
54 |
'password' => $password,
|
55 |
'company_code' => $companyCode,
|
56 |
-
'
|
57 |
);
|
58 |
return $credentials;
|
59 |
}
|
43 |
|
44 |
protected function _prepareCredentials(){
|
45 |
$username = Mage::getStoreConfig($this->_getConfigDataBasePath('username'));
|
46 |
+
$password = Mage::helper('core')->decrypt(Mage::getStoreConfig($this->_getConfigDataBasePath('password')));
|
|
|
|
|
47 |
$companyCode = Mage::getStoreConfig($this->_getConfigDataBasePath('company_code'));
|
48 |
$isTestMode = Mage::getStoreConfig($this->_getConfigDataBasePath('is_test_mode'));
|
49 |
+
if(!!$isTestMode){
|
50 |
+
$serviceMode = Harapartners_ConnectorHub_Helper_Connector_Core::REQUEST_SERVICE_MODE_TEST;
|
51 |
+
}else{
|
52 |
+
$serviceMode = Harapartners_ConnectorHub_Helper_Connector_Core::REQUEST_SERVICE_MODE_PRODUCTION;
|
53 |
+
}
|
54 |
|
55 |
$credentials = array(
|
56 |
'username' => $username,
|
57 |
'password' => $password,
|
58 |
'company_code' => $companyCode,
|
59 |
+
'service_mode' => $serviceMode
|
60 |
);
|
61 |
return $credentials;
|
62 |
}
|
app/code/{local → community}/Harapartners/SpeedTax/Helper/Data.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Helper/Processor.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Model/Observer.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Model/Rewrite/Tax/Sales/Total/Quote/Tax.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Model/Session.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/Model/Source/Usregions.php
RENAMED
File without changes
|
app/code/{local → community}/Harapartners/SpeedTax/controllers/Adminhtml/System/Config/AjaxController.php
RENAMED
@@ -19,15 +19,23 @@ class Harapartners_SpeedTax_Adminhtml_System_Config_AjaxController extends Mage_
|
|
19 |
$password = $this->getRequest()->getParam('password');
|
20 |
$companyCode = $this->getRequest()->getParam('company_code');
|
21 |
$isTestMode = $this->getRequest()->getParam('is_test_mode');
|
|
|
22 |
//Check encrypted config
|
23 |
if (preg_match('/^\*+$/', $password)) {
|
24 |
$password = Mage::helper('core')->decrypt(Mage::getStoreConfig('speedtax/speedtax/password'));
|
25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
$credentials = array(
|
27 |
'username' => $username,
|
28 |
'password' => $password,
|
29 |
'company_code' => $companyCode,
|
30 |
-
'
|
31 |
);
|
32 |
|
33 |
//auth_token and data_token are handled within
|
19 |
$password = $this->getRequest()->getParam('password');
|
20 |
$companyCode = $this->getRequest()->getParam('company_code');
|
21 |
$isTestMode = $this->getRequest()->getParam('is_test_mode');
|
22 |
+
|
23 |
//Check encrypted config
|
24 |
if (preg_match('/^\*+$/', $password)) {
|
25 |
$password = Mage::helper('core')->decrypt(Mage::getStoreConfig('speedtax/speedtax/password'));
|
26 |
}
|
27 |
+
|
28 |
+
if(!!$isTestMode){
|
29 |
+
$serviceMode = Harapartners_ConnectorHub_Helper_Connector_Core::REQUEST_SERVICE_MODE_TEST;
|
30 |
+
}else{
|
31 |
+
$serviceMode = Harapartners_ConnectorHub_Helper_Connector_Core::REQUEST_SERVICE_MODE_PRODUCTION;
|
32 |
+
}
|
33 |
+
|
34 |
$credentials = array(
|
35 |
'username' => $username,
|
36 |
'password' => $password,
|
37 |
'company_code' => $companyCode,
|
38 |
+
'service_mode' => $serviceMode
|
39 |
);
|
40 |
|
41 |
//auth_token and data_token are handled within
|
app/code/{local → community}/Harapartners/SpeedTax/etc/config.xml
RENAMED
@@ -15,7 +15,7 @@
|
|
15 |
<config>
|
16 |
<modules>
|
17 |
<Harapartners_SpeedTax>
|
18 |
-
<version>3.1.
|
19 |
</Harapartners_SpeedTax>
|
20 |
</modules>
|
21 |
<global>
|
15 |
<config>
|
16 |
<modules>
|
17 |
<Harapartners_SpeedTax>
|
18 |
+
<version>3.1.6</version>
|
19 |
</Harapartners_SpeedTax>
|
20 |
</modules>
|
21 |
<global>
|
app/code/{local → community}/Harapartners/SpeedTax/etc/system.xml
RENAMED
@@ -89,7 +89,7 @@
|
|
89 |
</company_code>
|
90 |
<is_test_mode translate="label">
|
91 |
<label>Test Mode</label>
|
92 |
-
<comment
|
93 |
<frontend_type>select</frontend_type>
|
94 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
95 |
<sort_order>125</sort_order>
|
@@ -119,7 +119,7 @@
|
|
119 |
</tax_shipping>
|
120 |
<origins translate="label">
|
121 |
<label>Nexus</label>
|
122 |
-
<comment><![CDATA[Multiple-select. Select all states where you have nexus and want sales taxes to be used for.]]></comment>
|
123 |
<frontend_type>multiselect</frontend_type>
|
124 |
<sort_order>350</sort_order>
|
125 |
<source_model>speedtax/source_usregions</source_model>
|
89 |
</company_code>
|
90 |
<is_test_mode translate="label">
|
91 |
<label>Test Mode</label>
|
92 |
+
<comment><![CDATA[Switching between test and production accounts.<br/> Please make sure to select the correct account with your credentials.]]></comment>
|
93 |
<frontend_type>select</frontend_type>
|
94 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
95 |
<sort_order>125</sort_order>
|
119 |
</tax_shipping>
|
120 |
<origins translate="label">
|
121 |
<label>Nexus</label>
|
122 |
+
<comment><![CDATA[Multiple-select. Select <b style="color: red;">all states</b> where you have nexus and want sales taxes to be used for.]]></comment>
|
123 |
<frontend_type>multiselect</frontend_type>
|
124 |
<sort_order>350</sort_order>
|
125 |
<source_model>speedtax/source_usregions</source_model>
|
app/code/{local → community}/Harapartners/SpeedTax/sql/speedtax_setup/mysql4-upgrade-3.0.9-3.1.0.php
RENAMED
File without changes
|
app/etc/modules/Harapartners_SpeedTax.xml
CHANGED
@@ -17,6 +17,9 @@
|
|
17 |
<Harapartners_SpeedTax>
|
18 |
<active>true</active>
|
19 |
<codePool>local</codePool>
|
|
|
|
|
|
|
20 |
</Harapartners_SpeedTax>
|
21 |
</modules>
|
22 |
</config>
|
17 |
<Harapartners_SpeedTax>
|
18 |
<active>true</active>
|
19 |
<codePool>local</codePool>
|
20 |
+
<depends>
|
21 |
+
<Harapartners_ConnectorHub/>
|
22 |
+
</depends>
|
23 |
</Harapartners_SpeedTax>
|
24 |
</modules>
|
25 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SalesTax_Connector</name>
|
4 |
-
<version>3.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.harapartners.com/terms/eula">Hara Partners End User License Agreement</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Simplify sales and use tax calculation, compliance, and management in the cloud
|
10 |
-
<description>Simplify sales and use tax calculation, compliance, and management in the cloud
|
11 |
-
<notes>Simplify sales and use tax calculation, compliance, and management in the cloud
|
12 |
-
<authors><author><name>Ken Nunes</name><user>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
-
<dependencies
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SalesTax_Connector</name>
|
4 |
+
<version>3.1.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.harapartners.com/terms/eula">Hara Partners End User License Agreement</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Simplify sales and use tax calculation, compliance, and management in the cloud! </summary>
|
10 |
+
<description>Simplify sales and use tax calculation, compliance, and management in the cloud! </description>
|
11 |
+
<notes>Simplify sales and use tax calculation, compliance, and management in the cloud! </notes>
|
12 |
+
<authors><author><name>Ken Nunes</name><user>kennuneswo</user><email>ken.nunes@wolterskluwer.com</email></author></authors>
|
13 |
+
<date>2014-02-18</date>
|
14 |
+
<time>00:24:52</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Harapartners"><dir name="SpeedTax"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Authentication.php" hash="8be5a91c0aa3d23ced5a2852b940dac3"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><dir name="Connector"><file name="Data.php" hash="4ae2eb94b6cf797eef7e2a7a8249e073"/><file name="Speedtax.php" hash="b81e16f25f4f51a6544c44301ec00667"/></dir><file name="Data.php" hash="4a3805bc334300c5b79afa89a3330be6"/><file name="Processor.php" hash="600241518208610cc76ffd6051d1cb6a"/></dir><dir name="Model"><file name="Observer.php" hash="609d1237bc2eddedeb629ed322540fc8"/><dir name="Rewrite"><dir name="Tax"><dir name="Sales"><dir name="Total"><dir name="Quote"><file name="Tax.php" hash="00a4b49781a30b5b19ea82b083dcd2df"/></dir></dir></dir></dir></dir><file name="Session.php" hash="46175fe01434d91757499d5c0f7f2bee"/><dir name="Source"><file name="Usregions.php" hash="2ab7713b5b46f142e133459952cd1ef5"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="AjaxController.php" hash="fbb6a35c7f2c0706f39160413ced8b2f"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="5021e1fc50747a23d68b9d0e00721e85"/><file name="system.xml" hash="945c43e0653cbdb934578cae6039a830"/></dir><dir name="sql"><dir name="speedtax_setup"><file name="mysql4-upgrade-3.0.9-3.1.0.php" hash="886b0ebdd5b0234b89fcff5fc07fbfd1"/></dir></dir></dir><dir name="ConnectorHub"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Json.php" hash="9dfc33f951be4c545c757e7d9724eb8c"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><dir name="Connector"><file name="Config.php" hash="ded948bc18c602d6fc9c148cd826245a"/><file name="Core.php" hash="503eddf9049c7f7fc0b0494a51d21b5d"/></dir><file name="Mcrypt.php" hash="928572b4884d60f03ecde04b63186ea2"/><file name="Object.php" hash="487cd77c21c8bb9dec6189cc19d8c6a5"/></dir><dir name="Model"><file name="Observer.php" hash="d6d7f852fbde7e14e6fdd5f7c75e77cd"/><dir name="Rewrite"><dir name="Paypal"><dir name="Api"><file name="Nvp.php" hash="e260f23f4093e7932286f81bf48f855a"/></dir><file name="Config.php" hash="41db0559b01ef40fa3a33e85a416d016"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4e0fc6a2496f4f7b871b8e389ff11b39"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Harapartners_SpeedTax.xml" hash="eb9e312adde3ebeecbceb8f8c4045862"/><file name="Harapartners_ConnectorHub.xml" hash="77e80f0f2d28c0ff45b869d467b49bbf"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|