Version Notes
Enterprise class global currency exchange rates
Download this release
Release Info
Developer | nFusion Solutions |
Extension | Nfusionsolutions_CurrencyExchangeRates |
Version | 2.1.0.13 |
Comparing to | |
See all releases |
Version 2.1.0.13
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/Helper/Data.php +77 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/Model/Adminhtml/System/Config/Source/Type.php +33 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/Model/Currencyexchangerate.php +64 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/Model/Resource/Setup.php +25 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/etc/adminhtml.xml +66 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/etc/config.xml +90 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/etc/system.xml +85 -0
- app/code/community/Nfusionsolutions/CurrencyExchangeRates/sql/nfusionsolutions_currencyexchangerates_setup/install-2.1.0.13.php +9 -0
- app/etc/modules/Nfusionsolutions_CurrencyExchangeRates.xml +29 -0
- package.xml +18 -0
app/code/community/Nfusionsolutions/CurrencyExchangeRates/Helper/Data.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/mit-license.php
|
11 |
+
*
|
12 |
+
* @category Nfusionsolutions
|
13 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
14 |
+
* @copyright Copyright (c) 2015
|
15 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
16 |
+
*/
|
17 |
+
/**
|
18 |
+
* CurrencyExchangeRates default helper
|
19 |
+
*
|
20 |
+
* @category Nfusionsolutions
|
21 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
22 |
+
*/
|
23 |
+
class Nfusionsolutions_CurrencyExchangeRates_Helper_Data extends Mage_Core_Helper_Abstract
|
24 |
+
{
|
25 |
+
|
26 |
+
protected $api_base_url = 'https://service.nfusionsolutions.biz/';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Prepare API url
|
30 |
+
* @access public
|
31 |
+
* @param $currencyFrom and $currencyTo
|
32 |
+
*/
|
33 |
+
public function getApiUrl($currencyFrom, $currencyTo)
|
34 |
+
{
|
35 |
+
$api_type = $this->getApiType();
|
36 |
+
$api_call = '';
|
37 |
+
|
38 |
+
if($api_type == 'daily_rates'){
|
39 |
+
$api_call = $this->api_base_url.'currencies/rate?token='.$this->getToken().'&from='.$currencyFrom.'&to='.$currencyTo;
|
40 |
+
}elseif($api_type == 'intraday_rates'){
|
41 |
+
$api_call = $this->api_base_url.'api/Currencies/CurrencyMidRates?token='.$this->getToken().'&pairs=[{Base:'.$currencyFrom.',Counter:'.$currencyTo.'}]';
|
42 |
+
}
|
43 |
+
//echo $api_call;die;
|
44 |
+
return $api_call;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Get config data
|
49 |
+
* @access public
|
50 |
+
* @param none
|
51 |
+
*/
|
52 |
+
public function getApiType()
|
53 |
+
{
|
54 |
+
return Mage::getStoreConfig('currencyexchangerates/currencyexchangerates/api_type');
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Get config data
|
59 |
+
* @access public
|
60 |
+
* @param none
|
61 |
+
*/
|
62 |
+
public function getToken()
|
63 |
+
{
|
64 |
+
return Mage::getStoreConfig('currencyexchangerates/currencyexchangerates/token');
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Get config data
|
69 |
+
* @access public
|
70 |
+
* @param none
|
71 |
+
*/
|
72 |
+
public function checkLog()
|
73 |
+
{
|
74 |
+
return Mage::getStoreConfig('dev/log/active');
|
75 |
+
}
|
76 |
+
|
77 |
+
}
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/Model/Adminhtml/System/Config/Source/Type.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/mit-license.php
|
11 |
+
*
|
12 |
+
* @category Nfusionsolutions
|
13 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
14 |
+
* @copyright Copyright (c) 2015
|
15 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
16 |
+
*/
|
17 |
+
/**
|
18 |
+
* CurrencyExchangeRates setup
|
19 |
+
*
|
20 |
+
* @category Nfusionsolutions
|
21 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
22 |
+
*/
|
23 |
+
class Nfusionsolutions_CurrencyExchangeRates_Model_Adminhtml_System_Config_Source_Type
|
24 |
+
{
|
25 |
+
public function toOptionArray()
|
26 |
+
{
|
27 |
+
$themes = array(
|
28 |
+
array('value' => 'daily_rates', 'label' => 'Daily rates'),
|
29 |
+
array('value' => 'intraday_rates', 'label' => 'Intraday rates'),
|
30 |
+
);
|
31 |
+
return $themes;
|
32 |
+
}
|
33 |
+
}
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/Model/Currencyexchangerate.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/mit-license.php
|
11 |
+
*
|
12 |
+
* @category Nfusionsolutions
|
13 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
14 |
+
* @copyright Copyright (c) 2015
|
15 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
16 |
+
*/
|
17 |
+
/**
|
18 |
+
* CurrencyExchangeRate model
|
19 |
+
*
|
20 |
+
* @category Nfusionsolutions
|
21 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
22 |
+
*/
|
23 |
+
class Nfusionsolutions_CurrencyExchangeRates_Model_Currencyexchangerate extends Mage_Directory_Model_Currency_Import_Abstract
|
24 |
+
{
|
25 |
+
|
26 |
+
protected $_messages = array();
|
27 |
+
|
28 |
+
public function _convert($currencyFrom, $currencyTo, $retry=0) {
|
29 |
+
|
30 |
+
$_helper = Mage::helper('nfusionsolutions_currencyexchangerates');
|
31 |
+
|
32 |
+
try {
|
33 |
+
$url_call = $_helper->getApiUrl($currencyFrom, $currencyTo);
|
34 |
+
|
35 |
+
$ch = curl_init();
|
36 |
+
curl_setopt($ch, CURLOPT_URL, $url_call);
|
37 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
|
38 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json','Cache-Control: no-cache','Pragma: no-cache'));
|
39 |
+
$result = curl_exec($ch);
|
40 |
+
curl_close($ch);
|
41 |
+
|
42 |
+
//Decode the API response
|
43 |
+
$rateData = json_decode($result);
|
44 |
+
//echo '<pre>';print_r($rateData);die;
|
45 |
+
$api_type = $_helper->getApiType();
|
46 |
+
if($api_type == 'daily_rates'){
|
47 |
+
$rate = $rateData->rate;
|
48 |
+
}elseif($api_type == 'intraday_rates'){
|
49 |
+
$rate = $rateData[0]->data->rate;
|
50 |
+
}
|
51 |
+
if(count($rateData) > 0){
|
52 |
+
return (float) $rate;
|
53 |
+
}else{
|
54 |
+
if($_helper->checkLog()){
|
55 |
+
$msg = 'Currency import failed due to wrong key. Cannot retrieve rate from '.$currencyFrom.' to '.$currencyTo;
|
56 |
+
Mage::log($msg, null, 'currency_import.log');
|
57 |
+
}
|
58 |
+
$this -> _messages[] = Mage::helper('directory') -> __('Cannot retrieve rate from %s', $currencyFrom.' to '.$currencyTo.' due to invalid key.');
|
59 |
+
}
|
60 |
+
} catch (Exception $e) {
|
61 |
+
$this -> _messages[] = Mage::helper('directory') -> __('Cannot retrieve rate from %s.', $this -> _url);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/Model/Resource/Setup.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the MIT License
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/mit-license.php
|
11 |
+
*
|
12 |
+
* @category Nfusionsolutions
|
13 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
14 |
+
* @copyright Copyright (c) 2015
|
15 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
16 |
+
*/
|
17 |
+
/**
|
18 |
+
* CurrencyExchangeRates setup
|
19 |
+
*
|
20 |
+
* @category Nfusionsolutions
|
21 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
22 |
+
*/
|
23 |
+
class Nfusionsolutions_CurrencyExchangeRates_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
|
24 |
+
{
|
25 |
+
}
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/etc/adminhtml.xml
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the MIT License
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/mit-license.php
|
12 |
+
*
|
13 |
+
* @category Nfusionsolutions
|
14 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
15 |
+
* @copyright Copyright (c) 2015
|
16 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<acl>
|
21 |
+
<resources>
|
22 |
+
<all>
|
23 |
+
<title>Allow Everything</title>
|
24 |
+
</all>
|
25 |
+
<admin>
|
26 |
+
<children>
|
27 |
+
<system>
|
28 |
+
<children>
|
29 |
+
<config>
|
30 |
+
<children>
|
31 |
+
<currencyexchangerates translate="title" module="nfusionsolutions_currencyexchangerates">
|
32 |
+
<title>CurrencyExchangeRates</title>
|
33 |
+
</currencyexchangerates>
|
34 |
+
</children>
|
35 |
+
</config>
|
36 |
+
</children>
|
37 |
+
</system>
|
38 |
+
</children>
|
39 |
+
</admin>
|
40 |
+
</resources>
|
41 |
+
</acl>
|
42 |
+
<menu>
|
43 |
+
<nfusionsolutions_currencyexchangerates translate="title" module="nfusionsolutions_currencyexchangerates">
|
44 |
+
<title>nFusion Solutions</title>
|
45 |
+
<sort_order>100</sort_order>
|
46 |
+
<children>
|
47 |
+
<currencyexchangerate translate="title" module="nfusionsolutions_currencyexchangerates">
|
48 |
+
<title>Currencies</title>
|
49 |
+
<sort_order>0</sort_order>
|
50 |
+
<children>
|
51 |
+
<currencyexchangerate_import translate="title" module="nfusionsolutions_currencyexchangerates">
|
52 |
+
<title>Import</title>
|
53 |
+
<action>adminhtml/system_currency/index</action>
|
54 |
+
<sort_order>1</sort_order>
|
55 |
+
</currencyexchangerate_import>
|
56 |
+
<currencyexchangerate_setting translate="title" module="nfusionsolutions_currencyexchangerates">
|
57 |
+
<title>Settings</title>
|
58 |
+
<action>adminhtml/system_config/edit/section/currencyexchangerates</action>
|
59 |
+
<sort_order>2</sort_order>
|
60 |
+
</currencyexchangerate_setting>
|
61 |
+
</children>
|
62 |
+
</currencyexchangerate>
|
63 |
+
</children>
|
64 |
+
</nfusionsolutions_currencyexchangerates>
|
65 |
+
</menu>
|
66 |
+
</config>
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/etc/config.xml
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the MIT License
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/mit-license.php
|
12 |
+
*
|
13 |
+
* @category Nfusionsolutions
|
14 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
15 |
+
* @copyright Copyright (c) 2015
|
16 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<modules>
|
21 |
+
<Nfusionsolutions_CurrencyExchangeRates>
|
22 |
+
<version>2.1.0.13</version>
|
23 |
+
</Nfusionsolutions_CurrencyExchangeRates>
|
24 |
+
</modules>
|
25 |
+
<!--/**for importing currency hourly start**/-->
|
26 |
+
<crontab>
|
27 |
+
<jobs>
|
28 |
+
<nfusionsolutions_currencyexchangerates>
|
29 |
+
<schedule>
|
30 |
+
<cron_expr>0 * * * *</cron_expr>
|
31 |
+
</schedule>
|
32 |
+
<run>
|
33 |
+
<model>directory/observer::scheduledUpdateCurrencyRates</model>
|
34 |
+
</run>
|
35 |
+
</nfusionsolutions_currencyexchangerates>
|
36 |
+
</jobs>
|
37 |
+
</crontab>
|
38 |
+
<!--/**for importing currency hourly end**/-->
|
39 |
+
<global>
|
40 |
+
<resources>
|
41 |
+
<nfusionsolutions_currencyexchangerates_setup>
|
42 |
+
<setup>
|
43 |
+
<module>Nfusionsolutions_CurrencyExchangeRates</module>
|
44 |
+
<class>Nfusionsolutions_CurrencyExchangeRates_Model_Resource_Setup</class>
|
45 |
+
</setup>
|
46 |
+
</nfusionsolutions_currencyexchangerates_setup>
|
47 |
+
</resources>
|
48 |
+
<currency>
|
49 |
+
<import>
|
50 |
+
<services>
|
51 |
+
<nfusionsolutions_currencyexchangerates>
|
52 |
+
<name>nFusion Solutions</name>
|
53 |
+
<model>Nfusionsolutions_CurrencyExchangeRates_Model_Currencyexchangerate</model>
|
54 |
+
</nfusionsolutions_currencyexchangerates>
|
55 |
+
</services>
|
56 |
+
</import>
|
57 |
+
</currency>
|
58 |
+
<helpers>
|
59 |
+
<nfusionsolutions_currencyexchangerates>
|
60 |
+
<class>Nfusionsolutions_CurrencyExchangeRates_Helper</class>
|
61 |
+
</nfusionsolutions_currencyexchangerates>
|
62 |
+
</helpers>
|
63 |
+
<models>
|
64 |
+
<nfusionsolutions_currencyexchangerates>
|
65 |
+
<class>Nfusionsolutions_CurrencyExchangeRates_Model_Currencyexchangerate</class>
|
66 |
+
</nfusionsolutions_currencyexchangerates>
|
67 |
+
</models>
|
68 |
+
</global>
|
69 |
+
<adminhtml>
|
70 |
+
<layout>
|
71 |
+
<updates>
|
72 |
+
<nfusionsolutions_currencyexchangerates>
|
73 |
+
<file>nfusionsolutions_currencyexchangerates.xml</file>
|
74 |
+
</nfusionsolutions_currencyexchangerates>
|
75 |
+
</updates>
|
76 |
+
</layout>
|
77 |
+
</adminhtml>
|
78 |
+
<default>
|
79 |
+
<currency>
|
80 |
+
<import>
|
81 |
+
<enabled>1</enabled>
|
82 |
+
</import>
|
83 |
+
</currency>
|
84 |
+
<currency>
|
85 |
+
<import>
|
86 |
+
<service>nfusionsolutions_currencyexchangerates</service>
|
87 |
+
</import>
|
88 |
+
</currency>
|
89 |
+
</default>
|
90 |
+
</config>
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/etc/system.xml
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the MIT License
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/mit-license.php
|
12 |
+
*
|
13 |
+
* @category Nfusionsolutions
|
14 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
15 |
+
* @copyright Copyright (c) 2015
|
16 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<tabs>
|
21 |
+
<currencyexchangerates translate="label" module="nfusionsolutions_currencyexchangerates">
|
22 |
+
<label>nFusion Solutions</label>
|
23 |
+
<sort_order>0</sort_order>
|
24 |
+
</currencyexchangerates>
|
25 |
+
</tabs>
|
26 |
+
<sections>
|
27 |
+
<currencyexchangerates translate="label" module="nfusionsolutions_currencyexchangerates">
|
28 |
+
<label>Currency Exchange Rates</label>
|
29 |
+
<tab>currencyexchangerates</tab>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>0</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<groups>
|
36 |
+
<currencyexchangerates translate="label">
|
37 |
+
<label>Currency Exchange Rates Settings</label>
|
38 |
+
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>0</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>1</show_in_store>
|
43 |
+
<fields>
|
44 |
+
<token translate="label">
|
45 |
+
<label>Token</label>
|
46 |
+
<frontend_type>text</frontend_type>
|
47 |
+
<validate>required-entry</validate>
|
48 |
+
<sort_order>2</sort_order>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>1</show_in_store>
|
52 |
+
</token>
|
53 |
+
<api_type translate="label">
|
54 |
+
<label>API Type</label>
|
55 |
+
<frontend_type>select</frontend_type>
|
56 |
+
<source_model>Nfusionsolutions_CurrencyExchangeRates_Model_Adminhtml_System_Config_Source_Type</source_model>
|
57 |
+
<sort_order>3</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>1</show_in_store>
|
61 |
+
</api_type>
|
62 |
+
<currency_support translate="label">
|
63 |
+
<label>Currency Support</label>
|
64 |
+
<frontend_type>hidden</frontend_type>
|
65 |
+
<comment>USD, CAD, EUR, GBP, JPY, AUD, INR, CNY, ZAR, CHF, BRL, ARS, HKD, IDR, MYR, MXN, NZD, NOK, RUB, SAR, SGD, SEK, TWD, THB, AED, VND </comment>
|
66 |
+
<sort_order>4</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
+
</currency_support>
|
71 |
+
<currency_msg translate="label">
|
72 |
+
<label>Import Frequency</label>
|
73 |
+
<frontend_type>hidden</frontend_type>
|
74 |
+
<comment>Import will run every hour irrespective of default import setting.</comment>
|
75 |
+
<sort_order>5</sort_order>
|
76 |
+
<show_in_default>1</show_in_default>
|
77 |
+
<show_in_website>1</show_in_website>
|
78 |
+
<show_in_store>1</show_in_store>
|
79 |
+
</currency_msg>
|
80 |
+
</fields>
|
81 |
+
</currencyexchangerates>
|
82 |
+
</groups>
|
83 |
+
</currencyexchangerates>
|
84 |
+
</sections>
|
85 |
+
</config>
|
app/code/community/Nfusionsolutions/CurrencyExchangeRates/sql/nfusionsolutions_currencyexchangerates_setup/install-2.1.0.13.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$installer->run("DELETE FROM `{$installer->getTable('core_config_data')}` WHERE `path` = 'currency/import/enabled';
|
5 |
+
DELETE FROM `{$installer->getTable('core_config_data')}` WHERE `path` = 'currency/import/service';
|
6 |
+
INSERT INTO `{$installer->getTable('core_config_data')}` VALUES(NULL , 'default', '0', 'currency/import/enabled', '1');
|
7 |
+
INSERT INTO `{$installer->getTable('core_config_data')}` VALUES(NULL , 'default', '0', 'currency/import/service', 'nfusionsolutions_currencyexchangerates');
|
8 |
+
");
|
9 |
+
$installer->endSetup();?>
|
app/etc/modules/Nfusionsolutions_CurrencyExchangeRates.xml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Nfusionsolutions_CurrencyExchangeRates extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the MIT License
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/mit-license.php
|
12 |
+
*
|
13 |
+
* @category Nfusionsolutions
|
14 |
+
* @package Nfusionsolutions_CurrencyExchangeRates
|
15 |
+
* @copyright Copyright (c) 2015
|
16 |
+
* @license http://opensource.org/licenses/mit-license.php MIT License
|
17 |
+
*/
|
18 |
+
-->
|
19 |
+
<config>
|
20 |
+
<modules>
|
21 |
+
<Nfusionsolutions_CurrencyExchangeRates>
|
22 |
+
<active>true</active>
|
23 |
+
<codePool>community</codePool>
|
24 |
+
<depends>
|
25 |
+
<Mage_Core />
|
26 |
+
</depends>
|
27 |
+
</Nfusionsolutions_CurrencyExchangeRates>
|
28 |
+
</modules>
|
29 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Nfusionsolutions_CurrencyExchangeRates</name>
|
4 |
+
<version>2.1.0.13</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This extension adds the capability in Magento to import currency conversion rates from nFusion Solutions&apos; reliable, enterprise-class cloud platform for global currency data.</summary>
|
10 |
+
<description>This extension adds the capability in Magento to import currency conversion rates from nFusion Solutions' reliable, enterprise-class cloud platform for global currency data. All settings are provided in the Magento admin. When you import currency rates in Magento from "System-&amp;gt;Manage Currency" this plugin gives you the option to import rates from nFusion Solutions instead of from default Webservicex. You can also use the scheduled import feature in Magento to have currencies updated automatically using nFusion Solutions data.</description>
|
11 |
+
<notes>Enterprise class global currency exchange rates</notes>
|
12 |
+
<authors><author><name>nFusion Solutions</name><user>nfusion</user><email>support@nfusionsolutions.com</email></author></authors>
|
13 |
+
<date>2015-11-25</date>
|
14 |
+
<time>09:34:07</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Nfusionsolutions"><dir name="CurrencyExchangeRates"><dir name="Helper"><file name="Data.php" hash="a1270fc3de8dd78695c1f8e597b8d65d"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Type.php" hash="7aece277d3620a0d44571ab5cdbc7c9b"/></dir></dir></dir></dir><file name="Currencyexchangerate.php" hash="f34f28daa4d2de315b409386373cfdcc"/><dir name="Resource"><file name="Setup.php" hash="80ffebbbcf3a4fce497b10f7d05619ef"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="580321f803948605af962b6af387c824"/><file name="config.xml" hash="bd5ab13f3b9f7d932935f22df18b9485"/><file name="system.xml" hash="e6fafe0573ec4b6f7f44c9890619fef6"/></dir><dir name="sql"><dir name="nfusionsolutions_currencyexchangerates_setup"><file name="install-2.1.0.13.php" hash="322a11ea4c8f5bb378f12d4bbcaecab4"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Nfusionsolutions_CurrencyExchangeRates.xml" hash="5236d167a01e671b60df30d05891c5a0"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|