Version Notes
- Added ability to log requests to a file
- Sh_company field is populated properly
Download this release
Release Info
Developer | Magento Core Team |
Extension | Eabi_DpdEE |
Version | 0.1.13 |
Comparing to | |
See all releases |
Code changes from version 0.1.12 to 0.1.13
- app/code/community/Eabi/DpdEE/CHANGELOG.txt +4 -0
- app/code/community/Eabi/DpdEE/Model/Api.php +42 -0
- app/code/community/Eabi/DpdEE/Model/Post.php +1 -1
- app/code/community/Eabi/DpdEE/etc/config.xml +1 -1
- app/code/community/Eabi/DpdEE/etc/system.xml +16 -1
- app/etc/modules/Eabi_DpdEE.xml +1 -1
- package.xml +6 -5
app/code/community/Eabi/DpdEE/CHANGELOG.txt
CHANGED
@@ -40,4 +40,8 @@
|
|
40 |
0.1.12
|
41 |
- Added various improvements to Eabi_Postoffice package, required to update only if you are using modules, which depend on those updates
|
42 |
|
|
|
|
|
|
|
|
|
43 |
|
40 |
0.1.12
|
41 |
- Added various improvements to Eabi_Postoffice package, required to update only if you are using modules, which depend on those updates
|
42 |
|
43 |
+
0.1.13
|
44 |
+
- Added ability to log requests to a file
|
45 |
+
- Sh_company field is populated properly
|
46 |
+
|
47 |
|
app/code/community/Eabi/DpdEE/Model/Api.php
CHANGED
@@ -179,15 +179,55 @@ class Eabi_DpdEE_Model_Api extends Varien_Object {
|
|
179 |
$client->setConfig($options);
|
180 |
$client->setParameterPost($params);
|
181 |
$resp = $client->request(Zend_Http_Client::POST);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
$decodeResult = @json_decode($resp->getBody(), true);
|
183 |
if (!is_array($decodeResult) || !isset($decodeResult['Error_code'])
|
184 |
|| $decodeResult['Error_code'] !== 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
Mage::throwException($this->_getDpdHelper()->__('DPD request failed with response: %s', print_r($decodeResult, true)));
|
186 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
return $decodeResult;
|
188 |
}
|
189 |
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
192 |
/**
|
193 |
*
|
@@ -197,6 +237,8 @@ class Eabi_DpdEE_Model_Api extends Varien_Object {
|
|
197 |
return Mage::helper('eabi_dpdee');
|
198 |
}
|
199 |
|
|
|
|
|
200 |
/**
|
201 |
*
|
202 |
* @return Eabi_Postoffice_Helper_Data
|
179 |
$client->setConfig($options);
|
180 |
$client->setParameterPost($params);
|
181 |
$resp = $client->request(Zend_Http_Client::POST);
|
182 |
+
$dataToLog = array(
|
183 |
+
'url' => $url,
|
184 |
+
'method' => Zend_Http_Client::POST,
|
185 |
+
'params' => $this->_debugReplace($params),
|
186 |
+
);
|
187 |
+
|
188 |
+
|
189 |
$decodeResult = @json_decode($resp->getBody(), true);
|
190 |
if (!is_array($decodeResult) || !isset($decodeResult['Error_code'])
|
191 |
|| $decodeResult['Error_code'] !== 0) {
|
192 |
+
if (!$decodeResult) {
|
193 |
+
$dataToLog['response'] = $resp;
|
194 |
+
} else {
|
195 |
+
$dataToLog['response'] = $decodeResult;
|
196 |
+
}
|
197 |
+
if ($this->_isLogEnabled()) {
|
198 |
+
Mage::log($dataToLog, Zend_Log::ERR, __CLASS__ . '.log');
|
199 |
+
}
|
200 |
+
|
201 |
Mage::throwException($this->_getDpdHelper()->__('DPD request failed with response: %s', print_r($decodeResult, true)));
|
202 |
}
|
203 |
+
$dataToLog['response'] = $decodeResult;
|
204 |
+
// $dataToLog['client'] = $client;
|
205 |
+
if ($this->_isLogEnabled()) {
|
206 |
+
Mage::log($dataToLog, Zend_Log::DEBUG, __CLASS__ . '.log');
|
207 |
+
}
|
208 |
+
|
209 |
return $decodeResult;
|
210 |
}
|
211 |
|
212 |
|
213 |
+
protected function _debugReplace($params) {
|
214 |
+
$res = $params;
|
215 |
+
$toReplace = array(
|
216 |
+
'User_login',
|
217 |
+
'User_password',
|
218 |
+
);
|
219 |
+
foreach ($toReplace as $replace) {
|
220 |
+
if (isset($res[$replace])) {
|
221 |
+
$res[$replace] = '***';
|
222 |
+
}
|
223 |
+
}
|
224 |
+
return $res;
|
225 |
+
}
|
226 |
+
|
227 |
+
|
228 |
+
protected function _isLogEnabled() {
|
229 |
+
return $this->getConfigData('enable_log');
|
230 |
+
}
|
231 |
|
232 |
/**
|
233 |
*
|
237 |
return Mage::helper('eabi_dpdee');
|
238 |
}
|
239 |
|
240 |
+
|
241 |
+
|
242 |
/**
|
243 |
*
|
244 |
* @return Eabi_Postoffice_Helper_Data
|
app/code/community/Eabi/DpdEE/Model/Post.php
CHANGED
@@ -197,7 +197,7 @@ class Eabi_DpdEE_Model_Post extends Eabi_Postoffice_Model_Carrier_Abstract {
|
|
197 |
$selectedOffice = $this->getTerminal($selectedOfficeId);
|
198 |
$requestData = array(
|
199 |
'Sh_name' => $shippingAddress->getName(),
|
200 |
-
'Sh_company' =>
|
201 |
'Sh_street' => $this->_getStreetFromDescription($selectedOffice),
|
202 |
'Sh_postal' => $selectedOffice->getZipCode(),
|
203 |
'Sh_country' => strtolower($selectedOffice->getCountry()),
|
197 |
$selectedOffice = $this->getTerminal($selectedOfficeId);
|
198 |
$requestData = array(
|
199 |
'Sh_name' => $shippingAddress->getName(),
|
200 |
+
'Sh_company' => $shippingAddress->getCompany(),
|
201 |
'Sh_street' => $this->_getStreetFromDescription($selectedOffice),
|
202 |
'Sh_postal' => $selectedOffice->getZipCode(),
|
203 |
'Sh_country' => strtolower($selectedOffice->getCountry()),
|
app/code/community/Eabi/DpdEE/etc/config.xml
CHANGED
@@ -36,7 +36,7 @@
|
|
36 |
<config>
|
37 |
<modules>
|
38 |
<Eabi_DpdEE>
|
39 |
-
<version>0.1.
|
40 |
</Eabi_DpdEE>
|
41 |
</modules>
|
42 |
|
36 |
<config>
|
37 |
<modules>
|
38 |
<Eabi_DpdEE>
|
39 |
+
<version>0.1.13</version>
|
40 |
</Eabi_DpdEE>
|
41 |
</modules>
|
42 |
|
app/code/community/Eabi/DpdEE/etc/system.xml
CHANGED
@@ -568,10 +568,25 @@
|
|
568 |
<show_in_website>1</show_in_website>
|
569 |
<show_in_store>1</show_in_store>
|
570 |
</sort_order>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
571 |
<removal translate="">
|
572 |
<label></label>
|
573 |
<frontend_model>eabi_postoffice/adminhtml_config_form_field_remove</frontend_model>
|
574 |
-
<sort_order>
|
575 |
<show_in_default>1</show_in_default>
|
576 |
<show_in_website>0</show_in_website>
|
577 |
<show_in_store>0</show_in_store>
|
568 |
<show_in_website>1</show_in_website>
|
569 |
<show_in_store>1</show_in_store>
|
570 |
</sort_order>
|
571 |
+
<enable_log translate="label comment">
|
572 |
+
<label>Log API requests</label>
|
573 |
+
<comment>Log file will be located under /var/log directory</comment>
|
574 |
+
<frontend_type>select</frontend_type>
|
575 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
576 |
+
<sort_order>1000030</sort_order>
|
577 |
+
<show_in_default>1</show_in_default>
|
578 |
+
<show_in_website>0</show_in_website>
|
579 |
+
<show_in_store>0</show_in_store>
|
580 |
+
<depends>
|
581 |
+
<senddata_enable>1</senddata_enable>
|
582 |
+
</depends>
|
583 |
+
</enable_log>
|
584 |
+
|
585 |
+
|
586 |
<removal translate="">
|
587 |
<label></label>
|
588 |
<frontend_model>eabi_postoffice/adminhtml_config_form_field_remove</frontend_model>
|
589 |
+
<sort_order>1000031</sort_order>
|
590 |
<show_in_default>1</show_in_default>
|
591 |
<show_in_website>0</show_in_website>
|
592 |
<show_in_store>0</show_in_store>
|
app/etc/modules/Eabi_DpdEE.xml
CHANGED
@@ -39,7 +39,7 @@
|
|
39 |
<depends>
|
40 |
<Eabi_Postoffice />
|
41 |
</depends>
|
42 |
-
<version>0.1.
|
43 |
</Eabi_DpdEE>
|
44 |
</modules>
|
45 |
</config>
|
39 |
<depends>
|
40 |
<Eabi_Postoffice />
|
41 |
</depends>
|
42 |
+
<version>0.1.13</version>
|
43 |
</Eabi_DpdEE>
|
44 |
</modules>
|
45 |
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eabi_DpdEE</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-3.0.txt">GNU Public License V3.0</license>
|
7 |
<channel>community</channel>
|
@@ -17,11 +17,12 @@
|
|
17 |
<p>Allows to call the courier from Magento admin</p>
|
18 |
<p>Allows cash on delivery payment and allows to set an extra fee per country which will be appended to shipping fee</p>
|
19 |
<p>Intended to use for Estonian merchant who sends parcels to all Baltic states</p></description>
|
20 |
-
<notes>- Added
|
|
|
21 |
<authors><author><name>Matis Matis</name><user>auto-converted</user><email>info@e-abi.ee</email></author></authors>
|
22 |
-
<date>2015-
|
23 |
-
<time>
|
24 |
-
<contents><target name="magecommunity"><dir name="Eabi"><dir name="DpdEE"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Country.php" hash="eea442b65d8f6a096e91c3087aa7a1d8"/></dir></dir></dir></dir><dir name="Info"><file name="Payment.php" hash="b2fee225c6e1d5df02cf39b46aa0f8b2"/></dir><dir name="Order"><file name="Courier.php" hash="190bec01b67a7c3da0b08d6ec44315e4"/></dir><file name="Invoice.php" hash="4b66c452996bfe08f5ff3f0cac346ab1"/></dir><dir name="Helper"><file name="Data.php" hash="e309fa33bbd4eb0d0b607b9428313837"/></dir><dir name="Model"><dir name="Action"><dir name="Carrier"><dir name="Order"><file name="Courier.php" hash="a7188340758f43b53302cd0146467daf"/></dir></dir></dir><dir name="Button"><file name="Courier.php" hash="e18911389141943fb0aa02de7c14574b"/></dir><dir name="Payment"><file name="Processor.php" hash="0cd6e6138c88069b36eae2e37e8e73ff"/></dir><dir name="Source"><dir name="Label"><file name="Position.php" hash="92238059519dcdec87401ef8cafe3fe7"/></dir><file name="Service.php" hash="3f61777107806dd84e360c3d0867b2bb"/></dir><file name="Api.php" hash="
|
25 |
<compatible/>
|
26 |
<dependencies><required><package><name>Eabi_Livehandler</name><channel>community</channel><min>0.1.9</min><max>1.0.0</max></package></required></dependencies>
|
27 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Eabi_DpdEE</name>
|
4 |
+
<version>0.1.13</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.gnu.org/licenses/gpl-3.0.txt">GNU Public License V3.0</license>
|
7 |
<channel>community</channel>
|
17 |
<p>Allows to call the courier from Magento admin</p>
|
18 |
<p>Allows cash on delivery payment and allows to set an extra fee per country which will be appended to shipping fee</p>
|
19 |
<p>Intended to use for Estonian merchant who sends parcels to all Baltic states</p></description>
|
20 |
+
<notes>- Added ability to log requests to a file
|
21 |
+
- Sh_company field is populated properly</notes>
|
22 |
<authors><author><name>Matis Matis</name><user>auto-converted</user><email>info@e-abi.ee</email></author></authors>
|
23 |
+
<date>2015-02-02</date>
|
24 |
+
<time>21:47:28</time>
|
25 |
+
<contents><target name="magecommunity"><dir name="Eabi"><dir name="DpdEE"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Country.php" hash="eea442b65d8f6a096e91c3087aa7a1d8"/></dir></dir></dir></dir><dir name="Info"><file name="Payment.php" hash="b2fee225c6e1d5df02cf39b46aa0f8b2"/></dir><dir name="Order"><file name="Courier.php" hash="190bec01b67a7c3da0b08d6ec44315e4"/></dir><file name="Invoice.php" hash="4b66c452996bfe08f5ff3f0cac346ab1"/></dir><dir name="Helper"><file name="Data.php" hash="e309fa33bbd4eb0d0b607b9428313837"/></dir><dir name="Model"><dir name="Action"><dir name="Carrier"><dir name="Order"><file name="Courier.php" hash="a7188340758f43b53302cd0146467daf"/></dir></dir></dir><dir name="Button"><file name="Courier.php" hash="e18911389141943fb0aa02de7c14574b"/></dir><dir name="Payment"><file name="Processor.php" hash="0cd6e6138c88069b36eae2e37e8e73ff"/></dir><dir name="Source"><dir name="Label"><file name="Position.php" hash="92238059519dcdec87401ef8cafe3fe7"/></dir><file name="Service.php" hash="3f61777107806dd84e360c3d0867b2bb"/></dir><file name="Api.php" hash="94bbc0acd12f6b581f83a1ee561d9ed1"/><file name="Config.php" hash="9adeafdbd2cf7a15128f2ff9b5dacdee"/><file name="Flat.php" hash="77975d48ae295ae15e0b6bc49319856e"/><file name="Observer.php" hash="2c1b22592eb9d7361fe2f42545f75b63"/><file name="Post.php" hash="f13e545870f3f0eb0ded19918f36b232"/></dir><dir name="etc"><file name="config.xml" hash="e197a118a785ca2f920d32984cd25fe9"/><file name="system.xml" hash="7716b29a17916c43d364fa12042ce841"/></dir><dir name="sql"><dir name="eabi_dpdee_setup"><file name="mysql4-install-0.1.0.php" hash="9899be85206a5ab3a36cf9acf176f1ba"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="867f9921932996c3a0f77fa9bb2fdb04"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="182c47a3d5fab4a466a07ef996dfe4d1"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="6a7ef422fd05c87c0c7b29557cd064ae"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="3c20db4f5d9de485f51b4cb28ca9eb87"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="d54424c11c48db64ed514ced1df4d60c"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="52c70756d6542e054699d922f752e123"/></dir></dir><file name="CHANGELOG.txt" hash="ad37ec3e170f4101e9eb351eaaa40e91"/><file name="LICENCE.txt" hash="0191312e121c0b3e1165619b96efcf9f"/></dir><dir name="Postoffice"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Form"><dir name="Field"><file name="License.php" hash="5d3e88fcea3dc7352254910c60d43cc8"/><file name="Remove.php" hash="11818c816c7e37c0f37e8732d02d7711"/></dir></dir></dir></dir><dir name="Config"><file name="Rebuildbutton.php" hash="b54ac12fa93514f5fd772e4512be945e"/></dir></dir><dir name="Helper"><file name="Countrycode.php" hash="11b598e6008f18baa7dafc3b579c6c96"/><file name="Data.php" hash="5aacd52d6c3066b54efe5cbfdb1b21fb"/></dir><dir name="Model"><dir name="Carrier"><file name="Abstract.php" hash="fa1921a37bfe61849b9a59f9f141a5dc"/><file name="Result.php" hash="452b5250a1eeaa2647106d896f170f0e"/></dir><dir name="Mysql4"><dir name="Carriermodule"><file name="Collection.php" hash="8ccfde755a7ef4d3eecb09144919ae9a"/></dir><dir name="Office"><file name="Collection.php" hash="26894ab3a3079edf21a722b46d495d07"/></dir><file name="Carriermodule.php" hash="06fb7663d449a1a559e482807e8a8e9e"/><file name="Office.php" hash="f1ab374d9041692dabd1a1c569bc5065"/></dir><dir name="Source"><file name="Sendevent.php" hash="4d0a215ab10eb52c4de46a66155899b8"/></dir><file name="Carriermodule.php" hash="cc4ad05756dc8f8fbb66e5a3561d61ea"/><file name="Observer.php" hash="5c4c236b268c5929e5d1a844a0eb9f6c"/><file name="Office.php" hash="6f3829a91a2d3c474f0127de8e8279da"/><file name="Orderview.php" hash="9654a4b6c60f3c9d07930b56957f22f7"/><file name="Updater.php" hash="1bd7d37a9a2e814e85a14b3c669ef4ba"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PostofficeController.php" hash="b837fb1ef3e17f1d7f49c1c8ef516e67"/></dir><file name="IndexController.php" hash="f287fec34c6d0422287da972634f40bb"/></dir><dir name="etc"><file name="config.xml" hash="84f2ab91bdef934f29d61a385eb597d0"/></dir><dir name="sql"><dir name="eabi_postoffice_setup"><file name="mysql4-install-0.1.0.php" hash="6c8c1a726bbebeaa707b007bdff592d9"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="641d3015c6f3b761759a882ed8fea5c2"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="c61dcac734cc0be364afe3262a710729"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="2a71344a96b5b5ef191956443fa2eadb"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="d8e6cf582360e0fa6141f802d97e9606"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="eabi_dpdee.xml" hash="85311cb850eb13eadaed47cdc9c44fb3"/><file name="eabi_postoffice.xml" hash="46fd01fc2eb9d53c0e7a0422e4df6557"/></dir><dir name="template"><dir name="eabi_dpdee"><dir name="order"><file name="courier.phtml" hash="0310f24e96ca3873e78e0e2a0ab26743"/></dir><file name="payment_info.phtml" hash="3f8a01e4bcd2efab555d729bee8335da"/></dir><dir name="eabi_postoffice"><file name="shipping_method_form.phtml" hash="542898a02261b0bccf075424fd0b4903"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="eabi_dpdee.xml" hash="27179eee219a0a8c85b87b8d670ae9e1"/><file name="eabi_postoffice.xml" hash="09c7179fbf39ea891fa35264e4eb8360"/></dir><dir name="template"><dir name="eabi_dpdee"><file name="payment_info.phtml" hash="3f8a01e4bcd2efab555d729bee8335da"/></dir><dir name="eabi_postoffice"><dir name="tracking"><file name="popup.phtml" hash="c6d8cc592aaa7bee1ec20dc1c202d841"/></dir><file name="available.phtml" hash="0afb1521ac8c2ab4c80364dd3cef051a"/><file name="multishipping.phtml" hash="f27c3d8ac939a97ab160feef8f5370d1"/><file name="shipping.phtml" hash="b041efafbcbbea2f2b4a6584cba83e2f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Eabi_Postoffice.xml" hash="48e85ab626ffb18ff5afa36ae679588e"/><file name="Eabi_DpdEE.xml" hash="161e0d1639e0210a7ba81236e24e3dd2"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Eabi_DpdEE.csv" hash="d98963cb668ca0c0174b1503c1eb0a34"/><file name="Eabi_Postoffice.csv" hash="ebe39d7d5df2083aded7a85be7d237e8"/></dir><dir name="et_EE"><file name="Eabi_DpdEE.csv" hash="fe3c32249528cfb77519cff7e90ffb33"/><file name="Eabi_Postoffice.csv" hash="0cb3f5bcc2f07e0a11152f5e51620063"/></dir><dir name="ru_RU"><file name="Eabi_DpdEE.csv" hash="bb76f70e2c91160b11f570651ee0b8ee"/><file name="Eabi_Postoffice.csv" hash="fb913aabfe19bb95b89bcbdb878e715c"/></dir><dir name="hu_HU"><file name="Eabi_Postoffice.csv" hash="fb913aabfe19bb95b89bcbdb878e715c"/></dir><dir name="fi_FI"><file name="Eabi_Postoffice.csv" hash="fb913aabfe19bb95b89bcbdb878e715c"/></dir><dir name="lt_LT"><file name="Eabi_Postoffice.csv" hash="fb913aabfe19bb95b89bcbdb878e715c"/></dir><dir name="sv_SE"><file name="Eabi_Postoffice.csv" hash="88e407afb5e2a957aeb1cbe525e593f9"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="eabi_dpdee.css" hash="fc08519f26a3b0819b4c925bd2f1ef1a"/><file name="eabi_postoffice.css" hash="e3f33b57efde22b9543384b57c994255"/></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="eabi_postoffice.css" hash="23ee780980d733a66a575a55954dd4a6"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="css"><file name="eabi_postoffice.css" hash="23ee780980d733a66a575a55954dd4a6"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="eabi_js"><file name="eabi_dpdee.js" hash="1339c149edea070f9908ceb2e7bf559d"/></dir></dir></target></contents>
|
26 |
<compatible/>
|
27 |
<dependencies><required><package><name>Eabi_Livehandler</name><channel>community</channel><min>0.1.9</min><max>1.0.0</max></package></required></dependencies>
|
28 |
</package>
|