Version Notes
Balance info
Fix issues with eSputnik provider
Download this release
Release Info
| Developer | Artem Kruzhalin |
| Extension | Easyweb_Smsnotify |
| Version | 1.0.3 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.3
- app/code/local/Easyweb/Smsnotify/Block/Adminhtml/System/Config/Balance.php +44 -0
- app/code/local/Easyweb/Smsnotify/Helper/Data.php +83 -66
- app/code/local/Easyweb/Smsnotify/Model/Observer.php +34 -41
- app/code/local/Easyweb/Smsnotify/Model/Provider/Abstract.php +114 -112
- app/code/local/Easyweb/Smsnotify/Model/Provider/Esputnik.php +101 -61
- app/code/local/Easyweb/Smsnotify/Model/Provider/Turbosms.php +86 -80
- app/code/local/Easyweb/Smsnotify/Model/Source/Provider.php +58 -58
- app/code/local/Easyweb/Smsnotify/controllers/Adminhtml/Config/BalanceController.php +34 -0
- app/code/local/Easyweb/Smsnotify/etc/adminhtml.xml +33 -33
- app/code/local/Easyweb/Smsnotify/etc/config.xml +78 -62
- app/code/local/Easyweb/Smsnotify/etc/system.xml +144 -132
- app/design/adminhtml/default/default/template/smsnotify/system/config/balance.phtml +55 -0
- app/etc/modules/Easyweb_Smsnotify.xml +19 -19
- app/locale/en_US/Easyweb_Smsnotify.csv +13 -13
- app/locale/ru_RU/Easyweb_Smsnotify.csv +13 -13
- app/locale/uk_UA/Easyweb_Smsnotify.csv +13 -13
- package.xml +13 -8
app/code/local/Easyweb/Smsnotify/Block/Adminhtml/System/Config/Balance.php
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* EasyWeb SmsNotify
|
| 4 |
+
*
|
| 5 |
+
*
|
| 6 |
+
* @category Easyweb
|
| 7 |
+
* @package Easyweb_Smsnotify
|
| 8 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
class Easyweb_Smsnotify_Block_Adminhtml_System_Config_Balance extends Mage_Adminhtml_Block_System_Config_Form_Field
|
| 12 |
+
{
|
| 13 |
+
/**
|
| 14 |
+
* Set template to itself
|
| 15 |
+
*
|
| 16 |
+
* @return Mage_Adminhtml_Block_Customer_System_Config_Validatevat
|
| 17 |
+
*/
|
| 18 |
+
protected function _prepareLayout()
|
| 19 |
+
{
|
| 20 |
+
parent::_prepareLayout();
|
| 21 |
+
if (!$this->getTemplate()) {
|
| 22 |
+
$this->setTemplate('smsnotify/system/config/balance.phtml');
|
| 23 |
+
}
|
| 24 |
+
return $this;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Get the button and scripts contents
|
| 29 |
+
*
|
| 30 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
| 31 |
+
* @return string
|
| 32 |
+
*/
|
| 33 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
| 34 |
+
{
|
| 35 |
+
$originalData = $element->getOriginalData();
|
| 36 |
+
$this->addData(array(
|
| 37 |
+
'button_label' => Mage::helper('easyweb_smsnotify')->__($originalData['button_label']),
|
| 38 |
+
'html_id' => $element->getHtmlId(),
|
| 39 |
+
'ajax_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/config_balance/check')
|
| 40 |
+
));
|
| 41 |
+
|
| 42 |
+
return $this->_toHtml();
|
| 43 |
+
}
|
| 44 |
+
}
|
app/code/local/Easyweb/Smsnotify/Helper/Data.php
CHANGED
|
@@ -1,66 +1,83 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @
|
| 8 |
-
* @
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class Easyweb_Smsnotify_Helper_Data extends Mage_Core_Helper_Abstract
|
| 12 |
-
{
|
| 13 |
-
protected $_provider = null;
|
| 14 |
-
|
| 15 |
-
protected $_text = null;
|
| 16 |
-
|
| 17 |
-
protected $_phone = null;
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
*
|
| 21 |
-
*
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
*
|
| 31 |
-
*
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
* @return
|
| 45 |
-
*/
|
| 46 |
-
public function
|
| 47 |
-
{
|
| 48 |
-
if(
|
| 49 |
-
|
| 50 |
-
}
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SmsNotify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
class Easyweb_Smsnotify_Helper_Data extends Mage_Core_Helper_Abstract
|
| 12 |
+
{
|
| 13 |
+
protected $_provider = null;
|
| 14 |
+
|
| 15 |
+
protected $_text = null;
|
| 16 |
+
|
| 17 |
+
protected $_phone = null;
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Check if sms notify is enabled
|
| 21 |
+
*
|
| 22 |
+
* @return boolean
|
| 23 |
+
*/
|
| 24 |
+
public function isSmsEnabled()
|
| 25 |
+
{
|
| 26 |
+
return Mage::getStoreConfig('easywebsmsnotify/general/enabled');
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/**
|
| 30 |
+
* Get current sms provider
|
| 31 |
+
*
|
| 32 |
+
* @return string
|
| 33 |
+
*/
|
| 34 |
+
public function getProvider()
|
| 35 |
+
{
|
| 36 |
+
if (is_null($this->_provider)) {
|
| 37 |
+
$this->_provider = Mage::getStoreConfig('easywebsmsnotify/general/provider');
|
| 38 |
+
}
|
| 39 |
+
return $this->_provider;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* @return bool|Mage_Core_Model_Abstract
|
| 45 |
+
*/
|
| 46 |
+
public function getProviderModel()
|
| 47 |
+
{
|
| 48 |
+
if (!$this->isSmsEnabled()) {
|
| 49 |
+
return false;
|
| 50 |
+
}
|
| 51 |
+
$provider = $this->getProvider();
|
| 52 |
+
if ($provider) {
|
| 53 |
+
return Mage::getModel('easyweb_smsnotify/provider_' . $provider);
|
| 54 |
+
}
|
| 55 |
+
return false;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* Get text for sms
|
| 60 |
+
*
|
| 61 |
+
* @return string
|
| 62 |
+
*/
|
| 63 |
+
public function getTextMessage()
|
| 64 |
+
{
|
| 65 |
+
if (is_null($this->_text)) {
|
| 66 |
+
$this->_text = Mage::getStoreConfig('easywebsmsnotify/general/text');
|
| 67 |
+
}
|
| 68 |
+
return $this->_text;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* Get text for sms
|
| 73 |
+
*
|
| 74 |
+
* @return string
|
| 75 |
+
*/
|
| 76 |
+
public function getStorePhone()
|
| 77 |
+
{
|
| 78 |
+
if (is_null($this->_phone)) {
|
| 79 |
+
$this->_phone = Mage::getStoreConfig('easywebsmsnotify/general/store_phone');
|
| 80 |
+
}
|
| 81 |
+
return $this->_phone;
|
| 82 |
+
}
|
| 83 |
+
}
|
app/code/local/Easyweb/Smsnotify/Model/Observer.php
CHANGED
|
@@ -1,41 +1,34 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @
|
| 8 |
-
* @
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class Easyweb_Smsnotify_Model_Observer
|
| 12 |
-
{
|
| 13 |
-
/**
|
| 14 |
-
* Handler for sales_order_place_after
|
| 15 |
-
*
|
| 16 |
-
* @param Varien_Event_Observer $observer
|
| 17 |
-
* @return boolean
|
| 18 |
-
*/
|
| 19 |
-
public function sendNotifyToAdminAfterPlaceOrder($observer)
|
| 20 |
-
{
|
| 21 |
-
|
| 22 |
-
$
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
if ($providerModel) {
|
| 36 |
-
$providerModel->sendOrderSms($orderId, $amount);
|
| 37 |
-
}
|
| 38 |
-
|
| 39 |
-
return $this;
|
| 40 |
-
}
|
| 41 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SmsNotify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
class Easyweb_Smsnotify_Model_Observer
|
| 12 |
+
{
|
| 13 |
+
/**
|
| 14 |
+
* Handler for sales_order_place_after
|
| 15 |
+
*
|
| 16 |
+
* @param Varien_Event_Observer $observer
|
| 17 |
+
* @return boolean
|
| 18 |
+
*/
|
| 19 |
+
public function sendNotifyToAdminAfterPlaceOrder($observer)
|
| 20 |
+
{
|
| 21 |
+
$helper = Mage::helper('easyweb_smsnotify');
|
| 22 |
+
$order = $observer->getOrder();
|
| 23 |
+
|
| 24 |
+
$orderId = $order->getIncrementId();
|
| 25 |
+
$amount = $order->getGrandTotal();
|
| 26 |
+
|
| 27 |
+
$providerModel = $helper->getProviderModel();
|
| 28 |
+
if ($providerModel) {
|
| 29 |
+
$providerModel->sendOrderSms($orderId, $amount);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
return $this;
|
| 33 |
+
}
|
| 34 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Easyweb/Smsnotify/Model/Provider/Abstract.php
CHANGED
|
@@ -1,112 +1,114 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* EasyWeb SmsNotify
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
* @category Easyweb
|
| 7 |
-
* @package Easyweb_Smsnotify
|
| 8 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
-
*/
|
| 10 |
-
|
| 11 |
-
abstract class Easyweb_Smsnotify_Model_Provider_Abstract extends Mage_Core_Model_Abstract
|
| 12 |
-
{
|
| 13 |
-
/**
|
| 14 |
-
* Prefix of provider
|
| 15 |
-
* @var string
|
| 16 |
-
*/
|
| 17 |
-
protected $_prefix;
|
| 18 |
-
|
| 19 |
-
/**
|
| 20 |
-
* Login for webservice
|
| 21 |
-
* @var string
|
| 22 |
-
*/
|
| 23 |
-
protected $_login;
|
| 24 |
-
|
| 25 |
-
/**
|
| 26 |
-
* Password for webservice
|
| 27 |
-
* @var string
|
| 28 |
-
*/
|
| 29 |
-
protected $_password;
|
| 30 |
-
|
| 31 |
-
/**
|
| 32 |
-
* @var SoapClient
|
| 33 |
-
*/
|
| 34 |
-
protected $_client = null;
|
| 35 |
-
|
| 36 |
-
protected $_messages = array('Easyweb SMS Notify');
|
| 37 |
-
|
| 38 |
-
abstract public function sendOrderSms($orderId, $amount);
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
*
|
| 44 |
-
*
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
*
|
| 56 |
-
*
|
| 57 |
-
* @
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
*
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
*
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
*
|
| 95 |
-
*
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
*
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* EasyWeb SmsNotify
|
| 4 |
+
*
|
| 5 |
+
*
|
| 6 |
+
* @category Easyweb
|
| 7 |
+
* @package Easyweb_Smsnotify
|
| 8 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
abstract class Easyweb_Smsnotify_Model_Provider_Abstract extends Mage_Core_Model_Abstract
|
| 12 |
+
{
|
| 13 |
+
/**
|
| 14 |
+
* Prefix of provider
|
| 15 |
+
* @var string
|
| 16 |
+
*/
|
| 17 |
+
protected $_prefix;
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Login for webservice
|
| 21 |
+
* @var string
|
| 22 |
+
*/
|
| 23 |
+
protected $_login;
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Password for webservice
|
| 27 |
+
* @var string
|
| 28 |
+
*/
|
| 29 |
+
protected $_password;
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* @var SoapClient
|
| 33 |
+
*/
|
| 34 |
+
protected $_client = null;
|
| 35 |
+
|
| 36 |
+
protected $_messages = array('Easyweb SMS Notify');
|
| 37 |
+
|
| 38 |
+
abstract public function sendOrderSms($orderId, $amount);
|
| 39 |
+
|
| 40 |
+
abstract public function checkBalance();
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Get field with provider prefix
|
| 44 |
+
*
|
| 45 |
+
* @param string $field
|
| 46 |
+
* @return string|null
|
| 47 |
+
*/
|
| 48 |
+
public function getConfigField($field)
|
| 49 |
+
{
|
| 50 |
+
$value = Mage::getStoreConfig('easywebsmsnotify/general/' . $this->_prefix . '_' . $field);
|
| 51 |
+
return $value ? $value : null;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* Get text for sms
|
| 56 |
+
*
|
| 57 |
+
* @param string $orderId
|
| 58 |
+
* @param float $amount
|
| 59 |
+
* @return string
|
| 60 |
+
*/
|
| 61 |
+
public function getTextMessage($orderId, $amount)
|
| 62 |
+
{
|
| 63 |
+
$text = Mage::helper('easyweb_smsnotify')->getTextMessage();
|
| 64 |
+
$text = iconv('windows-1251', 'utf-8', $text);
|
| 65 |
+
return str_replace(
|
| 66 |
+
array('%ORDER_ID%', '%AMOUNT%'),
|
| 67 |
+
array($orderId, $amount),
|
| 68 |
+
$text
|
| 69 |
+
);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
/**
|
| 73 |
+
* Get destination number for sms
|
| 74 |
+
*
|
| 75 |
+
* @return string
|
| 76 |
+
*/
|
| 77 |
+
public function getStorePhone()
|
| 78 |
+
{
|
| 79 |
+
return Mage::helper('easyweb_smsnotify')->getStorePhone();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* Log error messages
|
| 84 |
+
*
|
| 85 |
+
* @return $this
|
| 86 |
+
*/
|
| 87 |
+
protected function _logMessages()
|
| 88 |
+
{
|
| 89 |
+
Mage::log(implode("\n", $this->_messages),null,'sms.log');
|
| 90 |
+
return $this;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/**
|
| 94 |
+
* Add error message
|
| 95 |
+
*
|
| 96 |
+
* @param $message
|
| 97 |
+
* @return $this
|
| 98 |
+
*/
|
| 99 |
+
protected function _addErrorMessage($message)
|
| 100 |
+
{
|
| 101 |
+
$this->_messages[] = $message;
|
| 102 |
+
return $this;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
/**
|
| 106 |
+
* Get sender
|
| 107 |
+
*
|
| 108 |
+
* @return null|string
|
| 109 |
+
*/
|
| 110 |
+
public function getSender()
|
| 111 |
+
{
|
| 112 |
+
return $this->getConfigField('sender');
|
| 113 |
+
}
|
| 114 |
+
}
|
app/code/local/Easyweb/Smsnotify/Model/Provider/Esputnik.php
CHANGED
|
@@ -1,61 +1,101 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @
|
| 8 |
-
* @
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class Easyweb_Smsnotify_Model_Provider_Esputnik extends Easyweb_Smsnotify_Model_Provider_Abstract
|
| 12 |
-
{
|
| 13 |
-
/**
|
| 14 |
-
* Prefix of provider
|
| 15 |
-
* @var string
|
| 16 |
-
*/
|
| 17 |
-
protected $_prefix = 'esputnik';
|
| 18 |
-
|
| 19 |
-
/**
|
| 20 |
-
* Api url
|
| 21 |
-
* @var string
|
| 22 |
-
*/
|
| 23 |
-
protected $
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
/**
|
| 27 |
-
*
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
$
|
| 36 |
-
$
|
| 37 |
-
|
| 38 |
-
$
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SmsNotify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
class Easyweb_Smsnotify_Model_Provider_Esputnik extends Easyweb_Smsnotify_Model_Provider_Abstract
|
| 12 |
+
{
|
| 13 |
+
/**
|
| 14 |
+
* Prefix of provider
|
| 15 |
+
* @var string
|
| 16 |
+
*/
|
| 17 |
+
protected $_prefix = 'esputnik';
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Api url
|
| 21 |
+
* @var string
|
| 22 |
+
*/
|
| 23 |
+
protected $_urlSendSms = 'http://esputnik.com.ua/api/v1/message/sms';
|
| 24 |
+
protected $_urlBalance = 'http://esputnik.com.ua/api/v1/balance';
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* @return resource
|
| 28 |
+
*/
|
| 29 |
+
protected function _getAuthCurlObject()
|
| 30 |
+
{
|
| 31 |
+
$login = $this->getConfigField('login');
|
| 32 |
+
$password = $this->getConfigField('password');
|
| 33 |
+
|
| 34 |
+
$ch = curl_init();
|
| 35 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
| 36 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json', 'Content-Type: application/json'));
|
| 37 |
+
curl_setopt($ch, CURLOPT_USERPWD, $login . ':' . $password);
|
| 38 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
| 39 |
+
|
| 40 |
+
return $ch;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* @param $ch
|
| 45 |
+
* @return mixed
|
| 46 |
+
*/
|
| 47 |
+
protected function _getResponse($ch)
|
| 48 |
+
{
|
| 49 |
+
$output = curl_exec($ch);
|
| 50 |
+
if ($output === FALSE) {
|
| 51 |
+
$this->_addErrorMessage($ch);
|
| 52 |
+
} else {
|
| 53 |
+
return $output;
|
| 54 |
+
}
|
| 55 |
+
curl_close($ch);
|
| 56 |
+
|
| 57 |
+
return false;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
/**
|
| 61 |
+
* Send sms when order is placed
|
| 62 |
+
*
|
| 63 |
+
* @param string $orderId
|
| 64 |
+
* @param float $amount
|
| 65 |
+
* @return array
|
| 66 |
+
*/
|
| 67 |
+
public function sendOrderSms($orderId, $amount)
|
| 68 |
+
{
|
| 69 |
+
$json_value = new stdClass();
|
| 70 |
+
$json_value->text = $this->getTextMessage($orderId, $amount);
|
| 71 |
+
$json_value->from = $this->getSender();
|
| 72 |
+
$json_value->phoneNumbers = array($this->getStorePhone());
|
| 73 |
+
|
| 74 |
+
$ch = $this->_getAuthCurlObject();
|
| 75 |
+
curl_setopt($ch, CURLOPT_POST, 1);
|
| 76 |
+
curl_setopt($ch, CURLOPT_HEADER, 1);
|
| 77 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($json_value));
|
| 78 |
+
curl_setopt($ch, CURLOPT_URL, $this->_urlSendSms);
|
| 79 |
+
return $this->_getResponse($ch);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* @return mixed
|
| 84 |
+
*/
|
| 85 |
+
public function checkBalance()
|
| 86 |
+
{
|
| 87 |
+
$ch = $this->_getAuthCurlObject();
|
| 88 |
+
curl_setopt($ch, CURLOPT_URL, $this->_urlBalance);
|
| 89 |
+
$response = $this->_getResponse($ch);
|
| 90 |
+
|
| 91 |
+
$response = json_decode($response);
|
| 92 |
+
|
| 93 |
+
$output = $response->currentBalance . ' ' . $response->currency;
|
| 94 |
+
if ($response->bonusSmses) {
|
| 95 |
+
$output .= '<br />(Bonus SMS: ' . $response->bonusSmses . ')';
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
return $output;
|
| 100 |
+
}
|
| 101 |
+
}
|
app/code/local/Easyweb/Smsnotify/Model/Provider/Turbosms.php
CHANGED
|
@@ -1,80 +1,86 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* EasyWeb SmsNotify
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
* @category Easyweb
|
| 7 |
-
* @package Easyweb_Smsnotify
|
| 8 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
-
*/
|
| 10 |
-
|
| 11 |
-
class Easyweb_Smsnotify_Model_Provider_Turbosms extends Easyweb_Smsnotify_Model_Provider_Abstract
|
| 12 |
-
{
|
| 13 |
-
/**
|
| 14 |
-
* Prefix of provider
|
| 15 |
-
* @var string
|
| 16 |
-
*/
|
| 17 |
-
protected $_prefix = 'turbosms';
|
| 18 |
-
|
| 19 |
-
/**
|
| 20 |
-
* Api url
|
| 21 |
-
* @var string
|
| 22 |
-
*/
|
| 23 |
-
protected $_url = 'http://turbosms.in.ua/api/wsdl.html';
|
| 24 |
-
|
| 25 |
-
/**
|
| 26 |
-
* Create client
|
| 27 |
-
*
|
| 28 |
-
* @return SoapClient
|
| 29 |
-
*/
|
| 30 |
-
protected function _getClient()
|
| 31 |
-
{
|
| 32 |
-
if (is_null($this->_client)) {
|
| 33 |
-
$this->_client = new SoapClient ($this->_url);
|
| 34 |
-
}
|
| 35 |
-
return $this->_client;
|
| 36 |
-
}
|
| 37 |
-
|
| 38 |
-
/**
|
| 39 |
-
* Auth client on provider side
|
| 40 |
-
*
|
| 41 |
-
* @return SoapClient
|
| 42 |
-
*/
|
| 43 |
-
protected function _getAuthClient()
|
| 44 |
-
{
|
| 45 |
-
$login = $this->getConfigField('login');
|
| 46 |
-
$password = $this->getConfigField('password');
|
| 47 |
-
|
| 48 |
-
$auth = array(
|
| 49 |
-
'login' => $login,
|
| 50 |
-
'password' => $password
|
| 51 |
-
);
|
| 52 |
-
|
| 53 |
-
$auth = $this->_getClient()->Auth($auth);
|
| 54 |
-
$this->_addErrorMessage($auth->AuthResult);
|
| 55 |
-
|
| 56 |
-
return $this->_getClient();
|
| 57 |
-
}
|
| 58 |
-
|
| 59 |
-
/**
|
| 60 |
-
* Send sms when order is placed
|
| 61 |
-
*
|
| 62 |
-
* @param string $orderId
|
| 63 |
-
* @param float $amount
|
| 64 |
-
* @return array
|
| 65 |
-
*/
|
| 66 |
-
public function sendOrderSms($orderId, $amount)
|
| 67 |
-
{
|
| 68 |
-
$sms = array(
|
| 69 |
-
'sender' => $this->getSender(),
|
| 70 |
-
'destination' => $this->getStorePhone(),
|
| 71 |
-
'text' => $this->getTextMessage($orderId, $amount),
|
| 72 |
-
);
|
| 73 |
-
$result = $this->_getAuthClient()->sendSMS($sms);
|
| 74 |
-
if (!is_array($result->SendSMSResult->ResultArray)) {
|
| 75 |
-
$message = $result->SendSMSResult->ResultArray;
|
| 76 |
-
$this->_addErrorMessage($message)->_logMessages();
|
| 77 |
-
}
|
| 78 |
-
return;
|
| 79 |
-
}
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* EasyWeb SmsNotify
|
| 4 |
+
*
|
| 5 |
+
*
|
| 6 |
+
* @category Easyweb
|
| 7 |
+
* @package Easyweb_Smsnotify
|
| 8 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
class Easyweb_Smsnotify_Model_Provider_Turbosms extends Easyweb_Smsnotify_Model_Provider_Abstract
|
| 12 |
+
{
|
| 13 |
+
/**
|
| 14 |
+
* Prefix of provider
|
| 15 |
+
* @var string
|
| 16 |
+
*/
|
| 17 |
+
protected $_prefix = 'turbosms';
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* Api url
|
| 21 |
+
* @var string
|
| 22 |
+
*/
|
| 23 |
+
protected $_url = 'http://turbosms.in.ua/api/wsdl.html';
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Create client
|
| 27 |
+
*
|
| 28 |
+
* @return SoapClient
|
| 29 |
+
*/
|
| 30 |
+
protected function _getClient()
|
| 31 |
+
{
|
| 32 |
+
if (is_null($this->_client)) {
|
| 33 |
+
$this->_client = new SoapClient ($this->_url);
|
| 34 |
+
}
|
| 35 |
+
return $this->_client;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
/**
|
| 39 |
+
* Auth client on provider side
|
| 40 |
+
*
|
| 41 |
+
* @return SoapClient
|
| 42 |
+
*/
|
| 43 |
+
protected function _getAuthClient()
|
| 44 |
+
{
|
| 45 |
+
$login = $this->getConfigField('login');
|
| 46 |
+
$password = $this->getConfigField('password');
|
| 47 |
+
|
| 48 |
+
$auth = array(
|
| 49 |
+
'login' => $login,
|
| 50 |
+
'password' => $password
|
| 51 |
+
);
|
| 52 |
+
|
| 53 |
+
$auth = $this->_getClient()->Auth($auth);
|
| 54 |
+
$this->_addErrorMessage($auth->AuthResult);
|
| 55 |
+
|
| 56 |
+
return $this->_getClient();
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* Send sms when order is placed
|
| 61 |
+
*
|
| 62 |
+
* @param string $orderId
|
| 63 |
+
* @param float $amount
|
| 64 |
+
* @return array
|
| 65 |
+
*/
|
| 66 |
+
public function sendOrderSms($orderId, $amount)
|
| 67 |
+
{
|
| 68 |
+
$sms = array(
|
| 69 |
+
'sender' => $this->getSender(),
|
| 70 |
+
'destination' => $this->getStorePhone(),
|
| 71 |
+
'text' => $this->getTextMessage($orderId, $amount),
|
| 72 |
+
);
|
| 73 |
+
$result = $this->_getAuthClient()->sendSMS($sms);
|
| 74 |
+
if (!is_array($result->SendSMSResult->ResultArray)) {
|
| 75 |
+
$message = $result->SendSMSResult->ResultArray;
|
| 76 |
+
$this->_addErrorMessage($message)->_logMessages();
|
| 77 |
+
}
|
| 78 |
+
return;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
public function checkBalance()
|
| 82 |
+
{
|
| 83 |
+
$result = $this->_getAuthClient()->GetCreditBalance();
|
| 84 |
+
return $result->GetCreditBalanceResult;
|
| 85 |
+
}
|
| 86 |
+
}
|
app/code/local/Easyweb/Smsnotify/Model/Source/Provider.php
CHANGED
|
@@ -1,58 +1,58 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* EasyWeb SmsNotify
|
| 4 |
-
*
|
| 5 |
-
*
|
| 6 |
-
* @category Easyweb
|
| 7 |
-
* @package Easyweb_Core
|
| 8 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
-
*/
|
| 10 |
-
|
| 11 |
-
class Easyweb_Smsnotify_Model_Source_Provider extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
|
| 12 |
-
{
|
| 13 |
-
/**
|
| 14 |
-
* Retrieve all options array
|
| 15 |
-
*
|
| 16 |
-
* @return array
|
| 17 |
-
*/
|
| 18 |
-
public function getAllOptions()
|
| 19 |
-
{
|
| 20 |
-
if (is_null($this->_options)) {
|
| 21 |
-
$this->_options = array(
|
| 22 |
-
array(
|
| 23 |
-
'label' => Mage::helper('easyweb_smsnotify')->__('Please select'),
|
| 24 |
-
'value' => ''
|
| 25 |
-
),
|
| 26 |
-
array(
|
| 27 |
-
'label' => Mage::helper('easyweb_smsnotify')->__('Turbosms'),
|
| 28 |
-
'value' => 'turbosms'
|
| 29 |
-
),
|
| 30 |
-
array(
|
| 31 |
-
'label' => Mage::helper('easyweb_smsnotify')->__('eSputnik'),
|
| 32 |
-
'value' => 'esputnik'
|
| 33 |
-
),
|
| 34 |
-
|
| 35 |
-
);
|
| 36 |
-
}
|
| 37 |
-
return $this->_options;
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
/**
|
| 41 |
-
* Get all options as key=>value array
|
| 42 |
-
* @return array
|
| 43 |
-
*/
|
| 44 |
-
public function getOptionsForFilter()
|
| 45 |
-
{
|
| 46 |
-
$options = $this->getAllOptions();
|
| 47 |
-
$result = array();
|
| 48 |
-
foreach ($options as $option) {
|
| 49 |
-
$result[$option['value']] = $option['label'];
|
| 50 |
-
}
|
| 51 |
-
return $result;
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
public function toOptionArray()
|
| 55 |
-
{
|
| 56 |
-
return $this->getOptionsForFilter();
|
| 57 |
-
}
|
| 58 |
-
}
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* EasyWeb SmsNotify
|
| 4 |
+
*
|
| 5 |
+
*
|
| 6 |
+
* @category Easyweb
|
| 7 |
+
* @package Easyweb_Core
|
| 8 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
class Easyweb_Smsnotify_Model_Source_Provider extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
|
| 12 |
+
{
|
| 13 |
+
/**
|
| 14 |
+
* Retrieve all options array
|
| 15 |
+
*
|
| 16 |
+
* @return array
|
| 17 |
+
*/
|
| 18 |
+
public function getAllOptions()
|
| 19 |
+
{
|
| 20 |
+
if (is_null($this->_options)) {
|
| 21 |
+
$this->_options = array(
|
| 22 |
+
array(
|
| 23 |
+
'label' => Mage::helper('easyweb_smsnotify')->__('Please select'),
|
| 24 |
+
'value' => ''
|
| 25 |
+
),
|
| 26 |
+
array(
|
| 27 |
+
'label' => Mage::helper('easyweb_smsnotify')->__('Turbosms'),
|
| 28 |
+
'value' => 'turbosms'
|
| 29 |
+
),
|
| 30 |
+
array(
|
| 31 |
+
'label' => Mage::helper('easyweb_smsnotify')->__('eSputnik'),
|
| 32 |
+
'value' => 'esputnik'
|
| 33 |
+
),
|
| 34 |
+
|
| 35 |
+
);
|
| 36 |
+
}
|
| 37 |
+
return $this->_options;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* Get all options as key=>value array
|
| 42 |
+
* @return array
|
| 43 |
+
*/
|
| 44 |
+
public function getOptionsForFilter()
|
| 45 |
+
{
|
| 46 |
+
$options = $this->getAllOptions();
|
| 47 |
+
$result = array();
|
| 48 |
+
foreach ($options as $option) {
|
| 49 |
+
$result[$option['value']] = $option['label'];
|
| 50 |
+
}
|
| 51 |
+
return $result;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
public function toOptionArray()
|
| 55 |
+
{
|
| 56 |
+
return $this->getOptionsForFilter();
|
| 57 |
+
}
|
| 58 |
+
}
|
app/code/local/Easyweb/Smsnotify/controllers/Adminhtml/Config/BalanceController.php
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SmsNotify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
class Easyweb_Smsnotify_Adminhtml_Config_BalanceController extends Mage_Adminhtml_Controller_Action
|
| 12 |
+
{
|
| 13 |
+
protected function _checkBalance()
|
| 14 |
+
{
|
| 15 |
+
$helper = Mage::helper('easyweb_smsnotify');
|
| 16 |
+
|
| 17 |
+
$providerModel = $helper->getProviderModel();
|
| 18 |
+
if ($providerModel) {
|
| 19 |
+
return $providerModel->checkBalance();
|
| 20 |
+
}
|
| 21 |
+
return 0;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* Check whether vat is valid
|
| 26 |
+
*
|
| 27 |
+
* @return void
|
| 28 |
+
*/
|
| 29 |
+
public function checkAction()
|
| 30 |
+
{
|
| 31 |
+
$result = $this->_checkBalance();
|
| 32 |
+
$this->getResponse()->setBody($result);
|
| 33 |
+
}
|
| 34 |
+
}
|
app/code/local/Easyweb/Smsnotify/etc/adminhtml.xml
CHANGED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* EasyWeb SMS Notify
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @category Easyweb
|
| 8 |
-
* @package Easyweb_Smsnotify
|
| 9 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
-
*/
|
| 11 |
-
-->
|
| 12 |
-
<config>
|
| 13 |
-
<acl>
|
| 14 |
-
<resources>
|
| 15 |
-
<admin>
|
| 16 |
-
<children>
|
| 17 |
-
<system>
|
| 18 |
-
<children>
|
| 19 |
-
<config>
|
| 20 |
-
<children>
|
| 21 |
-
<easywebsmsnotify module="easyweb_smsnotify" translate="label">
|
| 22 |
-
<title>Sms Notify</title>
|
| 23 |
-
<sort_order>50</sort_order>
|
| 24 |
-
</easywebsmsnotify>
|
| 25 |
-
</children>
|
| 26 |
-
</config>
|
| 27 |
-
</children>
|
| 28 |
-
</system>
|
| 29 |
-
</children>
|
| 30 |
-
</admin>
|
| 31 |
-
</resources>
|
| 32 |
-
</acl>
|
| 33 |
-
</config>
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SMS Notify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<config>
|
| 13 |
+
<acl>
|
| 14 |
+
<resources>
|
| 15 |
+
<admin>
|
| 16 |
+
<children>
|
| 17 |
+
<system>
|
| 18 |
+
<children>
|
| 19 |
+
<config>
|
| 20 |
+
<children>
|
| 21 |
+
<easywebsmsnotify module="easyweb_smsnotify" translate="label">
|
| 22 |
+
<title>Sms Notify</title>
|
| 23 |
+
<sort_order>50</sort_order>
|
| 24 |
+
</easywebsmsnotify>
|
| 25 |
+
</children>
|
| 26 |
+
</config>
|
| 27 |
+
</children>
|
| 28 |
+
</system>
|
| 29 |
+
</children>
|
| 30 |
+
</admin>
|
| 31 |
+
</resources>
|
| 32 |
+
</acl>
|
| 33 |
+
</config>
|
app/code/local/Easyweb/Smsnotify/etc/config.xml
CHANGED
|
@@ -1,62 +1,78 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* EasyWeb SMS Notify
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @category Easyweb
|
| 8 |
-
* @package Easyweb_Smsnotify
|
| 9 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
-
*/
|
| 11 |
-
-->
|
| 12 |
-
<config>
|
| 13 |
-
<modules>
|
| 14 |
-
<Easyweb_Smsnotify>
|
| 15 |
-
<version>1.0.
|
| 16 |
-
</Easyweb_Smsnotify>
|
| 17 |
-
</modules>
|
| 18 |
-
<global>
|
| 19 |
-
<
|
| 20 |
-
<easyweb_smsnotify>
|
| 21 |
-
<class>
|
| 22 |
-
</easyweb_smsnotify>
|
| 23 |
-
</
|
| 24 |
-
<
|
| 25 |
-
<easyweb_smsnotify>
|
| 26 |
-
<class>
|
| 27 |
-
</easyweb_smsnotify>
|
| 28 |
-
</
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SMS Notify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<config>
|
| 13 |
+
<modules>
|
| 14 |
+
<Easyweb_Smsnotify>
|
| 15 |
+
<version>1.0.3</version>
|
| 16 |
+
</Easyweb_Smsnotify>
|
| 17 |
+
</modules>
|
| 18 |
+
<global>
|
| 19 |
+
<blocks>
|
| 20 |
+
<easyweb_smsnotify>
|
| 21 |
+
<class>Easyweb_Smsnotify_Block</class>
|
| 22 |
+
</easyweb_smsnotify>
|
| 23 |
+
</blocks>
|
| 24 |
+
<models>
|
| 25 |
+
<easyweb_smsnotify>
|
| 26 |
+
<class>Easyweb_Smsnotify_Model</class>
|
| 27 |
+
</easyweb_smsnotify>
|
| 28 |
+
</models>
|
| 29 |
+
<helpers>
|
| 30 |
+
<easyweb_smsnotify>
|
| 31 |
+
<class>Easyweb_Smsnotify_Helper</class>
|
| 32 |
+
</easyweb_smsnotify>
|
| 33 |
+
</helpers>
|
| 34 |
+
</global>
|
| 35 |
+
<default>
|
| 36 |
+
<easywebsmsnotify>
|
| 37 |
+
<general>
|
| 38 |
+
<enabled>0</enabled>
|
| 39 |
+
<text>New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $</text>
|
| 40 |
+
<esputnik_sender>Test</esputnik_sender>
|
| 41 |
+
</general>
|
| 42 |
+
</easywebsmsnotify>
|
| 43 |
+
</default>
|
| 44 |
+
<frontend>
|
| 45 |
+
<events>
|
| 46 |
+
<sales_order_place_after>
|
| 47 |
+
<observers>
|
| 48 |
+
<easyweb_smsnotify>
|
| 49 |
+
<class>easyweb_smsnotify/observer</class>
|
| 50 |
+
<method>sendNotifyToAdminAfterPlaceOrder</method>
|
| 51 |
+
</easyweb_smsnotify>
|
| 52 |
+
</observers>
|
| 53 |
+
</sales_order_place_after>
|
| 54 |
+
</events>
|
| 55 |
+
</frontend>
|
| 56 |
+
<adminhtml>
|
| 57 |
+
<translate>
|
| 58 |
+
<modules>
|
| 59 |
+
<Easyweb_Smsnotify>
|
| 60 |
+
<files>
|
| 61 |
+
<default>Easyweb_Smsnotify.csv</default>
|
| 62 |
+
</files>
|
| 63 |
+
</Easyweb_Smsnotify>
|
| 64 |
+
</modules>
|
| 65 |
+
</translate>
|
| 66 |
+
</adminhtml>
|
| 67 |
+
<admin>
|
| 68 |
+
<routers>
|
| 69 |
+
<adminhtml>
|
| 70 |
+
<args>
|
| 71 |
+
<modules>
|
| 72 |
+
<easyweb_smsnotify before="Mage_Adminhtml">Easyweb_Smsnotify_Adminhtml</easyweb_smsnotify>
|
| 73 |
+
</modules>
|
| 74 |
+
</args>
|
| 75 |
+
</adminhtml>
|
| 76 |
+
</routers>
|
| 77 |
+
</admin>
|
| 78 |
+
</config>
|
app/code/local/Easyweb/Smsnotify/etc/system.xml
CHANGED
|
@@ -1,132 +1,144 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* EasyWeb SMS Notify
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @category Easyweb
|
| 8 |
-
* @package Easyweb_Smsnotify
|
| 9 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
-
*/
|
| 11 |
-
-->
|
| 12 |
-
<config>
|
| 13 |
-
<tabs>
|
| 14 |
-
<easyweb>
|
| 15 |
-
<label>EasyWeb</label>
|
| 16 |
-
<sort_order>1</sort_order>
|
| 17 |
-
</easyweb>
|
| 18 |
-
</tabs>
|
| 19 |
-
<sections>
|
| 20 |
-
<easywebsmsnotify translate="label">
|
| 21 |
-
<label>SMS Notify</label>
|
| 22 |
-
<tab>easyweb</tab>
|
| 23 |
-
<sort_order>10</sort_order>
|
| 24 |
-
<show_in_default>1</show_in_default>
|
| 25 |
-
<groups>
|
| 26 |
-
<general translate="label">
|
| 27 |
-
<label>General</label>
|
| 28 |
-
<frontend_type>text</frontend_type>
|
| 29 |
-
<sort_order>1</sort_order>
|
| 30 |
-
<show_in_default>1</show_in_default>
|
| 31 |
-
<fields>
|
| 32 |
-
<enabled>
|
| 33 |
-
<label>Enable SMS Notify</label>
|
| 34 |
-
<frontend_type>select</frontend_type>
|
| 35 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 36 |
-
<sort_order>1</sort_order>
|
| 37 |
-
<show_in_default>1</show_in_default>
|
| 38 |
-
</enabled>
|
| 39 |
-
<provider>
|
| 40 |
-
<label>Select SMS Provider</label>
|
| 41 |
-
<frontend_type>select</frontend_type>
|
| 42 |
-
<sort_order>10</sort_order>
|
| 43 |
-
<source_model>easyweb_smsnotify/source_provider</source_model>
|
| 44 |
-
<show_in_default>1</show_in_default>
|
| 45 |
-
<depends>
|
| 46 |
-
<enabled>1</enabled>
|
| 47 |
-
</depends>
|
| 48 |
-
</provider>
|
| 49 |
-
<store_phone>
|
| 50 |
-
<label>Store Phone Number</label>
|
| 51 |
-
<frontend_type>text</frontend_type>
|
| 52 |
-
<sort_order>11</sort_order>
|
| 53 |
-
<show_in_default>1</show_in_default>
|
| 54 |
-
<depends>
|
| 55 |
-
<enabled>1</enabled>
|
| 56 |
-
</depends>
|
| 57 |
-
</store_phone>
|
| 58 |
-
<text>
|
| 59 |
-
<label>Message Text</label>
|
| 60 |
-
<frontend_type>textarea</frontend_type>
|
| 61 |
-
<sort_order>12</sort_order>
|
| 62 |
-
<show_in_default>1</show_in_default>
|
| 63 |
-
<comment>You can use %ORDER_ID%, %AMOUNT</comment>
|
| 64 |
-
<depends>
|
| 65 |
-
<enabled>1</enabled>
|
| 66 |
-
</depends>
|
| 67 |
-
</text>
|
| 68 |
-
<!-- Turbosms settings -->
|
| 69 |
-
<turbosms_sender>
|
| 70 |
-
<label>Sender</label>
|
| 71 |
-
<frontend_type>text</frontend_type>
|
| 72 |
-
<sort_order>13</sort_order>
|
| 73 |
-
<show_in_default>1</show_in_default>
|
| 74 |
-
<depends>
|
| 75 |
-
<provider>turbosms</provider>
|
| 76 |
-
</depends>
|
| 77 |
-
</turbosms_sender>
|
| 78 |
-
<turbosms_login>
|
| 79 |
-
<label>Login</label>
|
| 80 |
-
<frontend_type>text</frontend_type>
|
| 81 |
-
<sort_order>20</sort_order>
|
| 82 |
-
<show_in_default>1</show_in_default>
|
| 83 |
-
<comment>Login for gateway, not for account</comment>
|
| 84 |
-
<depends>
|
| 85 |
-
<provider>turbosms</provider>
|
| 86 |
-
</depends>
|
| 87 |
-
</turbosms_login>
|
| 88 |
-
<turbosms_password>
|
| 89 |
-
<label>Password</label>
|
| 90 |
-
<frontend_type>password</frontend_type>
|
| 91 |
-
<sort_order>30</sort_order>
|
| 92 |
-
<show_in_default>1</show_in_default>
|
| 93 |
-
<comment>Password for gateway, not for account</comment>
|
| 94 |
-
<depends>
|
| 95 |
-
<provider>turbosms</provider>
|
| 96 |
-
</depends>
|
| 97 |
-
</turbosms_password>
|
| 98 |
-
<!--
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
<
|
| 102 |
-
<
|
| 103 |
-
<
|
| 104 |
-
<
|
| 105 |
-
<
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
<
|
| 112 |
-
<
|
| 113 |
-
<
|
| 114 |
-
<
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
<
|
| 121 |
-
<
|
| 122 |
-
<
|
| 123 |
-
<
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb SMS Notify
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<config>
|
| 13 |
+
<tabs>
|
| 14 |
+
<easyweb>
|
| 15 |
+
<label>EasyWeb</label>
|
| 16 |
+
<sort_order>1</sort_order>
|
| 17 |
+
</easyweb>
|
| 18 |
+
</tabs>
|
| 19 |
+
<sections>
|
| 20 |
+
<easywebsmsnotify translate="label">
|
| 21 |
+
<label>SMS Notify</label>
|
| 22 |
+
<tab>easyweb</tab>
|
| 23 |
+
<sort_order>10</sort_order>
|
| 24 |
+
<show_in_default>1</show_in_default>
|
| 25 |
+
<groups>
|
| 26 |
+
<general translate="label">
|
| 27 |
+
<label>General</label>
|
| 28 |
+
<frontend_type>text</frontend_type>
|
| 29 |
+
<sort_order>1</sort_order>
|
| 30 |
+
<show_in_default>1</show_in_default>
|
| 31 |
+
<fields>
|
| 32 |
+
<enabled>
|
| 33 |
+
<label>Enable SMS Notify</label>
|
| 34 |
+
<frontend_type>select</frontend_type>
|
| 35 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 36 |
+
<sort_order>1</sort_order>
|
| 37 |
+
<show_in_default>1</show_in_default>
|
| 38 |
+
</enabled>
|
| 39 |
+
<provider>
|
| 40 |
+
<label>Select SMS Provider</label>
|
| 41 |
+
<frontend_type>select</frontend_type>
|
| 42 |
+
<sort_order>10</sort_order>
|
| 43 |
+
<source_model>easyweb_smsnotify/source_provider</source_model>
|
| 44 |
+
<show_in_default>1</show_in_default>
|
| 45 |
+
<depends>
|
| 46 |
+
<enabled>1</enabled>
|
| 47 |
+
</depends>
|
| 48 |
+
</provider>
|
| 49 |
+
<store_phone>
|
| 50 |
+
<label>Store Phone Number</label>
|
| 51 |
+
<frontend_type>text</frontend_type>
|
| 52 |
+
<sort_order>11</sort_order>
|
| 53 |
+
<show_in_default>1</show_in_default>
|
| 54 |
+
<depends>
|
| 55 |
+
<enabled>1</enabled>
|
| 56 |
+
</depends>
|
| 57 |
+
</store_phone>
|
| 58 |
+
<text>
|
| 59 |
+
<label>Message Text</label>
|
| 60 |
+
<frontend_type>textarea</frontend_type>
|
| 61 |
+
<sort_order>12</sort_order>
|
| 62 |
+
<show_in_default>1</show_in_default>
|
| 63 |
+
<comment>You can use %ORDER_ID%, %AMOUNT</comment>
|
| 64 |
+
<depends>
|
| 65 |
+
<enabled>1</enabled>
|
| 66 |
+
</depends>
|
| 67 |
+
</text>
|
| 68 |
+
<!-- Turbosms settings -->
|
| 69 |
+
<turbosms_sender>
|
| 70 |
+
<label>Sender</label>
|
| 71 |
+
<frontend_type>text</frontend_type>
|
| 72 |
+
<sort_order>13</sort_order>
|
| 73 |
+
<show_in_default>1</show_in_default>
|
| 74 |
+
<depends>
|
| 75 |
+
<provider>turbosms</provider>
|
| 76 |
+
</depends>
|
| 77 |
+
</turbosms_sender>
|
| 78 |
+
<turbosms_login>
|
| 79 |
+
<label>Login</label>
|
| 80 |
+
<frontend_type>text</frontend_type>
|
| 81 |
+
<sort_order>20</sort_order>
|
| 82 |
+
<show_in_default>1</show_in_default>
|
| 83 |
+
<comment>Login for gateway, not for account</comment>
|
| 84 |
+
<depends>
|
| 85 |
+
<provider>turbosms</provider>
|
| 86 |
+
</depends>
|
| 87 |
+
</turbosms_login>
|
| 88 |
+
<turbosms_password>
|
| 89 |
+
<label>Password</label>
|
| 90 |
+
<frontend_type>password</frontend_type>
|
| 91 |
+
<sort_order>30</sort_order>
|
| 92 |
+
<show_in_default>1</show_in_default>
|
| 93 |
+
<comment>Password for gateway, not for account</comment>
|
| 94 |
+
<depends>
|
| 95 |
+
<provider>turbosms</provider>
|
| 96 |
+
</depends>
|
| 97 |
+
</turbosms_password>
|
| 98 |
+
<!-- Turbosms settings end -->
|
| 99 |
+
<!-- eSputnik settings -->
|
| 100 |
+
<esputnik_sender>
|
| 101 |
+
<label>Sender</label>
|
| 102 |
+
<frontend_type>text</frontend_type>
|
| 103 |
+
<sort_order>13</sort_order>
|
| 104 |
+
<show_in_default>1</show_in_default>
|
| 105 |
+
<comment>Test by default. You can add new name on esputnik.com.ua</comment>
|
| 106 |
+
<depends>
|
| 107 |
+
<provider>esputnik</provider>
|
| 108 |
+
</depends>
|
| 109 |
+
</esputnik_sender>
|
| 110 |
+
<esputnik_login>
|
| 111 |
+
<label>Login</label>
|
| 112 |
+
<frontend_type>text</frontend_type>
|
| 113 |
+
<sort_order>20</sort_order>
|
| 114 |
+
<show_in_default>1</show_in_default>
|
| 115 |
+
<depends>
|
| 116 |
+
<provider>esputnik</provider>
|
| 117 |
+
</depends>
|
| 118 |
+
</esputnik_login>
|
| 119 |
+
<esputnik_password>
|
| 120 |
+
<label>Password</label>
|
| 121 |
+
<frontend_type>password</frontend_type>
|
| 122 |
+
<sort_order>30</sort_order>
|
| 123 |
+
<show_in_default>1</show_in_default>
|
| 124 |
+
<depends>
|
| 125 |
+
<provider>esputnik</provider>
|
| 126 |
+
</depends>
|
| 127 |
+
</esputnik_password>
|
| 128 |
+
<!-- eSputnik settings end-->
|
| 129 |
+
<check_balance>
|
| 130 |
+
<label>Check balance</label>
|
| 131 |
+
<button_label>Check Balance</button_label>
|
| 132 |
+
<frontend_model>easyweb_smsnotify/adminhtml_system_config_balance</frontend_model>
|
| 133 |
+
<sort_order>40</sort_order>
|
| 134 |
+
<show_in_default>1</show_in_default>
|
| 135 |
+
<depends>
|
| 136 |
+
<enabled>1</enabled>
|
| 137 |
+
</depends>>
|
| 138 |
+
</check_balance>
|
| 139 |
+
</fields>
|
| 140 |
+
</general>
|
| 141 |
+
</groups>
|
| 142 |
+
</easywebsmsnotify>
|
| 143 |
+
</sections>
|
| 144 |
+
</config>
|
app/design/adminhtml/default/default/template/smsnotify/system/config/balance.phtml
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* EasyWeb SmsNotify
|
| 4 |
+
*
|
| 5 |
+
*
|
| 6 |
+
* @category Easyweb
|
| 7 |
+
* @package Easyweb_Smsnotify
|
| 8 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 9 |
+
*/
|
| 10 |
+
?>
|
| 11 |
+
<?php
|
| 12 |
+
/**
|
| 13 |
+
* @see Easyweb_Smsnotify_Block_Adminhtml_System_Config_Balance
|
| 14 |
+
*/
|
| 15 |
+
?>
|
| 16 |
+
<script type="text/javascript">
|
| 17 |
+
//<![CDATA[
|
| 18 |
+
function checkBalance() {
|
| 19 |
+
var elem = $('<?php echo $this->getHtmlId() ?>');
|
| 20 |
+
var provider = $('easywebsmsnotify_general_provider').value;
|
| 21 |
+
|
| 22 |
+
params = {
|
| 23 |
+
provider: provider,
|
| 24 |
+
login: $('easywebsmsnotify_general_'+provider+'_login'),
|
| 25 |
+
password: $('easywebsmsnotify_general_'+provider+'_password')
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
new Ajax.Request('<?php echo $this->getAjaxUrl() ?>', {
|
| 29 |
+
parameters: params,
|
| 30 |
+
onSuccess: function(response) {
|
| 31 |
+
button = '<?php echo $this->__('Error!') ?>';
|
| 32 |
+
try {
|
| 33 |
+
response = response.responseText;
|
| 34 |
+
if (response !== '') {
|
| 35 |
+
button = '<?php echo $this->__('Success!') ?>';
|
| 36 |
+
elem.removeClassName('fail').addClassName('success')
|
| 37 |
+
$('check_balance_result').update('<?php echo $this->__('Your balance is:');?>'+' <strong>'+response+'</strong>');
|
| 38 |
+
} else {
|
| 39 |
+
elem.removeClassName('success').addClassName('fail');
|
| 40 |
+
$('check_balance_result').update('');
|
| 41 |
+
}
|
| 42 |
+
} catch (e) {
|
| 43 |
+
elem.removeClassName('success').addClassName('fail')
|
| 44 |
+
$('check_balance_result').update('');
|
| 45 |
+
}
|
| 46 |
+
$('check_balance_result_button').update(button);
|
| 47 |
+
}
|
| 48 |
+
});
|
| 49 |
+
}
|
| 50 |
+
//]]>
|
| 51 |
+
</script>
|
| 52 |
+
<button onclick="javascript:checkBalance(); return false;" class="scalable" type="button" id="<?php echo $this->getHtmlId() ?>">
|
| 53 |
+
<span id="check_balance_result_button"><?php echo $this->escapeHtml($this->getButtonLabel()) ?></span>
|
| 54 |
+
</button>
|
| 55 |
+
<span id="check_balance_result"></span>
|
app/etc/modules/Easyweb_Smsnotify.xml
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* EasyWeb
|
| 5 |
-
*
|
| 6 |
-
*
|
| 7 |
-
* @category Easyweb
|
| 8 |
-
* @package Easyweb_Smsnotify
|
| 9 |
-
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
-
*/
|
| 11 |
-
-->
|
| 12 |
-
<config>
|
| 13 |
-
<modules>
|
| 14 |
-
<Easyweb_Smsnotify>
|
| 15 |
-
<active>true</active>
|
| 16 |
-
<codePool>local</codePool>
|
| 17 |
-
</Easyweb_Smsnotify>
|
| 18 |
-
</modules>
|
| 19 |
-
</config>
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* EasyWeb
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* @category Easyweb
|
| 8 |
+
* @package Easyweb_Smsnotify
|
| 9 |
+
* @copyright Copyright (c) 2014 EasyWeb. (http://easyweb.org.ua)
|
| 10 |
+
*/
|
| 11 |
+
-->
|
| 12 |
+
<config>
|
| 13 |
+
<modules>
|
| 14 |
+
<Easyweb_Smsnotify>
|
| 15 |
+
<active>true</active>
|
| 16 |
+
<codePool>local</codePool>
|
| 17 |
+
</Easyweb_Smsnotify>
|
| 18 |
+
</modules>
|
| 19 |
+
</config>
|
app/locale/en_US/Easyweb_Smsnotify.csv
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
"SMS Notify", "SMS Notify"
|
| 2 |
-
"Enable SMS Notify", "Enable SMS Notify"
|
| 3 |
-
"Select SMS Provider", "Select SMS Provider"
|
| 4 |
-
"Store Phone Number", "Store Phone Number"
|
| 5 |
-
"Message Text", "Message Text"
|
| 6 |
-
"Login", "Login"
|
| 7 |
-
"Login for gateway, not for account", "Login for gateway, not for account"
|
| 8 |
-
"Password", "Password"
|
| 9 |
-
"Password for gateway, not for account", "Password for gateway, not for account"
|
| 10 |
-
"Sender", "Sender"
|
| 11 |
-
"You can use %ORDER_ID%, %AMOUNT", "You can use %ORDER_ID%, %AMOUNT"
|
| 12 |
-
"New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $", "New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $"
|
| 13 |
-
"General", "General"
|
| 14 |
"Test by default. You can add new name on esputnik.com.ua", "Test by default. You can add new name on esputnik.com.ua"
|
| 1 |
+
"SMS Notify", "SMS Notify"
|
| 2 |
+
"Enable SMS Notify", "Enable SMS Notify"
|
| 3 |
+
"Select SMS Provider", "Select SMS Provider"
|
| 4 |
+
"Store Phone Number", "Store Phone Number"
|
| 5 |
+
"Message Text", "Message Text"
|
| 6 |
+
"Login", "Login"
|
| 7 |
+
"Login for gateway, not for account", "Login for gateway, not for account"
|
| 8 |
+
"Password", "Password"
|
| 9 |
+
"Password for gateway, not for account", "Password for gateway, not for account"
|
| 10 |
+
"Sender", "Sender"
|
| 11 |
+
"You can use %ORDER_ID%, %AMOUNT", "You can use %ORDER_ID%, %AMOUNT"
|
| 12 |
+
"New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $", "New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $"
|
| 13 |
+
"General", "General"
|
| 14 |
"Test by default. You can add new name on esputnik.com.ua", "Test by default. You can add new name on esputnik.com.ua"
|
app/locale/ru_RU/Easyweb_Smsnotify.csv
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
"SMS Notify", "SMS уведомления"
|
| 2 |
-
"Enable SMS Notify", "Включить SMS уведомления"
|
| 3 |
-
"Select SMS Provider", "Выберите SMS провадера"
|
| 4 |
-
"Store Phone Number", "Телефон магазина"
|
| 5 |
-
"Message Text", "Текст сообщения"
|
| 6 |
-
"Login", "Логин"
|
| 7 |
-
"Login for gateway, not for account", "Логин для шлюза, а не для аккаунта"
|
| 8 |
-
"Password", "Пароль"
|
| 9 |
-
"Password for gateway, not for account", "Пароль для шлюза, а не для аккаунта"
|
| 10 |
-
"Sender", "Отправитель"
|
| 11 |
-
"You can use %ORDER_ID%, %AMOUNT", "Вы можете использовать %ORDER_ID%, %AMOUNT%"
|
| 12 |
-
"New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $", "Новый заказ был оформлен в вашем магазине. № %ORDER_ID%, сумма %AMOUNT% $"
|
| 13 |
-
"General", "Основные"
|
| 14 |
"Test by default. You can add new name on esputnik.com.ua", "Test по умолчанию. Вы можете добавить новое имя на сайте esputnik.com.ua"
|
| 1 |
+
"SMS Notify", "SMS уведомления"
|
| 2 |
+
"Enable SMS Notify", "Включить SMS уведомления"
|
| 3 |
+
"Select SMS Provider", "Выберите SMS провадера"
|
| 4 |
+
"Store Phone Number", "Телефон магазина"
|
| 5 |
+
"Message Text", "Текст сообщения"
|
| 6 |
+
"Login", "Логин"
|
| 7 |
+
"Login for gateway, not for account", "Логин для шлюза, а не для аккаунта"
|
| 8 |
+
"Password", "Пароль"
|
| 9 |
+
"Password for gateway, not for account", "Пароль для шлюза, а не для аккаунта"
|
| 10 |
+
"Sender", "Отправитель"
|
| 11 |
+
"You can use %ORDER_ID%, %AMOUNT", "Вы можете использовать %ORDER_ID%, %AMOUNT%"
|
| 12 |
+
"New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $", "Новый заказ был оформлен в вашем магазине. № %ORDER_ID%, сумма %AMOUNT% $"
|
| 13 |
+
"General", "Основные"
|
| 14 |
"Test by default. You can add new name on esputnik.com.ua", "Test по умолчанию. Вы можете добавить новое имя на сайте esputnik.com.ua"
|
app/locale/uk_UA/Easyweb_Smsnotify.csv
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
-
"SMS Notify", "SMS сповіщення"
|
| 2 |
-
"Enable SMS Notify", "Включити SMS сповіщення"
|
| 3 |
-
"Select SMS Provider", "Вибиріть SMS провадера"
|
| 4 |
-
"Store Phone Number", "Телефон магазина"
|
| 5 |
-
"Message Text", "Текст повідомлення"
|
| 6 |
-
"Login", "Логін"
|
| 7 |
-
"Login for gateway, not for account", "Логін для шлюзу, а не для аккаунта"
|
| 8 |
-
"Password", "Пароль"
|
| 9 |
-
"Password for gateway, not for account", "Пароль для шлюзу, а не для аккаунта"
|
| 10 |
-
"Sender", "Отправитель"
|
| 11 |
-
"You can use %ORDER_ID%, %AMOUNT", "Ви можете використовувати %ORDER_ID%, %AMOUNT%"
|
| 12 |
-
"New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $", "Новий заказ був у вашому магазині. № %ORDER_ID%, сума %AMOUNT% $"
|
| 13 |
-
"General", "Загальні"
|
| 14 |
"Test by default. You can add new name on esputnik.com.ua", "Test за замовчуванням. Ви можете додати нове iм'я на сайтi esputnik.com.ua"
|
| 1 |
+
"SMS Notify", "SMS сповіщення"
|
| 2 |
+
"Enable SMS Notify", "Включити SMS сповіщення"
|
| 3 |
+
"Select SMS Provider", "Вибиріть SMS провадера"
|
| 4 |
+
"Store Phone Number", "Телефон магазина"
|
| 5 |
+
"Message Text", "Текст повідомлення"
|
| 6 |
+
"Login", "Логін"
|
| 7 |
+
"Login for gateway, not for account", "Логін для шлюзу, а не для аккаунта"
|
| 8 |
+
"Password", "Пароль"
|
| 9 |
+
"Password for gateway, not for account", "Пароль для шлюзу, а не для аккаунта"
|
| 10 |
+
"Sender", "Отправитель"
|
| 11 |
+
"You can use %ORDER_ID%, %AMOUNT", "Ви можете використовувати %ORDER_ID%, %AMOUNT%"
|
| 12 |
+
"New order is placed in your shop. # %ORDER_ID%, amount %AMOUNT% $", "Новий заказ був у вашому магазині. № %ORDER_ID%, сума %AMOUNT% $"
|
| 13 |
+
"General", "Загальні"
|
| 14 |
"Test by default. You can add new name on esputnik.com.ua", "Test за замовчуванням. Ви можете додати нове iм'я на сайтi esputnik.com.ua"
|
package.xml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Easyweb_Smsnotify</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
-
<license uri="http://opensource.org/licenses/
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>SMS Notifications about new orders.
|
|
@@ -15,6 +15,7 @@ SMS notification module integrated with the Ukrainian SMS providers</p>&#x
|
|
| 15 |
List of features:
|
| 16 |
<ul>
|
| 17 |
<li>Notifications of new order</li>
|
|
|
|
| 18 |
<li>Ukrainian SMS Providers</li>
|
| 19 |
</ul>
|
| 20 |
Supporting providers:
|
|
@@ -33,6 +34,7 @@ Supporting providers:
|
|
| 33 |
<ul>
|
| 34 |
<li>Уведомление о новом заказе</li>
|
| 35 |
<li>Поддержка украинских провайдеров СМС</li>
|
|
|
|
| 36 |
</ul>
|
| 37 |

|
| 38 |
Поддерживаемые провайдеры:
|
|
@@ -43,11 +45,14 @@ Supporting providers:
|
|
| 43 |
</p>
|
| 44 |
<p>Планы на будущее: больше провайдеров, проверка баланса, использование нескольких провайдеров, отправка сообщения пользователю, уведомление об изменении статуса заказа, отправка сообщения нескольким пользователям.</p>
|
| 45 |
</description>
|
| 46 |
-
<notes>
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
<
|
|
|
|
|
|
|
|
|
|
| 51 |
<compatible/>
|
| 52 |
-
<dependencies><required><php><min>5.
|
| 53 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Easyweb_Smsnotify</name>
|
| 4 |
+
<version>1.0.3</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
+
<license uri="http://opensource.org/licenses/gpl-license.php">GNU General Public License</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>SMS Notifications about new orders.
|
| 15 |
List of features:
|
| 16 |
<ul>
|
| 17 |
<li>Notifications of new order</li>
|
| 18 |
+
<li>Balance info</li>
|
| 19 |
<li>Ukrainian SMS Providers</li>
|
| 20 |
</ul>
|
| 21 |
Supporting providers:
|
| 34 |
<ul>
|
| 35 |
<li>Уведомление о новом заказе</li>
|
| 36 |
<li>Поддержка украинских провайдеров СМС</li>
|
| 37 |
+
<li>проверка баланса</li>
|
| 38 |
</ul>
|
| 39 |

|
| 40 |
Поддерживаемые провайдеры:
|
| 45 |
</p>
|
| 46 |
<p>Планы на будущее: больше провайдеров, проверка баланса, использование нескольких провайдеров, отправка сообщения пользователю, уведомление об изменении статуса заказа, отправка сообщения нескольким пользователям.</p>
|
| 47 |
</description>
|
| 48 |
+
<notes>Balance info
|
| 49 |
+
Fix issues with eSputnik provider
|
| 50 |
+

|
| 51 |
+
</notes>
|
| 52 |
+
<authors><author><name>Artem Kruzhalin</name><user>EasyWeb_UA</user><email>artem@easyweb.org.ua</email></author></authors>
|
| 53 |
+
<date>2014-11-05</date>
|
| 54 |
+
<time>17:13:34</time>
|
| 55 |
+
<contents><target name="magelocal"><dir name="Easyweb"><dir name="Smsnotify"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Balance.php" hash="916c1a7348818d73cf10080e8709db2f"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5d75fa9ed70e8c7b68bb215e5b139e2e"/></dir><dir name="Model"><file name="Observer.php" hash="ea0bc16fbc35bb64dc773018636a66d9"/><dir name="Provider"><file name="Abstract.php" hash="07ecd781e758901208731083ef88d13a"/><file name="Esputnik.php" hash="ab46165ec500b9118e7f2efc29234972"/><file name="Turbosms.php" hash="abf00df0ba296df442f83ae8c54cc606"/></dir><dir name="Source"><file name="Provider.php" hash="3d78e3f1480db24c499682b0e167c950"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Config"><file name="BalanceController.php" hash="8dd5b3dd80dbf3974143b25eb3bc0554"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="3febe7f1c4ab64ec2ec586cb8189d07f"/><file name="config.xml" hash="d5d9dd2ff89153ab077273874a989e54"/><file name="system.xml" hash="ab61fd7b71aa74fcab0f48061f37d990"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Easyweb_Smsnotify.xml" hash="cc03671bbc4017389c86cadd9a260ab8"/></dir></target><target name="magelocale"><dir name="ru_RU"><file name="Easyweb_Smsnotify.csv" hash="b097a56212d7653ee8ac79a97ec1bbfc"/></dir><dir name="uk_UA"><file name="Easyweb_Smsnotify.csv" hash="599e5df3049ce1fa352edae9796eb3ab"/></dir><dir name="en_US"><file name="Easyweb_Smsnotify.csv" hash="683f5fd6cff04031388214823fa2d7cf"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="smsnotify"><dir name="system"><dir name="config"><file name="balance.phtml" hash="f33876a7260e46ba25e147154fc48109"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
| 56 |
<compatible/>
|
| 57 |
+
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
| 58 |
</package>
|
