Smsapi_Sms - Version 0.2.0

Version Notes

+ fix low balance notification
+ add smsapi.pl or smsapi.pl switching
+ remove test mode
+ change soap to rest interface

Download this release

Release Info

Developer SMSAPI
Extension Smsapi_Sms
Version 0.2.0
Comparing to
See all releases


Code changes from version 0.1.3 to 0.2.0

Files changed (139) hide show
  1. app/code/community/Smsapi/Sms/Model/Adminhtml/Attributes.php +24 -38
  2. app/code/community/Smsapi/Sms/Model/Adminhtml/Balancelow.php +37 -0
  3. app/code/community/Smsapi/Sms/Model/Adminhtml/Version.php +40 -0
  4. app/code/community/Smsapi/Sms/Model/ApiClient.php +0 -148
  5. app/code/community/Smsapi/Sms/Model/Config.php +84 -65
  6. app/code/community/Smsapi/Sms/Model/Observer.php +34 -28
  7. app/code/community/Smsapi/Sms/controllers/IndexController.php +20 -15
  8. app/code/community/Smsapi/Sms/etc/config.xml +1 -1
  9. app/code/community/Smsapi/Sms/etc/system.xml +18 -28
  10. app/code/community/Smsapi/Sms/smsapi-classes/AbstractsSmsapi.php +48 -0
  11. app/code/community/Smsapi/Sms/smsapi-classes/Sender.php +58 -0
  12. app/code/community/Smsapi/Sms/smsapi-classes/SenderFactory.php +21 -0
  13. app/code/community/Smsapi/Sms/smsapi-classes/Sms.php +43 -0
  14. app/code/community/Smsapi/Sms/smsapi-classes/SmsFactory.php +22 -0
  15. app/code/community/Smsapi/Sms/smsapi-classes/User.php +21 -0
  16. app/code/community/Smsapi/Sms/smsapi-classes/UserFactory.php +21 -0
  17. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/AbstractAction.php +287 -0
  18. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactAdd.php +90 -0
  19. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactAddByEmail.php +29 -0
  20. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactAddByPhoneNumber.php +29 -0
  21. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactCount.php +115 -0
  22. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactDelete.php +37 -0
  23. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactDeleteMultiple.php +21 -0
  24. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactEdit.php +115 -0
  25. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGet.php +37 -0
  26. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupAdd.php +45 -0
  27. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupDelete.php +45 -0
  28. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupGet.php +45 -0
  29. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupList.php +37 -0
  30. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactList.php +43 -0
  31. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactsAction.php +52 -0
  32. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldAdd.php +70 -0
  33. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldDelete.php +37 -0
  34. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldEdit.php +79 -0
  35. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldList.php +26 -0
  36. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupAdd.php +51 -0
  37. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupDelete.php +39 -0
  38. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupEdit.php +58 -0
  39. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupGet.php +39 -0
  40. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupList.php +41 -0
  41. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupMemberAdd.php +42 -0
  42. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupMemberDelete.php +21 -0
  43. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupMemberGet.php +11 -0
  44. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionAdd.php +80 -0
  45. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionDelete.php +45 -0
  46. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionEdit.php +87 -0
  47. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionGet.php +45 -0
  48. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionList.php +37 -0
  49. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Mms/Delete.php +103 -0
  50. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Mms/Get.php +96 -0
  51. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Mms/Send.php +152 -0
  52. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactAdd.php +167 -0
  53. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactDelete.php +59 -0
  54. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactEdit.php +64 -0
  55. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactGet.php +69 -0
  56. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactList.php +208 -0
  57. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupAdd.php +61 -0
  58. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupDelete.php +78 -0
  59. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupEdit.php +44 -0
  60. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupGet.php +60 -0
  61. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupList.php +41 -0
  62. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/Add.php +50 -0
  63. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/Delete.php +57 -0
  64. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/SenderDefault.php +50 -0
  65. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/SenderList.php +41 -0
  66. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sms/Delete.php +73 -0
  67. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sms/Get.php +100 -0
  68. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sms/Send.php +349 -0
  69. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/Add.php +172 -0
  70. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/Edit.php +33 -0
  71. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/Get.php +60 -0
  72. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/GetPoints.php +59 -0
  73. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/UserList.php +40 -0
  74. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Vms/Delete.php +109 -0
  75. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Vms/Get.php +103 -0
  76. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Vms/Send.php +253 -0
  77. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/ActionFactory.php +72 -0
  78. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/ContactsFactory.php +200 -0
  79. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/MmsFactory.php +60 -0
  80. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/PhonebookFactory.php +162 -0
  81. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/AbstractResponse.php +39 -0
  82. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/ContactResponse.php +231 -0
  83. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/AbstractContactsResponse.php +13 -0
  84. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/ContactResponse.php +119 -0
  85. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/ContactsResponse.php +14 -0
  86. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/CountableResponse.php +10 -0
  87. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/DeleteResponse.php +9 -0
  88. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/FieldResponse.php +41 -0
  89. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/FieldsResponse.php +14 -0
  90. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/GroupResponse.php +102 -0
  91. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/GroupsResponse.php +14 -0
  92. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/IdentifiableResponse.php +10 -0
  93. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/ListResponse.php +39 -0
  94. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/PermissionResponse.php +52 -0
  95. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/PermissionsResponse.php +14 -0
  96. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/SizeResponse.php +19 -0
  97. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/ContactsResponse.php +39 -0
  98. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/CountableResponse.php +33 -0
  99. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/ErrorResponse.php +43 -0
  100. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/GroupResponse.php +84 -0
  101. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/GroupsResponse.php +39 -0
  102. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/MessageResponse.php +111 -0
  103. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/PointsResponse.php +87 -0
  104. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/RawResponse.php +32 -0
  105. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Response.php +8 -0
  106. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/SenderResponse.php +80 -0
  107. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/SendersResponse.php +38 -0
  108. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/StatusResponse.php +73 -0
  109. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/UserResponse.php +173 -0
  110. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/UsersResponse.php +38 -0
  111. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/SenderFactory.php +70 -0
  112. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/SmsFactory.php +58 -0
  113. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/UserFactory.php +81 -0
  114. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/VmsFactory.php +60 -0
  115. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Autoload.php +38 -0
  116. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Client.php +94 -0
  117. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ActionException.php +7 -0
  118. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ClientException.php +7 -0
  119. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ContactsException.php +55 -0
  120. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/HostException.php +7 -0
  121. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/InvalidParameterException.php +7 -0
  122. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ProxyException.php +7 -0
  123. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/SmsapiException.php +37 -0
  124. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Http/AbstractHttp.php +254 -0
  125. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Http/Curl.php +102 -0
  126. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Http/Native.php +113 -0
  127. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Proxy.php +34 -0
  128. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Uri.php +43 -0
  129. app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/autoload_classmap.php +66 -0
  130. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/autoload.php +7 -0
  131. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/ClassLoader.php +413 -0
  132. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/LICENSE +21 -0
  133. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_classmap.php +120 -0
  134. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_namespaces.php +9 -0
  135. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_psr4.php +10 -0
  136. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_real.php +50 -0
  137. app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/installed.json +1 -0
  138. app/locale/pl_PL/Smsapi_Sms.csv +4 -2
  139. package.xml +10 -9
app/code/community/Smsapi/Sms/Model/Adminhtml/Attributes.php CHANGED
@@ -3,58 +3,44 @@
3
 
4
  /**
5
  * SMS API Configuration attributes class
6
- *
7
  * @category Smsapi
8
  * @package SMS
9
  * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
  * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
12
- * ...
13
- */
 
 
 
 
 
 
 
14
 
15
 
16
- class Smsapi_Sms_Model_Adminhtml_Attributes {
17
-
18
-
19
  /**
20
- * Getting senders from SMSAPI and
21
  * generate attributes for configuration panel
22
- *
23
- *
24
  * @return array
25
  */
26
- public function toOptionArray() {
 
27
 
28
- $attributes = array(
29
- //array('label'=>Mage::helper('sms')->__('Use ECO SMS (cheaper version without sender)'),'value'=>'eco_msg') //eco messages disabled
30
- );
 
31
 
32
-
33
- $api = Mage::getModel('sms/apiClient');
34
- $config = Mage::getModel('sms/config');
35
-
36
  try {
37
-
38
- $response = $api->connect()->getSenders();
39
- if ($response->result!=0)
40
- return $attributes;
41
-
42
- if (!empty($response->senders)) foreach ($response->senders as $sender) {
43
- array_push($attributes, array('label'=>$sender,'value'=>$sender));
44
- }
45
-
46
- }
47
- catch ( Exception $e) {
48
- Mage::log('SMSAPI (getSenders()): '.$e->getMessage());
49
  }
50
-
51
- if (empty($attributes))
52
- array_push($attributes, array('label'=>'SMSAPI.pl','value'=>'SMSAPI.pl'));
53
-
54
- return $attributes;
55
-
56
  }
57
-
58
-
59
-
60
  }
3
 
4
  /**
5
  * SMS API Configuration attributes class
6
+ *
7
  * @category Smsapi
8
  * @package SMS
9
  * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
10
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
  * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
12
+ * ...
13
+ */
14
+
15
+ require_once dirname(dirname(__DIR__)) . '/smsapi-classes/SenderFactory.php';
16
+ require_once dirname(dirname(__DIR__)) . '/smsapi-classes/Sender.php';
17
+
18
+
19
+ class Smsapi_Sms_Model_Adminhtml_Attributes
20
+ {
21
 
22
 
 
 
 
23
  /**
24
+ * Getting senders from SMSAPI and
25
  * generate attributes for configuration panel
26
+ *
27
+ *
28
  * @return array
29
  */
30
+ public function toOptionArray()
31
+ {
32
 
33
+ /**
34
+ * @var Smsapi_Sms_Model_Config $config
35
+ */
36
+ $config = Mage::getModel('sms/config');
37
 
 
 
 
 
38
  try {
39
+ $senderFactory = new SenderFactory($config->getApiLogin(), $config->getApiPassword(), $config->getSmsapiVersion());
40
+ $sender = new Sender($senderFactory->getActionFactory(), null, null, '--DEFAULT--');
41
+ return $sender->getSenders();
42
+ } catch (\SMSApi\Exception\SmsapiException $e) {
43
+ return [Mage::helper('sms')->__('Authorization fail')];
 
 
 
 
 
 
 
44
  }
 
 
 
 
 
 
45
  }
 
 
 
46
  }
app/code/community/Smsapi/Sms/Model/Adminhtml/Balancelow.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //File: app/code/community/Smsapi/Sms/Model/Adminhtml/Attributes.php
3
+
4
+ /**
5
+ * SMS API Configuration attributes class
6
+ *
7
+ * @category Smsapi
8
+ * @package SMS
9
+ * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
12
+ * ...
13
+ */
14
+
15
+ require_once dirname(dirname(__DIR__)) .'/smsapi-classes/SenderFactory.php';
16
+ require_once dirname(dirname(__DIR__)) .'/smsapi-classes/Sender.php';
17
+
18
+
19
+ class Smsapi_Sms_Model_Adminhtml_Balancelow {
20
+
21
+
22
+ /**
23
+ * Getting senders from SMSAPI and
24
+ * generate attributes for configuration panel
25
+ *
26
+ *
27
+ * @return array
28
+ */
29
+ public function toOptionArray() {
30
+
31
+ $observer = new Smsapi_Sms_Model_Observer();
32
+ $observer->checkPointsLimit();
33
+ }
34
+
35
+
36
+
37
+ }
app/code/community/Smsapi/Sms/Model/Adminhtml/Version.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //File: app/code/community/Smsapi/Sms/Model/Adminhtml/Attributes.php
3
+
4
+ /**
5
+ * SMS API Configuration attributes class
6
+ *
7
+ * @category Smsapi
8
+ * @package SMS
9
+ * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
+ * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
12
+ * ...
13
+ */
14
+
15
+ require_once dirname(dirname(__DIR__)) . '/smsapi-classes/SenderFactory.php';
16
+ require_once dirname(dirname(__DIR__)) . '/smsapi-classes/Sender.php';
17
+
18
+
19
+ class Smsapi_Sms_Model_Adminhtml_Version
20
+ {
21
+ /**
22
+ * Getting api version and
23
+ * generate attributes for configuration panel
24
+ *
25
+ *
26
+ * @return array
27
+ */
28
+ public function toOptionArray()
29
+ {
30
+
31
+ $versions = array(
32
+ 'https://api.smsapi.pl' => 'smsapi.pl',
33
+ 'https://api.smsapi.com' => 'smsapi.com'
34
+ );
35
+
36
+ return $versions;
37
+ }
38
+
39
+
40
+ }
app/code/community/Smsapi/Sms/Model/ApiClient.php DELETED
@@ -1,148 +0,0 @@
1
- <?php
2
-
3
- //File: app/code/community/Smsapi/Sms/Model/ApiClient.php
4
-
5
- /**
6
- * SMS API client class
7
- *
8
- * @category Smsapi
9
- * @package SMS
10
- * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
11
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
12
- * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
13
- * ...
14
- */
15
-
16
- class Smsapi_Sms_Model_ApiClient {
17
-
18
-
19
- protected $_client = array();
20
- protected $_sms = array();
21
- protected $_hSopa;
22
-
23
-
24
-
25
-
26
- public function __construct() {
27
-
28
- $this->getClientData();
29
-
30
- }
31
-
32
-
33
-
34
-
35
- /**
36
- * Get user authorization data from config and save it to $_client
37
- *
38
- * @param type $ssl
39
- * @return \Smsapi_Sms_Model_ApiClient
40
- */
41
- public function getClientData() {
42
-
43
- $config = Mage::getModel('sms/config');
44
-
45
- $this->_client = array(
46
- 'username' => $config->getApiLogin(),
47
- 'password' => md5($config->getApiPassword())
48
- );
49
-
50
- return $this->_client;
51
-
52
- }
53
-
54
-
55
- /**
56
- * Run SoapClient connection
57
- *
58
- * @param type $ssl
59
- * @return \Smsapi_Sms_Model_ApiClient
60
- */
61
- public function connect($ssl = true) {
62
-
63
- $this->_hSopa = new SoapClient(
64
- ( $ssl == true ? 'https' : 'http' ) .'://www.smsapi.pl/soap/v2/webservice?wsdl',
65
- array(
66
- 'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
67
- 'cache_wsdl' => WSDL_CACHE_NONE,
68
- 'trace' => TRUE
69
- )
70
- );
71
-
72
- return $this;
73
-
74
-
75
- }
76
-
77
-
78
-
79
- /**
80
- * Adding to SMS additional data
81
- * for SMSAPI Soap Client
82
- *
83
- *
84
- * @param type $sms_data
85
- * @return \Smsapi_Sms_Model_ApiClient
86
- */
87
-
88
-
89
-
90
- public function msgContent($sms_data) {
91
-
92
- $this->_sms = $sms_data;
93
- $this->_sms['idx'] = uniqid();
94
- $this->_sms['date_send'] = 0;
95
- $this->_sms['details'] = 1;
96
-
97
- return $this;
98
-
99
- }
100
-
101
-
102
-
103
- /**
104
- * Sending SMS to client.
105
- *
106
- * @return type
107
- */
108
- public function send() {
109
-
110
- $params = array(
111
- 'client' => $this->_client,
112
- 'sms' => $this->_sms
113
- );
114
-
115
- return $this->_hSopa->send_sms($params);
116
-
117
- }
118
-
119
-
120
-
121
- /**
122
- * Getting Senders list from SMSAPI site
123
- *
124
- * @return type
125
- */
126
- public function getSenders() {
127
-
128
- return $this->_hSopa->get_senders($this->_client);
129
-
130
-
131
- }
132
-
133
-
134
-
135
- /**
136
- * Getting points amount from SMSAPI account
137
- *
138
- * @return type
139
- */
140
- public function getPoints() {
141
-
142
- return $this->_hSopa->get_points($this->_client);
143
-
144
- }
145
-
146
-
147
-
148
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Smsapi/Sms/Model/Config.php CHANGED
@@ -2,28 +2,28 @@
2
  //File: app/code/community/Smsapi/Sms/Model/Config.php
3
 
4
  /**
5
- * SMS API config class
6
- *
7
- *
8
  * @category Smsapi
9
  * @package SMS
10
  * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
11
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
12
  * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
13
- * ...
14
- */
 
 
15
 
16
-
17
- class Smsapi_Sms_Model_Config {
18
-
19
  const LOW_POINTS_WARNING_MESSAGE = 'Warning: Low points level at your SMSAPI account. Buy credit.';
20
-
21
 
22
  /**
23
  * getting API login from SMSAPI config
24
  * @return string
25
- */
26
- public function getApiLogin() {
 
27
  return Mage::getStoreConfig('sms/main_conf/apilogin');
28
 
29
 
@@ -33,96 +33,115 @@ class Smsapi_Sms_Model_Config {
33
  /**
34
  * getting API password from SMSAPI config
35
  * @return string
36
- */
37
- public function getApiPassword() {
 
38
  $encrypted_pass = Mage::getStoreConfig('sms/main_conf/apipassword');
39
  return Mage::helper('core')->decrypt($encrypted_pass);
40
-
41
  }
42
-
43
 
44
  /**
45
  * getting storename from SMSAPI config
46
  * @return string
47
- */
48
- public function getApiStoreName() {
 
49
  return Mage::getStoreConfig('sms/main_conf/storename');
50
  }
51
 
52
-
53
- /**
54
  * Checks if allowed only single message
55
  * @return int
56
- */
57
- public function isSingle() {
 
58
  $confRule = Mage::getStoreConfig('sms/main_conf/allow_long_sms');
59
-
60
- return ($confRule == 1) ? 0:1;
61
-
62
  }
63
-
64
  /**
65
  * Checks if message is Eco
66
  * @return int
67
  */
68
-
69
- public function isEco() {
70
-
71
- return 0; //ECO messages turned off
72
-
 
73
  //$confRule = Mage::getStoreConfig('sms/main_conf/sender');
74
  //return ($confRule == 'eco_msg') ? 1:0;
75
-
76
  }
77
-
78
- /**
79
  * getting message sender
80
  * @return string
81
- */
82
- public function getSender() {
83
-
 
84
  return Mage::getStoreConfig('sms/main_conf/sender');
85
-
86
  }
87
-
88
- /**
89
  * getting SMS templates from SMSAPI config
90
  * @return string
91
- */
92
- public function getMessageTemplate($template) {
93
-
94
- $templateContent = Mage::getStoreConfig('sms/templates/status_'.$template);
95
-
96
- if (Mage::getStoreConfig('sms/templates/status_'. $template .'_active') && !empty($templateContent))
 
97
  return $templateContent;
98
-
99
  }
100
-
101
- public function pointsAllertLimit() {
102
- return floatval(str_replace(',','.',Mage::getStoreConfig('sms/main_conf/points_alert_limit')));
 
103
  }
104
-
105
- /**
106
  * checks if module is in test/devel mode
107
  * @return string
108
- */
109
- public function testMode() {
110
-
 
111
  $testmode = Mage::getStoreConfig('sms/admin_mode/test_mode');
112
-
113
- return ($testmode==1) ? 1:0;
114
-
115
  }
116
-
117
- /**
118
  * checks if SMSAPI module is enabled
119
  * @return string
120
- */
121
- public function isApiEnabled() {
122
-
 
123
  return Mage::getStoreConfig('sms/main_conf/active');
124
-
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
126
-
127
-
128
  }
2
  //File: app/code/community/Smsapi/Sms/Model/Config.php
3
 
4
  /**
5
+ * SMS API config class
6
+ *
7
+ *
8
  * @category Smsapi
9
  * @package SMS
10
  * @copyright Copyright (c) 2012 Smsapi (http://smsapi.pl/)
11
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
12
  * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
13
+ * ...
14
+ */
15
+ class Smsapi_Sms_Model_Config
16
+ {
17
 
 
 
 
18
  const LOW_POINTS_WARNING_MESSAGE = 'Warning: Low points level at your SMSAPI account. Buy credit.';
19
+
20
 
21
  /**
22
  * getting API login from SMSAPI config
23
  * @return string
24
+ */
25
+ public function getApiLogin()
26
+ {
27
  return Mage::getStoreConfig('sms/main_conf/apilogin');
28
 
29
 
33
  /**
34
  * getting API password from SMSAPI config
35
  * @return string
36
+ */
37
+ public function getApiPassword()
38
+ {
39
  $encrypted_pass = Mage::getStoreConfig('sms/main_conf/apipassword');
40
  return Mage::helper('core')->decrypt($encrypted_pass);
 
41
  }
42
+
43
 
44
  /**
45
  * getting storename from SMSAPI config
46
  * @return string
47
+ */
48
+ public function getApiStoreName()
49
+ {
50
  return Mage::getStoreConfig('sms/main_conf/storename');
51
  }
52
 
53
+
54
+ /**
55
  * Checks if allowed only single message
56
  * @return int
57
+ */
58
+ public function isSingle()
59
+ {
60
  $confRule = Mage::getStoreConfig('sms/main_conf/allow_long_sms');
61
+
62
+ return ($confRule == 1) ? 'single' : 1;
63
+
64
  }
65
+
66
  /**
67
  * Checks if message is Eco
68
  * @return int
69
  */
70
+
71
+ public function isEco()
72
+ {
73
+
74
+ return 0; //ECO messages turned off
75
+
76
  //$confRule = Mage::getStoreConfig('sms/main_conf/sender');
77
  //return ($confRule == 'eco_msg') ? 1:0;
78
+
79
  }
80
+
81
+ /**
82
  * getting message sender
83
  * @return string
84
+ */
85
+ public function getSender()
86
+ {
87
+
88
  return Mage::getStoreConfig('sms/main_conf/sender');
89
+
90
  }
91
+
92
+ /**
93
  * getting SMS templates from SMSAPI config
94
  * @return string
95
+ */
96
+ public function getMessageTemplate($template)
97
+ {
98
+
99
+ $templateContent = Mage::getStoreConfig('sms/templates/status_' . $template);
100
+
101
+ if (Mage::getStoreConfig('sms/templates/status_' . $template . '_active') && !empty($templateContent))
102
  return $templateContent;
103
+
104
  }
105
+
106
+ public function pointsAllertLimit()
107
+ {
108
+ return floatval(str_replace(',', '.', Mage::getStoreConfig('sms/main_conf/points_alert_limit')));
109
  }
110
+
111
+ /**
112
  * checks if module is in test/devel mode
113
  * @return string
114
+ */
115
+ public function testMode()
116
+ {
117
+
118
  $testmode = Mage::getStoreConfig('sms/admin_mode/test_mode');
119
+
120
+ return ($testmode == 1) ? 'test' : 0;
121
+
122
  }
123
+
124
+ /**
125
  * checks if SMSAPI module is enabled
126
  * @return string
127
+ */
128
+ public function isApiEnabled()
129
+ {
130
+
131
  return Mage::getStoreConfig('sms/main_conf/active');
132
+
133
+ }
134
+
135
+ /**
136
+ * getting SMSAPI version pl or com
137
+ * @return mixed
138
+ */
139
+
140
+ public function getSmsapiVersion()
141
+ {
142
+
143
+ return Mage::getStoreConfig('sms/main_conf/plorcom');
144
+
145
  }
146
+
 
147
  }
app/code/community/Smsapi/Sms/Model/Observer.php CHANGED
@@ -9,6 +9,12 @@
9
  * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
10
  * ...
11
  */
 
 
 
 
 
 
12
  class Smsapi_Sms_Model_Observer
13
  {
14
 
@@ -20,7 +26,9 @@ class Smsapi_Sms_Model_Observer
20
 
21
  public function handleStatus($observer)
22
  {
23
-
 
 
24
  $config = Mage::getModel('sms/config');
25
  if ($config->isApiEnabled() == 0)
26
  return; //do nothing if api is disabled
@@ -69,27 +77,22 @@ class Smsapi_Sms_Model_Observer
69
  $message = strtr($message, $messageOrderData);
70
 
71
 
72
- $api = Mage::getModel('sms/apiClient');
73
- $api->connect();
74
 
75
  //prepare sms content
76
- $msg['recipient'] = $address->getData('telephone'); //or getBillingAddress
77
  $msg['message'] = $message;
78
- $msg['eco'] = $config->isEco(); //eco version - without sender
79
- $msg['test'] = $config->testMode();
80
- $msg['single_message'] = $config->isSingle(); //allow_long_sms
81
- $msg['sender'] = $config->getSender();//sender
82
 
83
-
84
- //sending sms and getting API response
 
85
 
86
  try {
87
-
88
- $response = $api->msgContent($msg)->send();
89
- $newComment = Mage::helper('sms')->__('SMS notification sent (SMS id:') . $response->response[0]->id . ') ';
90
  $order->addStatusToHistory($newStatus, $newComment, true);
91
-
92
-
93
  } catch (Exception $e) {
94
  $newComment = Mage::helper('sms')->__('SMS notification sending error: "') . $e->getMessage() . '"';
95
  $order->addStatusToHistory($newStatus, $newComment, false);
@@ -113,6 +116,9 @@ class Smsapi_Sms_Model_Observer
113
 
114
  function checkPointsLimit()
115
  {
 
 
 
116
 
117
  $config = Mage::getModel('sms/config');
118
  if ($config->isApiEnabled() == 0) return; //do nothing if api is disabled
@@ -125,13 +131,13 @@ class Smsapi_Sms_Model_Observer
125
 
126
  try {
127
 
128
- $api = Mage::getModel('sms/apiClient');
129
- $api->connect();
130
- $res = $api->getPoints();
131
 
132
- if ($res->points < $limit) { //alert admin if API account balance is lower than $limit
133
 
134
- Mage::getSingleton('core/session')->addError(Mage::helper('sms')->__($config::LOW_POINTS_WARNING_MESSAGE));
135
 
136
  }
137
  } catch (Exception $e) {
@@ -146,23 +152,23 @@ class Smsapi_Sms_Model_Observer
146
  *
147
  * @return none
148
  */
149
- public function checkAuthorizationData()
150
  {
 
 
 
151
  $config = Mage::getModel('sms/config');
152
  if ($config->isApiEnabled() == 0) return; //do nothing if api is disabled
153
 
154
  if ($config->getApiLogin() && $config->getApiPassword()) {
155
 
156
  try {
157
- $api = Mage::getModel('sms/apiClient');
158
- $api->connect()->getPoints();
 
159
  } catch (Exception $e) {
160
- Mage::getSingleton('core/session')->addError(Mage::helper('sms')->__('SMSAPI: Wrong Password and/or Username'));
161
  }
162
  }
163
-
164
-
165
  }
166
-
167
-
168
  }
9
  * @author Marek Jasiukiewicz <dev@jasiukiewicz.pl>
10
  * ...
11
  */
12
+
13
+ require_once dirname(__DIR__) . '/smsapi-classes/UserFactory.php';
14
+ require_once dirname(__DIR__) . '/smsapi-classes/User.php';
15
+ require_once dirname(__DIR__) . '/smsapi-classes/SmsFactory.php';
16
+ require_once dirname(__DIR__) . '/smsapi-classes/Sms.php';
17
+
18
  class Smsapi_Sms_Model_Observer
19
  {
20
 
26
 
27
  public function handleStatus($observer)
28
  {
29
+ /**
30
+ * @var Smsapi_Sms_Model_Config $config
31
+ */
32
  $config = Mage::getModel('sms/config');
33
  if ($config->isApiEnabled() == 0)
34
  return; //do nothing if api is disabled
77
  $message = strtr($message, $messageOrderData);
78
 
79
 
80
+ $smsFactory = new SmsFactory($config->getApiLogin(), $config->getApiPassword(), $config->getSmsapiVersion());
81
+ $sms = new Sms($smsFactory->getActionFactory());
82
 
83
  //prepare sms content
84
+ $msg['recipient'] = $address->getData('telephone');
85
  $msg['message'] = $message;
86
+ $msg['sender'] = $config->getSender();
 
 
 
87
 
88
+ $options = array(
89
+ $config->isSingle()
90
+ );
91
 
92
  try {
93
+ $response = $sms->send($msg['recipient'], $msg['sender'], $msg['message'], $options);
94
+ $newComment = Mage::helper('sms')->__('SMS notification sent (SMS id:') . $response->getList()->response[0]->id . ') ';
 
95
  $order->addStatusToHistory($newStatus, $newComment, true);
 
 
96
  } catch (Exception $e) {
97
  $newComment = Mage::helper('sms')->__('SMS notification sending error: "') . $e->getMessage() . '"';
98
  $order->addStatusToHistory($newStatus, $newComment, false);
116
 
117
  function checkPointsLimit()
118
  {
119
+ /**
120
+ * @var Smsapi_Sms_Model_Config $config
121
+ */
122
 
123
  $config = Mage::getModel('sms/config');
124
  if ($config->isApiEnabled() == 0) return; //do nothing if api is disabled
131
 
132
  try {
133
 
134
+ $userFactory = new UserFactory($config->getApiLogin(), $config->getApiPassword(), $config->getSmsapiVersion());
135
+ $user = new User($userFactory->getActionFactory());
136
+ $points = $user->getPoints();
137
 
138
+ if ($points < $limit) { //alert admin if API account balance is lower than $limit
139
 
140
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('sms')->__($config::LOW_POINTS_WARNING_MESSAGE));
141
 
142
  }
143
  } catch (Exception $e) {
152
  *
153
  * @return none
154
  */
155
+ public function checkAuthorizationData()
156
  {
157
+ /**
158
+ * @var Smsapi_Sms_Model_Config $config
159
+ */
160
  $config = Mage::getModel('sms/config');
161
  if ($config->isApiEnabled() == 0) return; //do nothing if api is disabled
162
 
163
  if ($config->getApiLogin() && $config->getApiPassword()) {
164
 
165
  try {
166
+ $userFactory = new UserFactory($config->getApiLogin(), $config->getApiPassword(), $config->getSmsapiVersion());
167
+ $user = new User($userFactory->getActionFactory());
168
+ $user->getPoints();
169
  } catch (Exception $e) {
170
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('sms')->__('SMSAPI: Wrong Password and/or Username'));
171
  }
172
  }
 
 
173
  }
 
 
174
  }
app/code/community/Smsapi/Sms/controllers/IndexController.php CHANGED
@@ -1,10 +1,20 @@
1
  <?php
2
 
 
 
 
 
 
 
 
3
  class Smsapi_Sms_IndexController extends Mage_Core_Controller_Front_Action
4
  {
5
  public function sendsmsAction()
6
  {
7
  $params = $this->_request->getParams();
 
 
 
8
  $config = Mage::getModel('sms/config');
9
  $observer = new Smsapi_Sms_Model_Observer();
10
 
@@ -19,44 +29,39 @@ class Smsapi_Sms_IndexController extends Mage_Core_Controller_Front_Action
19
  }
20
 
21
  try {
22
- $api = Mage::getModel('sms/apiClient');
23
- $api->connect();
24
-
25
 
26
  //prepare sms content
27
  $msg['recipient'] = $params['rec']; //or getBillingAddress
28
  $msg['message'] = $params['msg'];
29
- $msg['eco'] = $config->isEco(); //eco version - without sender
30
- $msg['test'] = $config->testMode();
31
- $msg['single_message'] = $config->isSingle(); //allow_long_sms
32
  $msg['sender'] = $config->getSender();//sender
33
 
 
 
 
 
34
  if (strpos($msg['message'], '{TRACKINGNUMBER}') !== false && !isset($msgWithTrackingNumber)) {
35
  $res['message'] = Mage::helper('sms')->__('You have used {TRACKINGNUMBER} variable but tracking number is not defined. Please delete {TRACKINGNUMBER} variable from the message.');
36
  $res['class'] = 'error-msg';
37
  $this->_response->setBody(json_encode($res));
38
  } else {
39
- $msg['message'] = strtr($msg['message'], $msgWithTrackingNumber);
40
  try {
41
- $api->msgContent($msg)->send();
42
  $res['class'] = 'success-msg';
43
  $res['message'] = Mage::helper('sms')->__('SMS notification sent');
44
  $this->_response->setBody(json_encode($res));
45
- } catch (Exception $e) {
46
  $res['message'] = Mage::helper('sms')->__('SMS notification error');
 
47
  $res['class'] = 'error-msg';
48
  $this->_response->setBody(json_encode($res));
49
  }
50
  }
51
- //sending sms and getting API response
52
-
53
- $observer->checkPointsLimit(); //check
54
-
55
 
56
  } catch (Exception $e) {
57
  Mage::log('exception' . $e->getMessage());
58
  }
59
-
60
-
61
  }
62
  }
1
  <?php
2
 
3
+ use \SMSApi\Exception\SmsapiException;
4
+
5
+ require_once dirname(__DIR__) . '/smsapi-classes/Sms.php';
6
+ require_once dirname(__DIR__) . '/smsapi-classes/Sender.php';
7
+ require_once dirname(__DIR__) . '/smsapi-classes/SenderFactory.php';
8
+ require_once dirname(__DIR__) . '/smsapi-classes/SmsFactory.php';
9
+
10
  class Smsapi_Sms_IndexController extends Mage_Core_Controller_Front_Action
11
  {
12
  public function sendsmsAction()
13
  {
14
  $params = $this->_request->getParams();
15
+ /**
16
+ * @var Smsapi_Sms_Model_Config $config
17
+ */
18
  $config = Mage::getModel('sms/config');
19
  $observer = new Smsapi_Sms_Model_Observer();
20
 
29
  }
30
 
31
  try {
32
+ $smsFactory = new SmsFactory($config->getApiLogin(), $config->getApiPassword(), $config->getSmsapiVersion());
33
+ $sms = new Sms($smsFactory->getActionFactory());
 
34
 
35
  //prepare sms content
36
  $msg['recipient'] = $params['rec']; //or getBillingAddress
37
  $msg['message'] = $params['msg'];
 
 
 
38
  $msg['sender'] = $config->getSender();//sender
39
 
40
+ $options = array(
41
+ $config->isSingle()
42
+ );
43
+
44
  if (strpos($msg['message'], '{TRACKINGNUMBER}') !== false && !isset($msgWithTrackingNumber)) {
45
  $res['message'] = Mage::helper('sms')->__('You have used {TRACKINGNUMBER} variable but tracking number is not defined. Please delete {TRACKINGNUMBER} variable from the message.');
46
  $res['class'] = 'error-msg';
47
  $this->_response->setBody(json_encode($res));
48
  } else {
49
+ $msg['message'] = isset($msgWithTrackingNumber) ? strtr($msg['message'], $msgWithTrackingNumber) : $msg['message'];
50
  try {
51
+ $sms->send($msg['recipient'], $msg['sender'], $msg['message'], $options);
52
  $res['class'] = 'success-msg';
53
  $res['message'] = Mage::helper('sms')->__('SMS notification sent');
54
  $this->_response->setBody(json_encode($res));
55
+ } catch (SmsapiException $e) {
56
  $res['message'] = Mage::helper('sms')->__('SMS notification error');
57
+ $res['message'] = $e->getMessage();
58
  $res['class'] = 'error-msg';
59
  $this->_response->setBody(json_encode($res));
60
  }
61
  }
 
 
 
 
62
 
63
  } catch (Exception $e) {
64
  Mage::log('exception' . $e->getMessage());
65
  }
 
 
66
  }
67
  }
app/code/community/Smsapi/Sms/etc/config.xml CHANGED
@@ -128,7 +128,7 @@
128
  <config>
129
  <children>
130
  <sms translate="title">
131
- <title>SMS API</title>
132
  <sort_order>100</sort_order>
133
  </sms>
134
  </children>
128
  <config>
129
  <children>
130
  <sms translate="title">
131
+ <title>SMSAPI</title>
132
  <sort_order>100</sort_order>
133
  </sms>
134
  </children>
app/code/community/Smsapi/Sms/etc/system.xml CHANGED
@@ -63,11 +63,21 @@
63
  <show_in_store>1</show_in_store>
64
  <expanded>1</expanded>
65
  <fields>
 
 
 
 
 
 
 
 
 
 
66
  <active translate="label">
67
  <label>Enabled</label>
68
  <frontend_type>select</frontend_type>
69
  <source_model>adminhtml/system_config_source_yesno</source_model>
70
- <sort_order>1</sort_order>
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
73
  <show_in_store>1</show_in_store>
@@ -76,17 +86,17 @@
76
  <apilogin translate="label">
77
  <label>API Login</label>
78
  <frontend_type>text</frontend_type>
79
- <sort_order>2</sort_order>
80
  <show_in_default>1</show_in_default>
81
  <show_in_website>1</show_in_website>
82
  <show_in_store>1</show_in_store>
83
  </apilogin>
84
 
85
  <apipassword translate="label">
86
- <label>API Password</label>
87
- <frontend_type>obscure</frontend_type>
88
  <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
89
- <sort_order>3</sort_order>
90
  <show_in_default>1</show_in_default>
91
  <show_in_website>1</show_in_website>
92
  <show_in_store>1</show_in_store>
@@ -95,7 +105,7 @@
95
  <storename translate="label">
96
  <label>Store name</label>
97
  <frontend_type>text</frontend_type>
98
- <sort_order>4</sort_order>
99
  <show_in_default>1</show_in_default>
100
  <show_in_website>1</show_in_website>
101
  <show_in_store>1</show_in_store>
@@ -104,7 +114,7 @@
104
  <sender translate="label comment">
105
  <label>SMS Sender</label>
106
  <frontend_type>select</frontend_type>
107
- <sort_order>5</sort_order>
108
  <source_model>sms/adminhtml_attributes</source_model>
109
  <show_in_default>1</show_in_default>
110
  <show_in_website>1</show_in_website>
@@ -126,6 +136,7 @@
126
  <label>Notify if my SMSAPI account points is below:</label>
127
  <comment>0 - turn off/no alert</comment>
128
  <frontend_type>text</frontend_type>
 
129
  <sort_order>7</sort_order>
130
  <show_in_default>1</show_in_default>
131
  <show_in_website>1</show_in_website>
@@ -281,27 +292,6 @@
281
  </fields>
282
  </templates>
283
 
284
- <admin_mode translate="label" module="sms">
285
- <label>Test configuration</label>
286
- <frontend_type>text</frontend_type>
287
- <sort_order>101</sort_order>
288
- <show_in_default>1</show_in_default>
289
- <show_in_website>1</show_in_website>
290
- <show_in_store>1</show_in_store>
291
- <expanded>0</expanded>
292
- <fields>
293
- <test_mode translate="label comment">
294
- <label>Turn on "Test mode"</label>
295
- <frontend_type>select</frontend_type>
296
- <source_model>adminhtml/system_config_source_yesno</source_model>
297
- <comment>In test mode. API working like in normal mode (sending errors, checking sent data etc.) whithout SMS sending.</comment>
298
- <sort_order>1</sort_order>
299
- <show_in_default>1</show_in_default>
300
- <show_in_website>1</show_in_website>
301
- <show_in_store>1</show_in_store>
302
- </test_mode>
303
- </fields>
304
- </admin_mode>
305
  <registration translate="label" module="sms">
306
  <label>Registration</label>
307
  <frontend_type>text</frontend_type>
63
  <show_in_store>1</show_in_store>
64
  <expanded>1</expanded>
65
  <fields>
66
+ <plorcom translate="label comment">
67
+ <label>SMSAPI Version</label>
68
+ <frontend_type>select</frontend_type>
69
+ <sort_order>1</sort_order>
70
+ <source_model>sms/adminhtml_version</source_model>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>1</show_in_website>
73
+ <show_in_store>1</show_in_store>
74
+ </plorcom>
75
+
76
  <active translate="label">
77
  <label>Enabled</label>
78
  <frontend_type>select</frontend_type>
79
  <source_model>adminhtml/system_config_source_yesno</source_model>
80
+ <sort_order>2</sort_order>
81
  <show_in_default>1</show_in_default>
82
  <show_in_website>1</show_in_website>
83
  <show_in_store>1</show_in_store>
86
  <apilogin translate="label">
87
  <label>API Login</label>
88
  <frontend_type>text</frontend_type>
89
+ <sort_order>3</sort_order>
90
  <show_in_default>1</show_in_default>
91
  <show_in_website>1</show_in_website>
92
  <show_in_store>1</show_in_store>
93
  </apilogin>
94
 
95
  <apipassword translate="label">
96
+ <label>API Password in MD5</label>
97
+ <frontend_type>text</frontend_type>
98
  <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
99
+ <sort_order>4</sort_order>
100
  <show_in_default>1</show_in_default>
101
  <show_in_website>1</show_in_website>
102
  <show_in_store>1</show_in_store>
105
  <storename translate="label">
106
  <label>Store name</label>
107
  <frontend_type>text</frontend_type>
108
+ <sort_order>5</sort_order>
109
  <show_in_default>1</show_in_default>
110
  <show_in_website>1</show_in_website>
111
  <show_in_store>1</show_in_store>
114
  <sender translate="label comment">
115
  <label>SMS Sender</label>
116
  <frontend_type>select</frontend_type>
117
+ <sort_order>6</sort_order>
118
  <source_model>sms/adminhtml_attributes</source_model>
119
  <show_in_default>1</show_in_default>
120
  <show_in_website>1</show_in_website>
136
  <label>Notify if my SMSAPI account points is below:</label>
137
  <comment>0 - turn off/no alert</comment>
138
  <frontend_type>text</frontend_type>
139
+ <source_model>sms/adminhtml_balancelow</source_model>
140
  <sort_order>7</sort_order>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
292
  </fields>
293
  </templates>
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  <registration translate="label" module="sms">
296
  <label>Registration</label>
297
  <frontend_type>text</frontend_type>
app/code/community/Smsapi/Sms/smsapi-classes/AbstractsSmsapi.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ @include('../vendor/smsapi-client/vendor/autoload.php');
4
+ use \SMSApi\Proxy\Http\Native;
5
+
6
+ abstract class AbstractsSmsapi
7
+ {
8
+ private $username;
9
+ private $password;
10
+ private $url;
11
+
12
+ /**
13
+ * @param $username
14
+ * @param $password
15
+ * @param $url
16
+ */
17
+
18
+ protected function __construct($username, $password, $url)
19
+ {
20
+ $this->username = $username;
21
+ $this->password = $password;
22
+ $this->url = $url;
23
+ }
24
+
25
+ /**
26
+ * @return \SMSApi\Client
27
+ * @throws \SMSApi\Exception\ClientException
28
+ */
29
+
30
+ public function getSmsapiClient()
31
+ {
32
+
33
+ $client = new \SMSApi\Client($this->username);
34
+ $client->setPasswordHash($this->password);
35
+
36
+ return $client;
37
+ }
38
+
39
+ /**
40
+ * @return Native
41
+ */
42
+
43
+ public function getSmsapiProxy()
44
+ {
45
+ return new Native($this->url);
46
+ }
47
+
48
+ }
app/code/community/Smsapi/Sms/smsapi-classes/Sender.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use SMSApi\Api\SenderFactory;
4
+ require_once dirname(__DIR__) . '/smsapi-classes/AbstractsSmsapi.php';
5
+
6
+ class Sender
7
+ {
8
+ private $sender;
9
+
10
+ private $settings;
11
+
12
+ private $_default;
13
+
14
+ private $senderFactory;
15
+
16
+ public function __construct(SenderFactory $senderFactory, $sender = NULL, $settings = NULL, $_default)
17
+ {
18
+ $this->senderFactory = $senderFactory;
19
+ $this->sender = $sender;
20
+ $this->settings = $settings;
21
+ $this->_default = $_default;
22
+ }
23
+
24
+ public function getSenders()
25
+ {
26
+ $smsApi = $this->senderFactory;
27
+
28
+ $actionList = $smsApi->actionList();
29
+ $response = $actionList->execute();
30
+
31
+ if (!empty($this->settings['sender'])) {
32
+ $names[$this->settings['sender']] = $this->settings['sender'];
33
+ $names['DEFAULT'] = $this->_default;
34
+ } else {
35
+ if ($this->sender != null) {
36
+ $names[$this->sender] = $this->sender;
37
+ $names['DEFAULT'] = $this->_default;
38
+ } else {
39
+ $names['DEFAULT'] = $this->_default;
40
+ }
41
+ }
42
+
43
+ if (!empty($this->settings)) {
44
+ foreach ($response->getList() as $status) {
45
+ if ($status->getStatus() == 'ACTIVE' && $status->getName() != $this->sender && $status->getName() != $this->settings['sender']) {
46
+ $names[$status->getName()] = $status->getName();
47
+ }
48
+ }
49
+ } else {
50
+ foreach ($response->getList() as $status) {
51
+ if ($status->getStatus() == 'ACTIVE' && $status->getName() != $this->sender) {
52
+ $names[$status->getName()] = $status->getName();
53
+ }
54
+ }
55
+ }
56
+ return $names;
57
+ }
58
+ }
app/code/community/Smsapi/Sms/smsapi-classes/SenderFactory.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__DIR__) . '/smsapi-classes/AbstractsSmsapi.php';
4
+ require_once dirname(__DIR__) . '/vendor/smsapi-client/vendor/autoload.php';
5
+
6
+ class SenderFactory extends AbstractsSmsapi
7
+ {
8
+ public function __construct($username, $password, $url)
9
+ {
10
+ parent::__construct($username, $password, $url);
11
+ }
12
+
13
+ public function getActionFactory()
14
+ {
15
+ $smsApi = new \SMSApi\Api\SenderFactory();
16
+ $smsApi->setProxy($this->getSmsapiProxy());
17
+ $smsApi->setClient($this->getSmsapiClient());
18
+
19
+ return $smsApi;
20
+ }
21
+ }
app/code/community/Smsapi/Sms/smsapi-classes/Sms.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use SMSApi\Api\SmsFactory;
4
+
5
+ require_once dirname(__DIR__) . '/vendor/smsapi-client/vendor/autoload.php';
6
+ require_once dirname(__DIR__) . '/smsapi-classes/AbstractsSmsapi.php';
7
+
8
+ class Sms extends AbstractsSmsapi
9
+ {
10
+ private $actionSend;
11
+
12
+ /**
13
+ * @param SmsFactory $smsFactory
14
+ */
15
+
16
+ public function __construct(SmsFactory $smsFactory)
17
+ {
18
+ $this->actionSend = $smsFactory->actionSend();
19
+ }
20
+
21
+ /**
22
+ * @param $phone
23
+ * @param $sender
24
+ * @param $message
25
+ * @param array $options
26
+ * @return \SMSApi\Api\Response\StatusResponse
27
+ */
28
+
29
+ public function send($phone, $sender, $message, $options = array())
30
+ {
31
+ $this->actionSend->setTo($phone);
32
+ $this->actionSend->setText($message);
33
+
34
+ if ($sender !== 'DEFAULT') {
35
+ $this->actionSend->setSender(urlencode($sender));
36
+ }
37
+ if (in_array('single', $options)) {
38
+ $this->actionSend->setSingle(true);
39
+ }
40
+
41
+ return $this->actionSend->execute();
42
+ }
43
+ }
app/code/community/Smsapi/Sms/smsapi-classes/SmsFactory.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use SMSApi\Exception\SmsapiException;
4
+
5
+ require_once dirname(__DIR__) . '/vendor/smsapi-client/vendor/autoload.php';
6
+
7
+ class SmsFactory extends AbstractsSmsapi
8
+ {
9
+ public function __construct($username, $password, $url)
10
+ {
11
+ parent::__construct($username, $password, $url);
12
+ }
13
+
14
+ public function getActionFactory()
15
+ {
16
+ $smsapi = new \SMSApi\Api\SmsFactory();
17
+ $smsapi->setProxy($this->getSmsapiProxy());
18
+ $smsapi->setClient($this->getSmsapiClient());
19
+
20
+ return $smsapi;
21
+ }
22
+ }
app/code/community/Smsapi/Sms/smsapi-classes/User.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use SMSApi\Api\UserFactory;
4
+
5
+ class User
6
+ {
7
+
8
+ private $userFactory;
9
+
10
+ public function __construct(UserFactory $userFactory)
11
+ {
12
+ $this->userFactory = $userFactory;
13
+ }
14
+
15
+ public function getPoints()
16
+ {
17
+ $actionPoints = $this->userFactory->actionGetPoints();
18
+
19
+ return $actionPoints->execute()->getPoints();
20
+ }
21
+ }
app/code/community/Smsapi/Sms/smsapi-classes/UserFactory.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname(__DIR__) . '/vendor/smsapi-client/vendor/autoload.php';
4
+ require_once dirname(__DIR__) . '/smsapi-classes/AbstractsSmsapi.php';
5
+
6
+ class UserFactory extends AbstractsSmsapi
7
+ {
8
+ public function __construct($username, $password, $url)
9
+ {
10
+ parent::__construct($username, $password, $url);
11
+ }
12
+
13
+ public function getActionFactory()
14
+ {
15
+ $smsApi = new \SMSApi\Api\UserFactory();
16
+ $smsApi->setProxy($this->getSmsapiProxy());
17
+ $smsApi->setClient($this->getSmsapiClient());
18
+
19
+ return $smsApi;
20
+ }
21
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/AbstractAction.php ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action;
4
+
5
+ use Exception;
6
+ use SMSApi\Api\Response\ErrorResponse;
7
+ use SMSApi\Client;
8
+ use SMSApi\Exception\ActionException;
9
+ use SMSApi\Exception\ClientException;
10
+ use SMSApi\Exception\ContactsException;
11
+ use SMSApi\Exception\HostException;
12
+ use SMSApi\Exception\SmsapiException;
13
+ use SMSApi\Proxy\Proxy;
14
+
15
+ /**
16
+ * Class AbstractAction
17
+ * @package SMSApi\Api\Action
18
+ */
19
+ abstract class AbstractAction
20
+ {
21
+ const METHOD_GET = 'GET';
22
+ const METHOD_POST = 'POST';
23
+ const METHOD_DELETE = 'DELETE';
24
+ const METHOD_PUT = 'PUT';
25
+ const METHOD_HEAD = 'HEAD';
26
+
27
+ /**
28
+ * @var Client
29
+ */
30
+ protected $client;
31
+
32
+ /** @var Proxy */
33
+ protected $proxy;
34
+
35
+ /**
36
+ * @var array
37
+ */
38
+ protected $params = array();
39
+ /**
40
+ * @var \ArrayObject
41
+ */
42
+ protected $to;
43
+ /**
44
+ * @var \ArrayObject
45
+ */
46
+ protected $idx;
47
+ /**
48
+ * @var
49
+ */
50
+ protected $group;
51
+ /**
52
+ * @var
53
+ */
54
+ protected $date;
55
+ /**
56
+ * @var
57
+ */
58
+ protected $encoding;
59
+
60
+ protected $isContacts = false;
61
+
62
+ /**
63
+ *
64
+ */
65
+ function __construct() {
66
+ $this->to = new \ArrayObject();
67
+ $this->idx = new \ArrayObject();
68
+ }
69
+
70
+ /**
71
+ * @return mixed
72
+ */
73
+ abstract public function uri();
74
+
75
+ /**
76
+ * @param $data
77
+ * @return mixed
78
+ */
79
+ abstract protected function response( $data );
80
+
81
+ /**
82
+ * @return null
83
+ */
84
+ public function file() {
85
+ return null;
86
+ }
87
+
88
+ /**
89
+ * @param Client $client
90
+ * @return $this
91
+ */
92
+ public function client( Client $client ) {
93
+ $this->client = $client;
94
+
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * @param Proxy $proxy
100
+ * @return $this
101
+ */
102
+ public function proxy( Proxy $proxy ) {
103
+ $this->proxy = $proxy;
104
+
105
+ return $this;
106
+ }
107
+
108
+ /**
109
+ * @param $val
110
+ * @return $this
111
+ */
112
+ public function setTest( $val ) {
113
+ if ( $val == true ) {
114
+ $this->params[ 'test' ] = 1;
115
+ } else if ( $val == false ) {
116
+ unset( $this->params[ 'test' ] );
117
+ }
118
+
119
+ return $this;
120
+ }
121
+
122
+ public function isContacts()
123
+ {
124
+ return $this->isContacts;
125
+ }
126
+
127
+ /**
128
+ * @param $val
129
+ * @return $this
130
+ */
131
+ protected function setJson( $val ) {
132
+ if ( $val == true ) {
133
+ $this->params[ 'format' ] = 'json';
134
+ } else if ( $val == false ) {
135
+ unset( $this->params[ 'format' ] );
136
+ }
137
+
138
+ return $this;
139
+ }
140
+
141
+ protected function paramsOther($skip = '')
142
+ {
143
+ $query = '';
144
+ foreach ($this->params as $key => $val) {
145
+ if ($key != $skip && $val !== null) {
146
+ if (is_array($val)) {
147
+ foreach ($val as $v) {
148
+ $query .= '&' . $key . '[]=' . $v;
149
+ }
150
+ } else {
151
+ $query .= '&' . $key . '=' . $val;
152
+ }
153
+ }
154
+ }
155
+
156
+ return $query;
157
+ }
158
+
159
+ /**
160
+ * @return string
161
+ * @throws ActionException
162
+ */
163
+ protected function renderTo() {
164
+
165
+ $sizeTo = $this->to->count();
166
+ $sizeIdx = $this->idx->count();
167
+
168
+ if ( $sizeIdx > 0 ) {
169
+ if ( ($sizeTo != $sizeIdx ) ) {
170
+ throw new ActionException( "size idx is not equals to" );
171
+ } else {
172
+ return $this->renderList( $this->to, ',' ) . "&idx=" . $this->renderList( $this->idx, '|' );
173
+ }
174
+ }
175
+
176
+ return $this->renderList( $this->to, ',' );
177
+ }
178
+
179
+ /**
180
+ * @param \ArrayObject $values
181
+ * @param $delimiter
182
+ * @return string
183
+ */
184
+ private function renderList( \ArrayObject $values, $delimiter ) {
185
+
186
+ $query = "";
187
+ $loop = 1;
188
+ $size = $values->count();
189
+
190
+ foreach ( $values as $val ) {
191
+ $query .= $val;
192
+ if ( $loop < $size ) {
193
+ $query .= $delimiter;
194
+ }
195
+
196
+ $loop++;
197
+ }
198
+
199
+ return $query;
200
+ }
201
+
202
+ /**
203
+ * @return string
204
+ * @throws \SMSApi\Exception\ActionException
205
+ */
206
+ protected function paramsBasicToQuery() {
207
+
208
+ $query = "";
209
+
210
+ $query .= ($this->group != null) ? "&group=" . $this->group : "&to=" . $this->renderTo();
211
+
212
+ $query .= ($this->date != null) ? "&date=" . $this->date : "";
213
+
214
+ $query .= ( $this->encoding != null ) ? "&encoding=" . $this->encoding : "";
215
+
216
+ return $query;
217
+ }
218
+
219
+ /**
220
+ * @return string
221
+ */
222
+ protected function paramsLoginToQuery() {
223
+ return "username=" . $this->client->getUsername() . "&password=" . $this->client->getPassword();
224
+ }
225
+
226
+ /**
227
+ * @return mixed
228
+ * @throws \SMSApi\Exception\ClientException
229
+ * @throws \SMSApi\Exception\ActionException
230
+ * @throws \SMSApi\Exception\HostException
231
+ */
232
+ public function execute()
233
+ {
234
+ try
235
+ {
236
+ $this->setJson( true );
237
+
238
+ $data = $this->proxy->execute($this);
239
+
240
+ $this->handleError($data, $this->isContacts);
241
+
242
+ if ($this->getMethod() === self::METHOD_HEAD and $data['size']) {
243
+ return $this->response(json_encode(array('size' => $data['size'])));
244
+ } else {
245
+ return $this->response($data['output']);
246
+ }
247
+ }
248
+ catch ( Exception $ex )
249
+ {
250
+ throw new ActionException($ex->getMessage(), $ex->getCode(), $ex);
251
+ }
252
+ }
253
+
254
+ public function getMethod()
255
+ {
256
+ return self::METHOD_POST;
257
+ }
258
+
259
+ /**
260
+ * @param array $data
261
+ * @param bool $isContacts
262
+ * @throws ActionException
263
+ * @throws ClientException
264
+ * @throws ContactsException
265
+ * @throws HostException
266
+ */
267
+ protected function handleError(array $data, $isContacts)
268
+ {
269
+ if ($isContacts) {
270
+ if ($data['code'] < 200 or $data['code'] > 299) {
271
+ throw new ContactsException($data);
272
+ }
273
+ } else {
274
+ $error = new ErrorResponse($data['output']);
275
+
276
+ if ($error->isError()) {
277
+ if (SmsapiException::isHostError($error->code)) {
278
+ throw new HostException($error->message, $error->code);
279
+ } elseif (SmsapiException::isClientError($error->code) ) {
280
+ throw new ClientException($error->message, $error->code);
281
+ } else {
282
+ throw new ActionException($error->message, $error->code);
283
+ }
284
+ }
285
+ }
286
+ }
287
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactAdd.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use DateTime;
6
+ use SMSApi\Api\Response\Contacts\ContactResponse;
7
+
8
+ /**
9
+ * @method ContactResponse execute()
10
+ */
11
+ abstract class ContactAdd extends ContactsAction
12
+ {
13
+ public function getMethod()
14
+ {
15
+ return self::METHOD_POST;
16
+ }
17
+
18
+ protected function getResource()
19
+ {
20
+ return '/contacts';
21
+ }
22
+
23
+ protected function response($data)
24
+ {
25
+ return ContactResponse::fromJsonString($data);
26
+ }
27
+
28
+ public function setFirstName($firstName)
29
+ {
30
+ $this->setParamValue(ContactResponse::FIELD_FIRST_NAME, $firstName);
31
+
32
+ return $this;
33
+ }
34
+
35
+ public function setLastName($lastName)
36
+ {
37
+ $this->setParamValue(ContactResponse::FIELD_LAST_NAME, $lastName);
38
+
39
+ return $this;
40
+ }
41
+
42
+ public function setGenderAsMale()
43
+ {
44
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_MALE);
45
+
46
+ return $this;
47
+ }
48
+
49
+ public function setGenderAsFemale()
50
+ {
51
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_FEMALE);
52
+
53
+ return $this;
54
+ }
55
+
56
+ public function setGenderAsUndefined()
57
+ {
58
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_UNDEFINED);
59
+
60
+ return $this;
61
+ }
62
+
63
+ public function setBirthdayDate(DateTime $birthdayDate)
64
+ {
65
+ $this->params[ContactResponse::FIELD_BIRTHDAY_DATE] = $birthdayDate->format('Y-m-d');
66
+
67
+ return $this;
68
+ }
69
+
70
+ public function setDescription($description)
71
+ {
72
+ $this->setParamValue(ContactResponse::FIELD_DESCRIPTION, $description);
73
+
74
+ return $this;
75
+ }
76
+
77
+ public function setCity($city)
78
+ {
79
+ $this->setParamValue(ContactResponse::FIELD_CITY, $city);
80
+
81
+ return $this;
82
+ }
83
+
84
+ public function setSource($source)
85
+ {
86
+ $this->setParamValue(ContactResponse::FIELD_SOURCE, $source);
87
+
88
+ return $this;
89
+ }
90
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactAddByEmail.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\ContactResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ final class ContactAddByEmail extends ContactAdd
10
+ {
11
+ /**
12
+ * @param string $email
13
+ * @param Client $client
14
+ * @param Proxy $proxy
15
+ */
16
+ public function __construct($email, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->setParamValue(ContactResponse::FIELD_EMAIL, $email);
21
+ }
22
+
23
+ public function setPhoneNumber($phoneNumber)
24
+ {
25
+ $this->setParamValue(ContactResponse::FIELD_PHONE_NUMBER, $phoneNumber);
26
+
27
+ return $this;
28
+ }
29
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactAddByPhoneNumber.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\ContactResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ final class ContactAddByPhoneNumber extends ContactAdd
10
+ {
11
+ /**
12
+ * @param int $phoneNumber
13
+ * @param Client $client
14
+ * @param Proxy $proxy
15
+ */
16
+ public function __construct($phoneNumber, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->setParamValue(ContactResponse::FIELD_PHONE_NUMBER, $phoneNumber);
21
+ }
22
+
23
+ public function setEmail($email)
24
+ {
25
+ $this->setParamValue(ContactResponse::FIELD_EMAIL, $email);
26
+
27
+ return $this;
28
+ }
29
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactCount.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use DateTime;
6
+ use SMSApi\Api\Response\Contacts\ContactResponse;
7
+ use SMSApi\Api\Response\Contacts\SizeResponse;
8
+
9
+ /**
10
+ * @method SizeResponse execute()
11
+ */
12
+ class ContactCount extends ContactsAction
13
+ {
14
+ const PARAM_SEARCH = 'q';
15
+ const PARAM_GROUP_ID = 'group_id';
16
+
17
+ public function getMethod()
18
+ {
19
+ return self::METHOD_HEAD;
20
+ }
21
+
22
+ public function getResource()
23
+ {
24
+ return '/contacts';
25
+ }
26
+
27
+ protected function response($data)
28
+ {
29
+ return SizeResponse::fromJsonString($data);
30
+ }
31
+
32
+ public function setSearch($search)
33
+ {
34
+ $this->setParamValue(self::PARAM_SEARCH, $search);
35
+
36
+ return $this;
37
+ }
38
+
39
+ public function setPhoneNumber($phoneNumber)
40
+ {
41
+ $this->setParamValue(ContactResponse::FIELD_PHONE_NUMBER, $phoneNumber);
42
+
43
+ return $this;
44
+ }
45
+
46
+ public function setEmail($email)
47
+ {
48
+ $this->setParamValue(ContactResponse::FIELD_EMAIL, $email);
49
+
50
+ return $this;
51
+ }
52
+
53
+ public function setFirstName($firstName)
54
+ {
55
+ $this->setParamValue(ContactResponse::FIELD_FIRST_NAME, $firstName);
56
+
57
+ return $this;
58
+ }
59
+
60
+ public function setLastName($lastName)
61
+ {
62
+ $this->setParamValue(ContactResponse::FIELD_LAST_NAME, $lastName);
63
+
64
+ return $this;
65
+ }
66
+
67
+ public function setGenderAsMale()
68
+ {
69
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_MALE);
70
+
71
+ return $this;
72
+ }
73
+
74
+ public function setGenderAsFemale()
75
+ {
76
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_FEMALE);
77
+
78
+ return $this;
79
+ }
80
+
81
+ public function setGenderAsUndefined()
82
+ {
83
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_UNDEFINED);
84
+
85
+ return $this;
86
+ }
87
+
88
+ public function setBirthdayDate(DateTime $birthdayDate)
89
+ {
90
+ $this->setParamValue(ContactResponse::FIELD_BIRTHDAY_DATE, $birthdayDate->format('Y-m-d'));
91
+
92
+ return $this;
93
+ }
94
+
95
+ public function setIds(array $ids)
96
+ {
97
+ $this->setParamArray(ContactResponse::FIELD_ID, $ids);
98
+
99
+ return $this;
100
+ }
101
+
102
+ public function setGroupId($groupId)
103
+ {
104
+ $this->setParamValue(self::PARAM_GROUP_ID, $groupId);
105
+
106
+ return $this;
107
+ }
108
+
109
+ public function setGroupIds(array $groupIds)
110
+ {
111
+ $this->setParamArray(self::PARAM_GROUP_ID, $groupIds);
112
+
113
+ return $this;
114
+ }
115
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactDelete.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method DeleteResponse execute()
11
+ */
12
+ final class ContactDelete extends ContactsAction
13
+ {
14
+ private $contactId;
15
+
16
+ public function __construct($contactId, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->contactId = $contactId;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_DELETE;
26
+ }
27
+
28
+ protected function getResource()
29
+ {
30
+ return strtr('/contacts/:contactId', array(':contactId' => $this->contactId));
31
+ }
32
+
33
+ protected function response($data)
34
+ {
35
+ return new DeleteResponse;
36
+ }
37
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactDeleteMultiple.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+
7
+ /**
8
+ * @method DeleteResponse execute()
9
+ */
10
+ final class ContactDeleteMultiple extends ContactCount
11
+ {
12
+ public function getMethod()
13
+ {
14
+ return self::METHOD_DELETE;
15
+ }
16
+
17
+ protected function response($data)
18
+ {
19
+ return new DeleteResponse;
20
+ }
21
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactEdit.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use DateTime;
6
+ use SMSApi\Api\Response\Contacts\ContactResponse;
7
+ use SMSApi\Client;
8
+ use SMSApi\Proxy\Proxy;
9
+
10
+ /**
11
+ * @method ContactResponse execute()
12
+ */
13
+ class ContactEdit extends ContactsAction
14
+ {
15
+ private $contactId;
16
+
17
+ public function __construct($contactId, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->contactId = $contactId;
22
+ }
23
+
24
+ public function getMethod()
25
+ {
26
+ return self::METHOD_PUT;
27
+ }
28
+
29
+ public function getResource()
30
+ {
31
+ return strtr('/contacts/:contactId', array(':contactId' => $this->contactId));
32
+ }
33
+
34
+ protected function response($data)
35
+ {
36
+ return ContactResponse::fromJsonString($data);
37
+ }
38
+
39
+ public function setPhoneNumber($phoneNumber)
40
+ {
41
+ $this->setParamValue(ContactResponse::FIELD_PHONE_NUMBER, $phoneNumber);
42
+
43
+ return $this;
44
+ }
45
+
46
+ public function setEmail($email)
47
+ {
48
+ $this->setParamValue(ContactResponse::FIELD_EMAIL, $email);
49
+
50
+ return $this;
51
+ }
52
+
53
+ public function setFirstName($firstName)
54
+ {
55
+ $this->setParamValue(ContactResponse::FIELD_FIRST_NAME, $firstName);
56
+
57
+ return $this;
58
+ }
59
+
60
+ public function setLastName($lastName)
61
+ {
62
+ $this->setParamValue(ContactResponse::FIELD_LAST_NAME, $lastName);
63
+
64
+ return $this;
65
+ }
66
+
67
+ public function setGenderAsMale()
68
+ {
69
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_MALE);
70
+
71
+ return $this;
72
+ }
73
+
74
+ public function setGenderAsFemale()
75
+ {
76
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_FEMALE);
77
+
78
+ return $this;
79
+ }
80
+
81
+ public function setGenderAsUndefined()
82
+ {
83
+ $this->setParamValue(ContactResponse::FIELD_GENDER, ContactResponse::GENDER_UNDEFINED);
84
+
85
+ return $this;
86
+ }
87
+
88
+ public function setBirthdayDate(DateTime $birthdayDate)
89
+ {
90
+ $this->params[ContactResponse::FIELD_BIRTHDAY_DATE] = $birthdayDate->format('Y-m-d');
91
+
92
+ return $this;
93
+ }
94
+
95
+ public function setDescription($description)
96
+ {
97
+ $this->setParamValue(ContactResponse::FIELD_DESCRIPTION, $description);
98
+
99
+ return $this;
100
+ }
101
+
102
+ public function setCity($city)
103
+ {
104
+ $this->setParamValue(ContactResponse::FIELD_CITY, $city);
105
+
106
+ return $this;
107
+ }
108
+
109
+ public function setSource($source)
110
+ {
111
+ $this->setParamValue(ContactResponse::FIELD_SOURCE, $source);
112
+
113
+ return $this;
114
+ }
115
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGet.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\ContactResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method ContactResponse execute()
11
+ */
12
+ final class ContactGet extends ContactsAction
13
+ {
14
+ private $contactId;
15
+
16
+ public function __construct($contactId, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->contactId = $contactId;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_GET;
26
+ }
27
+
28
+ public function getResource()
29
+ {
30
+ return strtr('/contacts/:contactId', array(':contactId' => $this->contactId));
31
+ }
32
+
33
+ protected function response($data)
34
+ {
35
+ return ContactResponse::fromJsonString($data);
36
+ }
37
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupAdd.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupsResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method GroupsResponse execute()
11
+ */
12
+ final class ContactGroupAdd extends ContactsAction
13
+ {
14
+ private $contactId;
15
+ private $groupId;
16
+
17
+ public function __construct($contactId, $groupId, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->contactId = $contactId;
22
+ $this->groupId = $groupId;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_PUT;
28
+ }
29
+
30
+ protected function getResource()
31
+ {
32
+ return strtr(
33
+ '/contacts/:contactId/groups/:groupId',
34
+ array(
35
+ ':contactId' => $this->contactId,
36
+ ':groupId' => $this->groupId,
37
+ )
38
+ );
39
+ }
40
+
41
+ protected function response($data)
42
+ {
43
+ return GroupsResponse::fromJsonString($data);
44
+ }
45
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupDelete.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method DeleteResponse execute()
11
+ */
12
+ final class ContactGroupDelete extends ContactsAction
13
+ {
14
+ private $contactId;
15
+ private $groupId;
16
+
17
+ public function __construct($contactId, $groupId, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->contactId = $contactId;
22
+ $this->groupId = $groupId;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_DELETE;
28
+ }
29
+
30
+ protected function response($data)
31
+ {
32
+ return new DeleteResponse;
33
+ }
34
+
35
+ protected function getResource()
36
+ {
37
+ return strtr(
38
+ '/contacts/:contactId/groups/:groupId',
39
+ array(
40
+ ':contactId' => $this->contactId,
41
+ ':groupId' => $this->groupId,
42
+ )
43
+ );
44
+ }
45
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupGet.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method GroupResponse execute()
11
+ */
12
+ final class ContactGroupGet extends ContactsAction
13
+ {
14
+ private $contactId;
15
+ private $groupId;
16
+
17
+ public function __construct($contactId, $groupId, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->contactId = $contactId;
22
+ $this->groupId = $groupId;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_GET;
28
+ }
29
+
30
+ protected function response($data)
31
+ {
32
+ return GroupResponse::fromJsonString($data);
33
+ }
34
+
35
+ protected function getResource()
36
+ {
37
+ return strtr(
38
+ '/contacts/:contactId/groups/:groupId',
39
+ array(
40
+ ':contactId' => $this->contactId,
41
+ ':groupId' => $this->groupId,
42
+ )
43
+ );
44
+ }
45
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactGroupList.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupsResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method GroupsResponse execute()
11
+ */
12
+ final class ContactGroupList extends ContactsAction
13
+ {
14
+ private $contactId;
15
+
16
+ public function __construct($contactId, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->contactId = $contactId;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_GET;
26
+ }
27
+
28
+ protected function response($data)
29
+ {
30
+ return GroupsResponse::fromJsonString($data);
31
+ }
32
+
33
+ protected function getResource()
34
+ {
35
+ return strtr('/contacts/:contactId/groups', array(':contactId' => $this->contactId));
36
+ }
37
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactList.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use DateTime;
6
+ use SMSApi\Api\Response\Contacts\ContactResponse;
7
+ use SMSApi\Api\Response\Contacts\ContactsResponse;
8
+
9
+ /**
10
+ * @method ContactsResponse execute()
11
+ */
12
+ final class ContactList extends ContactCount
13
+ {
14
+ const PARAM_OFFSET = 'offset';
15
+ const PARAM_LIMIT = 'limit';
16
+ const PARAM_ORDER_BY = 'order_by';
17
+
18
+ public function getMethod()
19
+ {
20
+ return self::METHOD_GET;
21
+ }
22
+
23
+ protected function response($data)
24
+ {
25
+ return ContactsResponse::fromJsonString($data);
26
+ }
27
+
28
+ public function setOffsetAndLimit($offset, $limit)
29
+ {
30
+ $this
31
+ ->setParamValue(self::PARAM_OFFSET, $offset)
32
+ ->setParamValue(self::PARAM_LIMIT, $limit);
33
+
34
+ return $this;
35
+ }
36
+
37
+ public function setOrderBy($orderBy)
38
+ {
39
+ $this->setParamValue(self::PARAM_ORDER_BY, $orderBy);
40
+
41
+ return $this;
42
+ }
43
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/ContactsAction.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+ use SMSApi\Proxy\Uri;
9
+
10
+ abstract class ContactsAction extends AbstractAction
11
+ {
12
+ protected $isContacts = true;
13
+
14
+ public function __construct(Client $client, Proxy $proxy)
15
+ {
16
+ parent::__construct();
17
+
18
+ $this
19
+ ->client($client)
20
+ ->proxy($proxy->setBasicAuthentication($client));
21
+ }
22
+
23
+ public function uri()
24
+ {
25
+ return new Uri(
26
+ $this->proxy->getProtocol(),
27
+ $this->proxy->getHost(),
28
+ $this->proxy->getPort(),
29
+ $this->getResource(),
30
+ ltrim($this->setJson(false)->paramsOther(), '&')
31
+ );
32
+ }
33
+
34
+ protected function setParamValue($name, $value)
35
+ {
36
+ $this->params[$name] = urlencode($value);
37
+
38
+ return $this;
39
+ }
40
+
41
+ protected function setParamArray($name, array $values)
42
+ {
43
+ $this->params[$name] = array_map('urlencode', $values);
44
+
45
+ return $this;
46
+ }
47
+
48
+ /**
49
+ * @return string
50
+ */
51
+ abstract protected function getResource();
52
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldAdd.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\FieldResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method FieldResponse execute()
11
+ */
12
+ final class FieldAdd extends ContactsAction
13
+ {
14
+ public function __construct($name, Client $client, Proxy $proxy)
15
+ {
16
+ parent::__construct($client, $proxy);
17
+
18
+ $this->setParamValue(FieldResponse::FIELD_NAME, $name);
19
+ }
20
+
21
+ public function getMethod()
22
+ {
23
+ return self::METHOD_POST;
24
+ }
25
+
26
+ protected function getResource()
27
+ {
28
+ return '/contacts/fields';
29
+ }
30
+
31
+ protected function response($data)
32
+ {
33
+ return FieldResponse::fromJsonString($data);
34
+ }
35
+
36
+ public function setTypeAsText()
37
+ {
38
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_TEXT);
39
+
40
+ return $this;
41
+ }
42
+
43
+ public function setTypeAsDate()
44
+ {
45
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_DATE);
46
+
47
+ return $this;
48
+ }
49
+
50
+ public function setTypeAsEmail()
51
+ {
52
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_EMAIL);
53
+
54
+ return $this;
55
+ }
56
+
57
+ public function setTypeAsNumber()
58
+ {
59
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_NUMBER);
60
+
61
+ return $this;
62
+ }
63
+
64
+ public function setTypeAsPhoneNumber()
65
+ {
66
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_PHONE_NUMBER);
67
+
68
+ return $this;
69
+ }
70
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldDelete.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method DeleteResponse execute()
11
+ */
12
+ final class FieldDelete extends ContactsAction
13
+ {
14
+ private $id;
15
+
16
+ public function __construct($id, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->id = $id;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_DELETE;
26
+ }
27
+
28
+ protected function getResource()
29
+ {
30
+ return strtr('/contacts/fields/:id', array(':id' => urlencode($this->id)));
31
+ }
32
+
33
+ protected function response($data)
34
+ {
35
+ return new DeleteResponse;
36
+ }
37
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldEdit.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\FieldResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method FieldResponse execute()
11
+ */
12
+ final class FieldEdit extends ContactsAction
13
+ {
14
+ private $id;
15
+
16
+ public function __construct($id, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->id = $id;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_PUT;
26
+ }
27
+
28
+ protected function getResource()
29
+ {
30
+ return strtr('/contacts/fields/:id', array(':id' => urlencode($this->id)));
31
+ }
32
+
33
+ protected function response($data)
34
+ {
35
+ return FieldResponse::fromJsonString($data);
36
+ }
37
+
38
+ public function setName($name)
39
+ {
40
+ $this->setParamValue(FieldResponse::FIELD_NAME, $name);
41
+
42
+ return $this;
43
+ }
44
+
45
+ public function setTypeAsText()
46
+ {
47
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_TEXT);
48
+
49
+ return $this;
50
+ }
51
+
52
+ public function setTypeAsDate()
53
+ {
54
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_DATE);
55
+
56
+ return $this;
57
+ }
58
+
59
+ public function setTypeAsEmail()
60
+ {
61
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_EMAIL);
62
+
63
+ return $this;
64
+ }
65
+
66
+ public function setTypeAsNumber()
67
+ {
68
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_NUMBER);
69
+
70
+ return $this;
71
+ }
72
+
73
+ public function setTypeAsPhoneNumber()
74
+ {
75
+ $this->setParamValue(FieldResponse::FIELD_TYPE, FieldResponse::TYPE_PHONE_NUMBER);
76
+
77
+ return $this;
78
+ }
79
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/FieldList.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\FieldsResponse;
6
+
7
+ /**
8
+ * @method FieldsResponse execute()
9
+ */
10
+ final class FieldList extends ContactsAction
11
+ {
12
+ public function getMethod()
13
+ {
14
+ return self::METHOD_GET;
15
+ }
16
+
17
+ protected function getResource()
18
+ {
19
+ return '/contacts/fields';
20
+ }
21
+
22
+ protected function response($data)
23
+ {
24
+ return FieldsResponse::fromJsonString($data);
25
+ }
26
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupAdd.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method GroupResponse execute()
11
+ */
12
+ final class GroupAdd extends ContactsAction
13
+ {
14
+ const RESOURCE = '/contacts/groups';
15
+
16
+ public function __construct($name, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->params['name'] = $name;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_POST;
26
+ }
27
+
28
+ public function getResource()
29
+ {
30
+ return '/contacts/groups';
31
+ }
32
+
33
+ protected function response($data)
34
+ {
35
+ return GroupResponse::fromJsonString($data);
36
+ }
37
+
38
+ public function setDescription($description)
39
+ {
40
+ $this->setParamValue(GroupResponse::FIELD_DESCRIPTION, $description);
41
+
42
+ return $this;
43
+ }
44
+
45
+ public function setIdx($idx)
46
+ {
47
+ $this->setParamValue(GroupResponse::FIELD_IDX, $idx);
48
+
49
+ return $this;
50
+ }
51
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupDelete.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method DeleteResponse execute()
11
+ */
12
+ final class GroupDelete extends ContactsAction
13
+ {
14
+ const RESOURCE = '/contacts/groups/';
15
+
16
+ private $groupId;
17
+
18
+ public function __construct($groupId, Client $client, Proxy $proxy)
19
+ {
20
+ parent::__construct($client, $proxy);
21
+
22
+ $this->groupId = $groupId;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_DELETE;
28
+ }
29
+
30
+ public function getResource()
31
+ {
32
+ return strtr('/contacts/groups/:groupId', array(':groupId' => $this->groupId));
33
+ }
34
+
35
+ protected function response($data)
36
+ {
37
+ return new DeleteResponse;
38
+ }
39
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupEdit.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method GroupResponse execute()
11
+ */
12
+ final class GroupEdit extends ContactsAction
13
+ {
14
+ private $groupId;
15
+
16
+ public function __construct($groupId, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->groupId = $groupId;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_PUT;
26
+ }
27
+
28
+ public function getResource()
29
+ {
30
+ return strtr('/contacts/groups/:groupId', array(':groupId' => $this->groupId));
31
+ }
32
+
33
+ protected function response($data)
34
+ {
35
+ return GroupResponse::fromJsonString($data);
36
+ }
37
+
38
+ public function setName($name)
39
+ {
40
+ $this->setParamValue(GroupResponse::FIELD_NAME, $name);
41
+
42
+ return $this;
43
+ }
44
+
45
+ public function setDescription($description)
46
+ {
47
+ $this->setParamValue(GroupResponse::FIELD_DESCRIPTION, $description);
48
+
49
+ return $this;
50
+ }
51
+
52
+ public function setIdx($idx)
53
+ {
54
+ $this->setParamValue(GroupResponse::FIELD_IDX, $idx);
55
+
56
+ return $this;
57
+ }
58
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupGet.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method GroupResponse execute()
11
+ */
12
+ final class GroupGet extends ContactsAction
13
+ {
14
+ const RESOURCE = '/contacts/groups/';
15
+
16
+ private $groupId;
17
+
18
+ public function __construct($groupId, Client $client, Proxy $proxy)
19
+ {
20
+ parent::__construct($client, $proxy);
21
+
22
+ $this->groupId = $groupId;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_GET;
28
+ }
29
+
30
+ public function getResource()
31
+ {
32
+ return strtr('/contacts/groups/:groupId', array(':groupId' => $this->groupId));
33
+ }
34
+
35
+ protected function response($data)
36
+ {
37
+ return GroupResponse::fromJsonString($data);
38
+ }
39
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupList.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\GroupResponse;
6
+ use SMSApi\Api\Response\Contacts\GroupsResponse;
7
+
8
+ /**
9
+ * @method GroupsResponse execute()
10
+ */
11
+ final class GroupList extends ContactsAction
12
+ {
13
+ public function getMethod()
14
+ {
15
+ return self::METHOD_GET;
16
+ }
17
+
18
+ public function getResource()
19
+ {
20
+ return '/contacts/groups';
21
+ }
22
+
23
+ protected function response($data)
24
+ {
25
+ return GroupsResponse::fromJsonString($data);
26
+ }
27
+
28
+ public function setIds(array $ids)
29
+ {
30
+ $this->setParamValue(GroupResponse::FIELD_ID, $ids);
31
+
32
+ return $this;
33
+ }
34
+
35
+ public function setNames(array $names)
36
+ {
37
+ $this->setParamValue(GroupResponse::FIELD_NAME, $names);
38
+
39
+ return $this;
40
+ }
41
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupMemberAdd.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\ContactResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method ContactResponse execute()
11
+ */
12
+ class GroupMemberAdd extends ContactsAction
13
+ {
14
+ private $groupId;
15
+ private $contactId;
16
+
17
+ public function __construct($groupId, $contactId, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->groupId = $groupId;
22
+ $this->contactId = $contactId;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_PUT;
28
+ }
29
+
30
+ protected function response($data)
31
+ {
32
+ return ContactResponse::fromJsonString($data);
33
+ }
34
+
35
+ protected function getResource()
36
+ {
37
+ return strtr(
38
+ '/contacts/groups/:groupId/members/:contactId',
39
+ array(':groupId' => $this->groupId, ':contactId' => $this->contactId)
40
+ );
41
+ }
42
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupMemberDelete.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+
7
+ /**
8
+ * @method DeleteResponse execute()
9
+ */
10
+ final class GroupMemberDelete extends GroupMemberAdd
11
+ {
12
+ public function getMethod()
13
+ {
14
+ return self::METHOD_DELETE;
15
+ }
16
+
17
+ protected function response($data)
18
+ {
19
+ return new DeleteResponse;
20
+ }
21
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupMemberGet.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ final class GroupMemberGet extends GroupMemberAdd
6
+ {
7
+ public function getMethod()
8
+ {
9
+ return self::METHOD_GET;
10
+ }
11
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionAdd.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\PermissionResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method PermissionResponse execute()
11
+ */
12
+ final class GroupPermissionAdd extends ContactsAction
13
+ {
14
+ private $groupId;
15
+
16
+ public function __construct($groupId, $username, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->groupId = $groupId;
21
+ $this->setParamValue(PermissionResponse::FIELD_USERNAME, $username);
22
+ }
23
+
24
+ public function getMethod()
25
+ {
26
+ return self::METHOD_POST;
27
+ }
28
+
29
+ protected function response($data)
30
+ {
31
+ return PermissionResponse::fromJsonString($data);
32
+ }
33
+
34
+ protected function getResource()
35
+ {
36
+ return strtr('/contacts/groups/:groupId/permissions', array(':groupId' => $this->groupId));
37
+ }
38
+
39
+ public function enableRead()
40
+ {
41
+ $this->setParamValue(PermissionResponse::FIELD_READ, true);
42
+
43
+ return $this;
44
+ }
45
+
46
+ public function disableRead()
47
+ {
48
+ $this->setParamValue(PermissionResponse::FIELD_READ, false);
49
+
50
+ return $this;
51
+ }
52
+
53
+ public function enableWrite()
54
+ {
55
+ $this->setParamValue(PermissionResponse::FIELD_WRITE, true);
56
+
57
+ return $this;
58
+ }
59
+
60
+ public function disableWrite()
61
+ {
62
+ $this->setParamValue(PermissionResponse::FIELD_WRITE, false);
63
+
64
+ return $this;
65
+ }
66
+
67
+ public function enableSend()
68
+ {
69
+ $this->setParamValue(PermissionResponse::FIELD_SEND, true);
70
+
71
+ return $this;
72
+ }
73
+
74
+ public function disableSend()
75
+ {
76
+ $this->setParamValue(PermissionResponse::FIELD_SEND, false);
77
+
78
+ return $this;
79
+ }
80
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionDelete.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\DeleteResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method DeleteResponse execute()
11
+ */
12
+ final class GroupPermissionDelete extends ContactsAction
13
+ {
14
+ private $groupId;
15
+ private $username;
16
+
17
+ public function __construct($groupId, $username, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->groupId = $groupId;
22
+ $this->username = $username;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_DELETE;
28
+ }
29
+
30
+ protected function response($data)
31
+ {
32
+ return new DeleteResponse;
33
+ }
34
+
35
+ protected function getResource()
36
+ {
37
+ return strtr(
38
+ '/contacts/groups/:groupId/permissions/:username',
39
+ array(
40
+ ':groupId' => $this->groupId,
41
+ ':username' => urlencode($this->username),
42
+ )
43
+ );
44
+ }
45
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionEdit.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\PermissionResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method PermissionResponse execute()
11
+ */
12
+ final class GroupPermissionEdit extends ContactsAction
13
+ {
14
+ private $groupId;
15
+ private $username;
16
+
17
+ public function __construct($groupId, $username, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->groupId = $groupId;
22
+ $this->username = $username;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_PUT;
28
+ }
29
+
30
+ protected function response($data)
31
+ {
32
+ return PermissionResponse::fromJsonString($data);
33
+ }
34
+
35
+ protected function getResource()
36
+ {
37
+ return strtr(
38
+ '/contacts/groups/:groupId/permissions/:username',
39
+ array(
40
+ ':groupId' => $this->groupId,
41
+ ':username' => $this->username,
42
+ )
43
+ );
44
+ }
45
+
46
+ public function enableRead()
47
+ {
48
+ $this->setParamValue(PermissionResponse::FIELD_READ, true);
49
+
50
+ return $this;
51
+ }
52
+
53
+ public function disableRead()
54
+ {
55
+ $this->setParamValue(PermissionResponse::FIELD_READ, false);
56
+
57
+ return $this;
58
+ }
59
+
60
+ public function enableWrite()
61
+ {
62
+ $this->setParamValue(PermissionResponse::FIELD_WRITE, true);
63
+
64
+ return $this;
65
+ }
66
+
67
+ public function disableWrite()
68
+ {
69
+ $this->setParamValue(PermissionResponse::FIELD_WRITE, false);
70
+
71
+ return $this;
72
+ }
73
+
74
+ public function enableSend()
75
+ {
76
+ $this->setParamValue(PermissionResponse::FIELD_SEND, true);
77
+
78
+ return $this;
79
+ }
80
+
81
+ public function disableSend()
82
+ {
83
+ $this->setParamValue(PermissionResponse::FIELD_SEND, false);
84
+
85
+ return $this;
86
+ }
87
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionGet.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\PermissionResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method PermissionResponse execute()
11
+ */
12
+ final class GroupPermissionGet extends ContactsAction
13
+ {
14
+ private $groupId;
15
+ private $username;
16
+
17
+ public function __construct($groupId, $username, Client $client, Proxy $proxy)
18
+ {
19
+ parent::__construct($client, $proxy);
20
+
21
+ $this->groupId = $groupId;
22
+ $this->username = $username;
23
+ }
24
+
25
+ public function getMethod()
26
+ {
27
+ return self::METHOD_GET;
28
+ }
29
+
30
+ protected function response($data)
31
+ {
32
+ return PermissionResponse::fromJsonString($data);
33
+ }
34
+
35
+ protected function getResource()
36
+ {
37
+ return strtr(
38
+ '/contacts/groups/:groupId/permissions/:username',
39
+ array(
40
+ ':groupId' => $this->groupId,
41
+ ':username' => urlencode($this->username),
42
+ )
43
+ );
44
+ }
45
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Contacts/GroupPermissionList.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Contacts;
4
+
5
+ use SMSApi\Api\Response\Contacts\PermissionsResponse;
6
+ use SMSApi\Client;
7
+ use SMSApi\Proxy\Proxy;
8
+
9
+ /**
10
+ * @method PermissionsResponse execute()
11
+ */
12
+ final class GroupPermissionList extends ContactsAction
13
+ {
14
+ private $groupId;
15
+
16
+ public function __construct($groupId, Client $client, Proxy $proxy)
17
+ {
18
+ parent::__construct($client, $proxy);
19
+
20
+ $this->groupId = $groupId;
21
+ }
22
+
23
+ public function getMethod()
24
+ {
25
+ return self::METHOD_GET;
26
+ }
27
+
28
+ protected function response($data)
29
+ {
30
+ return PermissionsResponse::fromJsonString($data);
31
+ }
32
+
33
+ protected function getResource()
34
+ {
35
+ return strtr('/contacts/groups/:groupId/permissions', array(':groupId' => $this->groupId));
36
+ }
37
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Mms/Delete.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Mms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\CountableResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Delete
11
+ * @package SMSApi\Api\Action\Mms
12
+ *
13
+ * @method CountableResponse execute()
14
+ */
15
+ class Delete extends AbstractAction
16
+ {
17
+ /**
18
+ * @var \ArrayObject
19
+ */
20
+ private $id;
21
+
22
+ /**
23
+ *
24
+ */
25
+ function __construct() {
26
+ $this->id = new \ArrayObject();
27
+ }
28
+
29
+ /**
30
+ * @param $data
31
+ * @return CountableResponse
32
+ */
33
+ protected function response($data)
34
+ {
35
+ return new CountableResponse($data);
36
+ }
37
+
38
+ /**
39
+ * @return Uri
40
+ */
41
+ public function uri() {
42
+
43
+ $query = "";
44
+
45
+ $query .= $this->paramsLoginToQuery();
46
+
47
+ $query .= $this->paramsOther();
48
+
49
+ $query .= "&sch_del=" . implode( "|", $this->id->getArrayCopy() );
50
+
51
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/mms.do", $query );
52
+ }
53
+
54
+ /**
55
+ * Set ID of messages to delete.
56
+ *
57
+ * This id was returned after sending message.
58
+ *
59
+ * @param $id
60
+ * @return $this
61
+ * @throws \SMSApi\Exception\ActionException
62
+ */
63
+ public function filterById( $id ) {
64
+ if ( !is_string( $id ) ) {
65
+ throw new \SMSApi\Exception\ActionException( 'Invalid value id' );
66
+ }
67
+
68
+ $this->id->append( $id );
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ *
74
+ * Set array IDs of messages to delete.
75
+ *
76
+ * This id was returned after sending message.
77
+ *
78
+ * @param $ids
79
+ * @return $this
80
+ * @throws \SMSApi\Exception\ActionException
81
+ */
82
+ public function filterByIds( array $ids ) {
83
+
84
+ $this->id->exchangeArray( $ids );
85
+ return $this;
86
+ }
87
+
88
+ /**
89
+ * @deprecated since v1.0.0
90
+ */
91
+ public function ids($array) {
92
+ return $this->filterByIds($array);
93
+ }
94
+
95
+ /**
96
+ * @deprecated since v1.0.0
97
+ */
98
+ public function id($id) {
99
+ return $this->filterById($id);
100
+ }
101
+
102
+ }
103
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Mms/Get.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Mms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\StatusResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Get
11
+ * @package SMSApi\Api\Action\Mms
12
+ *
13
+ * @method StatusResponse execute()
14
+ */
15
+ class Get extends AbstractAction
16
+ {
17
+ /**
18
+ * @var \ArrayObject
19
+ */
20
+ private $id;
21
+
22
+ function __construct() {
23
+ $this->id = new \ArrayObject();
24
+ }
25
+
26
+ /**
27
+ * @param $data
28
+ * @return StatusResponse
29
+ */
30
+ protected function response( $data )
31
+ {
32
+ return new StatusResponse( $data );
33
+ }
34
+
35
+ /**
36
+ * @return Uri
37
+ */
38
+ public function uri() {
39
+
40
+ $query = "";
41
+
42
+ $query .= $this->paramsLoginToQuery();
43
+
44
+ $query .= $this->paramsOther();
45
+
46
+ $query .= "&status=" . implode( "|", $this->id->getArrayCopy() );
47
+
48
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/mms.do", $query );
49
+ }
50
+
51
+ /**
52
+ * Set ID of messages to check.
53
+ *
54
+ * This id was returned after sending message.
55
+ *
56
+ * @param $id
57
+ * @return $this
58
+ * @throws \SMSApi\Exception\ActionException
59
+ */
60
+ public function filterById( $id ) {
61
+
62
+ $this->id->append( $id );
63
+ return $this;
64
+ }
65
+
66
+ /**
67
+ * Set IDs of messages to check.
68
+ *
69
+ * This id was returned after sending message.
70
+ *
71
+ * @param $ids
72
+ * @return $this
73
+ * @throws \SMSApi\Exception\ActionException
74
+ */
75
+ public function filterByIds( array $ids ) {
76
+
77
+ $this->id->exchangeArray( $ids );
78
+ return $this;
79
+ }
80
+
81
+ /**
82
+ * @deprecated since v1.0.0
83
+ */
84
+ public function ids($array) {
85
+ return $this->filterByIds($array);
86
+ }
87
+
88
+ /**
89
+ * @deprecated since v1.0.0
90
+ */
91
+ public function id($id) {
92
+ return $this->filterById($id);
93
+ }
94
+
95
+ }
96
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Mms/Send.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Mms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\StatusResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Send
11
+ * @package SMSApi\Api\Action\Mms
12
+ *
13
+ * @method StatusResponse execute()
14
+ */
15
+ class Send extends AbstractAction
16
+ {
17
+ /**
18
+ * @param $data
19
+ * @return StatusResponse
20
+ */
21
+ protected function response($data)
22
+ {
23
+ return new StatusResponse($data);
24
+ }
25
+
26
+ /**
27
+ * @return Uri
28
+ * @throws \SMSApi\Exception\ActionException
29
+ */
30
+ public function uri() {
31
+
32
+ $query = "";
33
+
34
+ $query .= $this->paramsLoginToQuery();
35
+
36
+ $query .= $this->paramsBasicToQuery();
37
+
38
+ $query .= $this->paramsOther();
39
+
40
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/mms.do", $query );
41
+ }
42
+
43
+ /**
44
+ * Set mobile phone number of the recipients.
45
+ *
46
+ * @param $to array|string phone number
47
+ * @return $this
48
+ */
49
+ public function setTo( $to ) {
50
+
51
+ if ( !is_array( $to ) ) {
52
+ $to = array( $to );
53
+ }
54
+
55
+ $this->to->exchangeArray( $to );
56
+ return $this;
57
+ }
58
+
59
+ /**
60
+ * Set name of the group from the phone book to which message should be sent.
61
+ *
62
+ * @param string $group group name
63
+ * @return $this
64
+ */
65
+ public function setGroup( $group ) {
66
+ $this->group = $group;
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * Set scheduled date sending message.
72
+ *
73
+ * Setting a past date will result in sending message instantly.
74
+ *
75
+ * @param $date
76
+ * @return $this
77
+ */
78
+ public function setDateSent( $date ) {
79
+ $this->date = $date;
80
+ return $this;
81
+ }
82
+
83
+ /**
84
+ * Set optional custom value sent with SMS and sent back in CALLBACK.
85
+ *
86
+ * @param string|array $idx
87
+ * @return $this
88
+ */
89
+ public function setIDx( $idx ) {
90
+ if ( !is_array( $idx ) ) {
91
+ $idx = array( $idx );
92
+ }
93
+
94
+ $this->idx->exchangeArray( $idx );
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * Set checking idx is unique.
100
+ *
101
+ * Prevents from sending more than one message with the same idx.
102
+ * When this parameter is set and message with the same idx was
103
+ * already sent error 53 is returned.
104
+ *
105
+ * @param bool $check
106
+ * @return $this
107
+ */
108
+ public function setCheckIDx( $check ) {
109
+ if ( $check == true ) {
110
+ $this->params[ "check_idx" ] = "1";
111
+ } else if ( $check == false ) {
112
+ $this->params[ "check_idx" ] = "0";
113
+ }
114
+
115
+ return $this;
116
+ }
117
+
118
+
119
+ /**
120
+ * Set affiliate code.
121
+ *
122
+ * @param string $partner affiliate code
123
+ * @return $this
124
+ */
125
+ public function setPartner( $partner ) {
126
+ $this->params[ "partner_id" ] = $partner;
127
+ return $this;
128
+ }
129
+
130
+ /**
131
+ * Set message subject.
132
+ *
133
+ * @param string $subject subject of message
134
+ * @return $this
135
+ */
136
+ public function setSubject( $subject ) {
137
+ $this->params[ "subject" ] = $subject;
138
+ return $this;
139
+ }
140
+
141
+ /**
142
+ * Set MMS smill.
143
+ *
144
+ * @param string $smil xml smill
145
+ * @return $this
146
+ */
147
+ public function setSmil( $smil ) {
148
+ $this->params[ "smil" ] = urlencode($smil);
149
+ return $this;
150
+ }
151
+
152
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactAdd.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class ContactAdd
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\ContactAdd
12
+ */
13
+ class ContactAdd extends AbstractAction {
14
+
15
+ /**
16
+ * @var \ArrayObject
17
+ */
18
+ private $groups;
19
+
20
+ /**
21
+ *
22
+ */
23
+ function __construct() {
24
+ $this->groups = new \ArrayObject();
25
+ }
26
+
27
+ /**
28
+ * @param $data
29
+ * @return \SMSApi\Api\Response\ContactResponse
30
+ */
31
+ protected function response( $data ) {
32
+
33
+ return new \SMSApi\Api\Response\ContactResponse( $data );
34
+ }
35
+
36
+ /**
37
+ * @return Uri
38
+ */
39
+ public function uri() {
40
+
41
+ $query = "";
42
+
43
+ $query .= $this->paramsLoginToQuery();
44
+
45
+ $query .= $this->paramsOther();
46
+
47
+ if ( count( $this->groups ) > 0 ) {
48
+ $query .= "&groups=" . implode( ",", $this->groups->getArrayCopy() );
49
+ }
50
+
51
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
52
+ }
53
+
54
+ /**
55
+ * Set contact phone number.
56
+ *
57
+ * @param string|int $number
58
+ * @return $this
59
+ */
60
+ public function setNumber( $number ) {
61
+ $this->params[ "add_contact" ] = $number;
62
+ return $this;
63
+ }
64
+
65
+ /**
66
+ * Set contact first name.
67
+ *
68
+ * @param string $firstName
69
+ * @return $this
70
+ */
71
+ public function setFirstName( $firstName ) {
72
+ $this->params[ "first_name" ] = $firstName;
73
+ return $this;
74
+ }
75
+
76
+ /**
77
+ * Set contact last name.
78
+ *
79
+ * @param string $lastName
80
+ * @return $this
81
+ */
82
+ public function setLastName( $lastName ) {
83
+ $this->params[ "last_name" ] = $lastName;
84
+ return $this;
85
+ }
86
+
87
+ /**
88
+ * Set additional contact description.
89
+ *
90
+ * @param string $info
91
+ * @return $this
92
+ */
93
+ public function setInfo( $info ) {
94
+ $this->params[ "info" ] = $info;
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * Set contact email address.
100
+ *
101
+ * @param $email
102
+ * @return $this
103
+ */
104
+ public function setEmail( $email ) {
105
+ $this->params[ "email" ] = $email;
106
+ return $this;
107
+ }
108
+
109
+ /**
110
+ * Set contact birthday date.
111
+ *
112
+ * @param string $birthday
113
+ * @return $this
114
+ */
115
+ public function setBirthday( $birthday ) {
116
+ $this->params[ "birthday" ] = $birthday;
117
+ return $this;
118
+ }
119
+
120
+ /**
121
+ * Set contact city.
122
+ *
123
+ * @param string $city
124
+ * @return $this
125
+ */
126
+ public function setCity( $city ) {
127
+ $this->params[ "city" ] = $city;
128
+ return $this;
129
+ }
130
+
131
+ /**
132
+ * Set contact gender.
133
+ *
134
+ * @param string $gender female, male, unknown
135
+ * @return $this
136
+ */
137
+ public function setGender( $gender ) {
138
+ $this->params[ "gender" ] = $gender;
139
+ return $this;
140
+ }
141
+
142
+ /**
143
+ * Set contact to group.
144
+ * Others contact groups will be removed.
145
+ *
146
+ * @param string $group group name
147
+ * @return $this
148
+ */
149
+ public function setGroup( $group ) {
150
+ $this->groups->append( $group );
151
+ return $this;
152
+ }
153
+
154
+ /**
155
+ * Set contact to groups.
156
+ * Others contact groups will be removed.
157
+ *
158
+ * @param array $groups array with groups names
159
+ * @return $this
160
+ */
161
+ public function setGroups( array $groups ) {
162
+ $this->groups->exchangeArray( $groups );
163
+ return $this;
164
+ }
165
+
166
+ }
167
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactDelete.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class ContactDelete
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\ContactDelete
12
+ */
13
+ class ContactDelete extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return \SMSApi\Api\Response\RawResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new \SMSApi\Api\Response\RawResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
36
+ }
37
+
38
+ /**
39
+ * Set contact phone number to delete.
40
+ *
41
+ * @param string|int $number phone number
42
+ * @return $this
43
+ */
44
+ public function filterByPhoneNumber( $number ) {
45
+ $this->params[ "delete_contact" ] = $number;
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * @deprecated since v1.0.0
51
+ * @param string|int $number phone number
52
+ * @return $this
53
+ */
54
+ public function setContact($number) {
55
+ return $this->filterByPhoneNumber($number);
56
+ }
57
+
58
+ }
59
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactEdit.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ /**
6
+ * Class ContactEdit
7
+ * @package SMSApi\Api\Action\Phonebook
8
+ * @deprecated use \SMSApi\Api\Action\Contacts\ContactEdit
9
+ */
10
+ class ContactEdit extends ContactAdd {
11
+
12
+
13
+ /**
14
+ * @deprecated since v1.0.0
15
+ */
16
+ public function setContact( $number ) {
17
+ return $this->filterByPhoneNumber($number);
18
+ }
19
+
20
+ /**
21
+ * Select contact phone number to edit.
22
+ *
23
+ * @param string|int $number phone number
24
+ * @return $this
25
+ */
26
+ public function filterByPhoneNumber( $number ) {
27
+ $this->params[ "edit_contact" ] = $number;
28
+ return $this;
29
+ }
30
+
31
+ /**
32
+ * Set new phone number.
33
+ *
34
+ * @param string|int $number phone number
35
+ * @return $this
36
+ */
37
+ public function setNumber( $number ) {
38
+ $this->params[ "new_number" ] = $number;
39
+ return $this;
40
+ }
41
+
42
+
43
+ /**
44
+ * Add contact to group.
45
+ *
46
+ * @param $groupName
47
+ */
48
+ public function addToGroup($groupName)
49
+ {
50
+ $this->params[ "add_to_group" ] = $groupName;
51
+ }
52
+
53
+
54
+ /**
55
+ * Remove contact from group.
56
+ *
57
+ * @param $groupName
58
+ */
59
+ public function removeFromGroup($groupName)
60
+ {
61
+ $this->params[ "remove_from_groups" ] = $groupName;
62
+ }
63
+
64
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactGet.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class ContactGet
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\ContactGet
12
+ */
13
+ class ContactGet extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return \SMSApi\Api\Response\ContactResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new \SMSApi\Api\Response\ContactResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $this->withGroups();
32
+
33
+ $query .= $this->paramsLoginToQuery();
34
+
35
+ $query .= $this->paramsOther();
36
+
37
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
38
+ }
39
+
40
+ /**
41
+ * @deprecated since v1.0.0
42
+ */
43
+ public function setContact( $number ) {
44
+ return $this->filterByPhoneNumber( $number );
45
+ }
46
+
47
+ /**
48
+ * Set filter by contact phone number.
49
+ *
50
+ * @param string|int $number phone number
51
+ * @return $this
52
+ */
53
+ public function filterByPhoneNumber( $number ) {
54
+ $this->params[ "get_contact" ] = $number;
55
+ return $this;
56
+ }
57
+
58
+
59
+ /**
60
+ * Add contact groups to response
61
+ *
62
+ * @return $this
63
+ */
64
+ private function withGroups() {
65
+ $this->params[ "with_groups" ] = 1;
66
+ return $this;
67
+ }
68
+
69
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/ContactList.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class ContactList
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\ContactList
12
+ */
13
+ class ContactList extends AbstractAction {
14
+
15
+ /**
16
+ * @var \ArrayObject
17
+ */
18
+ private $groups;
19
+
20
+ /**
21
+ *
22
+ */
23
+ function __construct() {
24
+ $this->groups = new \ArrayObject();
25
+ }
26
+
27
+ /**
28
+ * @param $data
29
+ * @return \SMSApi\Api\Response\ContactsResponse
30
+ */
31
+ protected function response( $data ) {
32
+
33
+ return new \SMSApi\Api\Response\ContactsResponse( $data );
34
+ }
35
+
36
+ /**
37
+ * @return Uri
38
+ */
39
+ public function uri() {
40
+
41
+ $query = "";
42
+
43
+ $query .= $this->paramsLoginToQuery();
44
+
45
+ $query .= $this->paramsOther();
46
+
47
+ if ( !empty( $this->groups ) ) {
48
+ $query .= "&groups=" . implode( ";", $this->groups->getArrayCopy() );
49
+ }
50
+
51
+ $query .= "&list_contacts=1";
52
+
53
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
54
+ }
55
+
56
+ /**
57
+ * @deprecated since v1.1.0
58
+ * @param $number
59
+ * @return $this
60
+ */
61
+ public function setNumber( $number ) {
62
+ $this->params[ "number" ] = $number;
63
+ return $this;
64
+ }
65
+
66
+ /**
67
+ * Set filter contacts by phone number.
68
+ *
69
+ * @param string|number $number phone number
70
+ * @return $this
71
+ */
72
+ public function filterByPhoneNumber( $number ) {
73
+ $this->params[ "number" ] = $number;
74
+ return $this;
75
+ }
76
+
77
+ /**
78
+ * @deprecated since v1.1.0
79
+ * @param $group
80
+ * @return $this
81
+ */
82
+ public function setGroup( $group ) {
83
+ $this->groups->append( $group );
84
+ return $this;
85
+ }
86
+
87
+
88
+ /**
89
+ * Set filter contacts by group name.
90
+ *
91
+ * @param string $group group name
92
+ * @return $this
93
+ */
94
+ public function filterByGroup( $group ) {
95
+ $this->groups->append( $group );
96
+ return $this;
97
+ }
98
+
99
+ /**
100
+ * Set filter contacts by group names.
101
+ *
102
+ * @param string[] $group array of group names
103
+ * @return $this
104
+ */
105
+ public function filterByGroups( array $groups ) {
106
+ $this->groups->exchangeArray( $groups );
107
+ return $this;
108
+ }
109
+
110
+ /**
111
+ * @deprecated since v1.0.0
112
+ * @param array $groups
113
+ * @return $this
114
+ */
115
+ public function setGroups( array $groups ) {
116
+ $this->groups->exchangeArray( $groups );
117
+ return $this;
118
+ }
119
+
120
+ /**
121
+ * @deprecated since v1.0.0
122
+ * @param $text
123
+ * @return $this
124
+ */
125
+ public function setText( $text ) {
126
+ $this->params[ "text_search" ] = $text;
127
+ return $this;
128
+ }
129
+
130
+
131
+ /**
132
+ * The result list will contain contacts with given chars string.
133
+ *
134
+ * @param string $text search string
135
+ * @return $this
136
+ */
137
+ public function search( $text ) {
138
+ $this->params[ "text_search" ] = $text;
139
+ return $this;
140
+ }
141
+
142
+ /**
143
+ * @deprecated since v1.1.0
144
+ * @param $gender
145
+ * @return $this
146
+ */
147
+ public function setGender( $gender ) {
148
+ $this->params[ "gender" ] = $gender;
149
+ return $this;
150
+ }
151
+
152
+ /**
153
+ * Set filter by gender.
154
+ *
155
+ * @param string $gender The value of $gender can be: male, female, unknown
156
+ * @return $this
157
+ */
158
+ public function filterByGender( $gender ) {
159
+ $this->params[ "gender" ] = $gender;
160
+ return $this;
161
+ }
162
+
163
+ /**
164
+ * Set order parameter.
165
+ *
166
+ * @param string $orderBy The value of $orderBy can be: first_name, last_name
167
+ * @return $this
168
+ */
169
+ public function setOrderBy( $orderBy ) {
170
+ $this->params[ "order_by" ] = $orderBy;
171
+
172
+ return $this;
173
+ }
174
+
175
+ /**
176
+ * Set order direction.
177
+ *
178
+ * @param string $orderDir The value of $orderBy can be: desc, asc
179
+ * @return $this
180
+ */
181
+ public function setOrderDir( $orderDir ) {
182
+ $this->params[ "order_dir" ] = $orderDir;
183
+ return $this;
184
+ }
185
+
186
+ /**
187
+ * Set result limit.
188
+ *
189
+ * @param int $limit Max limit is 200 contacts
190
+ * @return $this
191
+ */
192
+ public function setLimit( $limit ) {
193
+ $this->params[ "limit" ] = $limit;
194
+ return $this;
195
+ }
196
+
197
+ /**
198
+ * Set result offset.
199
+ *
200
+ * @param int $offset
201
+ * @return $this
202
+ */
203
+ public function setOffset( $offset ) {
204
+ $this->params[ "offset" ] = $offset;
205
+ return $this;
206
+ }
207
+
208
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupAdd.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class GroupAdd
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\GroupAdd
12
+ */
13
+ class GroupAdd extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return \SMSApi\Api\Response\GroupResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new \SMSApi\Api\Response\GroupResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
36
+ }
37
+
38
+ /**
39
+ * Set group name.
40
+ *
41
+ * @param string $groupName
42
+ * @return $this
43
+ */
44
+ public function setName( $groupName ) {
45
+ $this->params[ "add_group" ] = $groupName;
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * Set additional group description.
51
+ *
52
+ * @param string $info group description
53
+ * @return $this
54
+ */
55
+ public function setInfo( $info ) {
56
+ $this->params[ "info" ] = $info;
57
+ return $this;
58
+ }
59
+
60
+ }
61
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupDelete.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class GroupDelete
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\GroupDelete
12
+ */
13
+ class GroupDelete extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return \SMSApi\Api\Response\RawResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new \SMSApi\Api\Response\RawResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
36
+ }
37
+
38
+ /**
39
+ * @deprecated since v1.0.0
40
+ * @param string $groupName group name
41
+ * @return $this
42
+ */
43
+ public function setGroup( $groupName ) {
44
+ $this->params[ "delete_group" ] = $groupName;
45
+ return $this;
46
+ }
47
+
48
+ /**
49
+ * Set group to delete.
50
+ *
51
+ * @param string $groupName group name
52
+ * @return $this
53
+ */
54
+ public function filterByGroupName( $groupName ) {
55
+ $this->params[ "delete_group" ] = $groupName;
56
+ return $this;
57
+ }
58
+
59
+ /**
60
+ * Set true to remove contacts from phonebook.
61
+ * If contacts are in other groups, they will be only unbind.
62
+ *
63
+ * If this flag is false or unset contact will be only unbind from group.
64
+ *
65
+ * @param bool $remove if true contact in group will be removed
66
+ * @return $this
67
+ */
68
+ public function removeContacts( $remove ) {
69
+ if ( $remove == true ) {
70
+ $this->params[ "remove_contacts" ] = "1";
71
+ } else if ( $remove == false && isset( $this->params[ "remove_contacts" ] ) ) {
72
+ unset( $this->params[ "remove_contacts" ] );
73
+ }
74
+
75
+ return $this;
76
+ }
77
+
78
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupEdit.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ /**
6
+ * Class GroupEdit
7
+ * @package SMSApi\Api\Action\Phonebook
8
+ * @deprecated use \SMSApi\Api\Action\Contacts\GroupEdit
9
+ */
10
+ class GroupEdit extends GroupAdd {
11
+
12
+ /**
13
+ * @deprecated since 1.0.0
14
+ * @param string $groupName group name
15
+ * @return $this
16
+ */
17
+ public function setGroup( $groupName ) {
18
+ $this->params[ "edit_group" ] = $groupName;
19
+ return $this;
20
+ }
21
+
22
+ /**
23
+ * Set edited group.
24
+ *
25
+ * @param string $groupName group name
26
+ * @return $this
27
+ */
28
+ public function filterByGroupName( $groupName ) {
29
+ $this->params[ "edit_group" ] = $groupName;
30
+ return $this;
31
+ }
32
+
33
+ /**
34
+ * Set new group name.
35
+ *
36
+ * @param string $groupName new group name
37
+ * @return $this
38
+ */
39
+ public function setName( $groupName ) {
40
+ $this->params[ "name" ] = $groupName;
41
+ return $this;
42
+ }
43
+
44
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupGet.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class GroupGet
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\GroupGet
12
+ */
13
+ class GroupGet extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return \SMSApi\Api\Response\GroupResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new \SMSApi\Api\Response\GroupResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
36
+ }
37
+
38
+ /**
39
+ * @deprecated since v1.0.0
40
+ * @param $groupName
41
+ * @return $this
42
+ */
43
+ public function setGroup( $groupName ) {
44
+ return $this->filterByGroupName($groupName);
45
+ }
46
+
47
+ /**
48
+ * Set group name to find.
49
+ *
50
+ * @param string $groupName group name
51
+ * @return $this
52
+ */
53
+ public function filterByGroupName( $groupName ) {
54
+ $this->params[ "get_group" ] = $groupName;
55
+ return $this;
56
+ }
57
+
58
+
59
+
60
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Phonebook/GroupList.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Phonebook;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Proxy\Uri;
7
+
8
+ /**
9
+ * Class GroupList
10
+ * @package SMSApi\Api\Action\Phonebook
11
+ * @deprecated use \SMSApi\Api\Action\Contacts\GroupList
12
+ */
13
+ class GroupList extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return \SMSApi\Api\Response\GroupsResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new \SMSApi\Api\Response\GroupsResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ $query .= "&list_groups=1";
36
+
37
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/phonebook.do", $query );
38
+ }
39
+
40
+ }
41
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/Add.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sender;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\CountableResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Add
11
+ * @package SMSApi\Api\Action\Sender
12
+ */
13
+ class Add extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return CountableResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new CountableResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sender.do", $query );
36
+ }
37
+
38
+ /**
39
+ * Set new sender name.
40
+ *
41
+ * @param string $senderName sender name
42
+ * @return $this
43
+ */
44
+ public function setName( $senderName ) {
45
+ $this->params[ "add" ] = $senderName;
46
+ return $this;
47
+ }
48
+
49
+ }
50
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/Delete.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sender;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\CountableResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Delete
11
+ * @package SMSApi\Api\Action\Sender
12
+ */
13
+ class Delete extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return CountableResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new CountableResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sender.do", $query );
36
+ }
37
+
38
+ /**
39
+ * Set filter by sender name.
40
+ *
41
+ * @param $senderName string Sender name do delete
42
+ * @return $this
43
+ */
44
+ public function filterBySenderName( $senderName ) {
45
+ $this->params[ "delete" ] = $senderName;
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * @deprecated since v1.0.0
51
+ */
52
+ public function setSender( $senderName ) {
53
+ return $this->filterBySenderName($senderName);
54
+ }
55
+
56
+ }
57
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/SenderDefault.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sender;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\RawResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class SenderDefault
11
+ * @package SMSApi\Api\Action\Sender
12
+ */
13
+ class SenderDefault extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return RawResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new RawResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sender.do", $query );
36
+ }
37
+
38
+ /**
39
+ * Set name of default sender name.
40
+ *
41
+ * @param string $senderName sender name
42
+ * @return $this
43
+ */
44
+ public function setSender( $senderName ) {
45
+ $this->params[ "default" ] = $senderName;
46
+ return $this;
47
+ }
48
+
49
+ }
50
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sender/SenderList.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sender;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\SendersResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class SenderList
11
+ * @package SMSApi\Api\Action\Sender
12
+ */
13
+ class SenderList extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return SendersResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new SendersResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ $query .= "&list=1";
36
+
37
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sender.do", $query );
38
+ }
39
+
40
+ }
41
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sms/Delete.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\CountableResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Delete
11
+ * @package SMSApi\Api\Action\Sms
12
+ *
13
+ * @method CountableResponse execute()
14
+ */
15
+ class Delete extends AbstractAction
16
+ {
17
+ /**
18
+ * @var int
19
+ */
20
+ private $id;
21
+
22
+ /**
23
+ * @param $data
24
+ * @return CountableResponse
25
+ */
26
+ protected function response($data)
27
+ {
28
+ return new CountableResponse($data);
29
+ }
30
+
31
+ /**
32
+ * @return Uri
33
+ */
34
+ public function uri() {
35
+
36
+ $query = "";
37
+
38
+ $query .= $this->paramsLoginToQuery();
39
+
40
+ $query .= $this->paramsOther();
41
+
42
+ $query .= "&sch_del=" . $this->id;
43
+
44
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sms.do", $query );
45
+ }
46
+
47
+
48
+ /**
49
+ * Set ID of message to delete.
50
+ *
51
+ * This id was returned after sending message.
52
+ *
53
+ * @param $id
54
+ * @return $this
55
+ * @throws \SMSApi\Exception\ActionException
56
+ */
57
+ public function filterById( $id ) {
58
+ $this->id = $id;
59
+ return $this;
60
+ }
61
+
62
+ /**
63
+ * @deprecated since v1.0.0
64
+ *
65
+ * @param $id
66
+ * @return $this
67
+ */
68
+ public function id( $id ) {
69
+ return $this->filterById($id);
70
+ }
71
+
72
+ }
73
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sms/Get.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\StatusResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Get
11
+ *
12
+ * @package SMSApi\Api\Action\Sms
13
+ *
14
+ * @method StatusResponse execute()
15
+ */
16
+ class Get extends AbstractAction
17
+ {
18
+ /**
19
+ * @var \ArrayObject
20
+ */
21
+ private $id;
22
+
23
+ /**
24
+ *
25
+ */
26
+ function __construct() {
27
+ $this->id = new \ArrayObject();
28
+ }
29
+
30
+ /**
31
+ * @param $data
32
+ * @return StatusResponse
33
+ */
34
+ protected function response($data)
35
+ {
36
+ return new StatusResponse($data);
37
+ }
38
+
39
+ /**
40
+ * @return Uri
41
+ */
42
+ public function uri() {
43
+
44
+ $query = "";
45
+
46
+ $query .= $this->paramsLoginToQuery();
47
+
48
+ $query .= $this->paramsOther();
49
+
50
+ $query .= "&status=" . implode( "|", $this->id->getArrayCopy() );
51
+
52
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sms.do", $query );
53
+ }
54
+
55
+ /**
56
+ * Set ID of message to check.
57
+ *
58
+ * This id was returned after sending message.
59
+ *
60
+ * @param $id
61
+ * @return $this
62
+ * @throws \SMSApi\Exception\ActionException
63
+ */
64
+ public function filterById( $id ) {
65
+ $this->id->append( $id );
66
+ return $this;
67
+ }
68
+
69
+ /**
70
+ * Set IDs of messages to check.
71
+ *
72
+ * This id was returned after sending message.
73
+ *
74
+ * @param array $ids Message ids
75
+ * @return $this
76
+ */
77
+ public function filterByIds( array $ids ) {
78
+ $this->id->exchangeArray( $ids );
79
+ return $this;
80
+ }
81
+
82
+ /**
83
+ * @deprecated since v1.0.0
84
+ * @param array $ids
85
+ * @return $this
86
+ */
87
+ public function ids( array $ids ) {
88
+ return $this->filterByIds( $ids );
89
+ }
90
+
91
+ /**
92
+ * @deprecated since v1.0.0
93
+ * @param $id
94
+ * @return $this
95
+ */
96
+ public function id( $id ) {
97
+ return $this->filterById($id);
98
+ }
99
+
100
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Sms/Send.php ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Sms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\StatusResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Send
11
+ * @package SMSApi\Api\Action\Sms
12
+ *
13
+ * @method StatusResponse execute()
14
+ */
15
+ class Send extends AbstractAction
16
+ {
17
+ /**
18
+ * @var string
19
+ */
20
+ protected $encoding = 'utf-8';
21
+
22
+ /**
23
+ * @param $data
24
+ * @return StatusResponse
25
+ */
26
+ protected function response($data)
27
+ {
28
+ return new StatusResponse($data);
29
+ }
30
+
31
+ /**
32
+ * @return Uri
33
+ * @throws \SMSApi\Exception\ActionException
34
+ */
35
+ public function uri() {
36
+
37
+ $query = "";
38
+
39
+ $query .= $this->paramsLoginToQuery();
40
+
41
+ $query .= $this->paramsBasicToQuery();
42
+
43
+ $query .= $this->paramsOther();
44
+
45
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/sms.do", $query );
46
+ }
47
+
48
+ /**
49
+ * Set SMS text message.
50
+ *
51
+ * Content of one message is normally 160 characters per single
52
+ * SMS or 70 in case of using at least one special character
53
+ *
54
+ * @param $text
55
+ * @return $this
56
+ */
57
+ public function setText( $text ) {
58
+ $this->params[ 'message' ] = urlencode( $text );
59
+ return $this;
60
+ }
61
+
62
+ /**
63
+ * Set the SMS encoding charset, default is UTF-8.
64
+ *
65
+ * Example:
66
+ * windows-1250
67
+ * iso-8859-2
68
+ *
69
+ * @param string $encoding
70
+ * @return $this
71
+ */
72
+ public function setEncoding( $encoding ) {
73
+ $this->encoding = $encoding;
74
+ return $this;
75
+ }
76
+
77
+
78
+ /**
79
+ * Set mobile phone number of the recipients.
80
+ *
81
+ * @param string|array|int $to Phone number recipient/s.
82
+ * @return $this
83
+ */
84
+ public function setTo( $to ) {
85
+
86
+ if ( !is_array( $to ) ) {
87
+ $to = array( $to );
88
+ }
89
+
90
+ $this->to->exchangeArray( $to );
91
+ return $this;
92
+ }
93
+
94
+ /**
95
+ * Set name of the group from the phone book to which message should be sent.
96
+ *
97
+ * @param string $group String group name
98
+ * @return $this
99
+ */
100
+ public function setGroup( $group ) {
101
+ $this->group = $group;
102
+ return $this;
103
+ }
104
+
105
+ /**
106
+ * Set scheduled date sending message.
107
+ *
108
+ * Setting a past date will result in sending message instantly.
109
+ *
110
+ * @param mixed $date set timestamp or ISO 8601 date format
111
+ * @return $this
112
+ */
113
+ public function setDateSent( $date ) {
114
+ $this->date = $date;
115
+ return $this;
116
+ }
117
+
118
+ /**
119
+ * Set optional custom value sent with SMS and sent back in CALLBACK.
120
+ *
121
+ * @param string|array $idx
122
+ * @return $this
123
+ */
124
+ public function setIDx( $idx ) {
125
+ if ( !is_array( $idx ) ) {
126
+ $idx = array( $idx );
127
+ }
128
+
129
+ $this->idx->exchangeArray( $idx );
130
+ return $this;
131
+ }
132
+
133
+ /**
134
+ * Set checking idx is unique.
135
+ *
136
+ * Prevents from sending more than one message with the same idx.
137
+ * When this parameter is set and message with the same idx was
138
+ * already sent error 53 is returned.
139
+ *
140
+ * @param bool $check
141
+ * @return $this
142
+ */
143
+ public function setCheckIDx( $check ) {
144
+ if ( $check == true ) {
145
+ $this->params[ "check_idx" ] = "1";
146
+ } else if ( $check == false ) {
147
+ $this->params[ "check_idx" ] = "0";
148
+ }
149
+
150
+ return $this;
151
+ }
152
+
153
+ /**
154
+ * Set affiliate code.
155
+ *
156
+ * @param string $partner affiliate code
157
+ * @return $this
158
+ */
159
+ public function setPartner( $partner ) {
160
+ $this->params[ "partner_id" ] = $partner;
161
+ return $this;
162
+ }
163
+
164
+ /**
165
+ *
166
+ * Set expiration date.
167
+ *
168
+ * Message expiration date (in unix timestamp) is a date after which message won't be
169
+ * delivered if it wasn't delivered yet. The difference between date sent and expiration
170
+ * date can't be less than 1 hour and more than 12 hours. Time will be set with
171
+ * tolerance +/- 5 minutes.
172
+ *
173
+ * @param int $date in timestamp
174
+ * @return $this
175
+ */
176
+ public function setDateExpire( $date ) {
177
+ $this->params[ "expiration_date" ] = $date;
178
+ return $this;
179
+ }
180
+
181
+ /**
182
+ * Set name of the sender.
183
+ *
184
+ * To send SMS as ECO use sender name `ECO`.
185
+ * To send SMS as 2Way use sender name `2Way`.
186
+ *
187
+ * Only verified names are being accepted.
188
+ *
189
+ * @param string $sender sender name or eco or 2way
190
+ * @return $this
191
+ */
192
+ public function setSender( $sender ) {
193
+ $this->params[ "from" ] = $sender;
194
+ return $this;
195
+ }
196
+
197
+ /**
198
+ * Set protection from send multipart messages.
199
+ *
200
+ * If the message will contain more than 160 chars (single message) it won't be
201
+ * sent and return error
202
+ *
203
+ * @param bool $single
204
+ * @return $this
205
+ */
206
+ public function setSingle( $single ) {
207
+ if ( $single == true ) {
208
+ $this->params[ "single" ] = "1";
209
+ } else if ( $single == false ) {
210
+ $this->params[ "single" ] = "0";
211
+ }
212
+
213
+ return $this;
214
+ }
215
+
216
+ /**
217
+ * Set protection from sending messages containing special characters.
218
+ *
219
+ * @param bool $noUnicode if true turn on protection
220
+ * @return $this
221
+ */
222
+ public function setNoUnicode( $noUnicode ) {
223
+ if ( $noUnicode == true ) {
224
+ $this->params[ "nounicode" ] = "1";
225
+ } else if ( $noUnicode == false ) {
226
+ $this->params[ "nounicode" ] = "0";
227
+ }
228
+
229
+ return $this;
230
+ }
231
+
232
+ /**
233
+ * Set SMS message data coding.
234
+ *
235
+ * This parameter allows to send WAP PUSH messages.
236
+ *
237
+ * Example: bin
238
+ *
239
+ * @param string $dataCoding
240
+ * @return $this
241
+ */
242
+ public function setDataCoding( $dataCoding ) {
243
+ $this->params[ "datacoding" ] = $dataCoding;
244
+ return $this;
245
+ }
246
+
247
+ /**
248
+ * Set SMS message in flash mode.
249
+ *
250
+ * Flash SMS are automatically presented on the mobile screen and
251
+ * have to be saved to be default stored in inbox.
252
+ *
253
+ * @param bool $flash
254
+ * @return $this
255
+ */
256
+ public function setFlash( $flash ) {
257
+ if ( $flash == true ) {
258
+ $this->params[ "flash" ] = "1";
259
+ } else if ( $flash == false && isset( $this->params[ "flash" ] ) ) {
260
+ unset( $this->params[ "flash" ] );
261
+ }
262
+
263
+ return $this;
264
+ }
265
+
266
+ /**
267
+ * Set normalize SMS text.
268
+ *
269
+ * Removing dialectic characters from message.
270
+ *
271
+ * @param bool $normalize
272
+ * @return $this
273
+ */
274
+ public function setNormalize( $normalize ) {
275
+
276
+ if ( $normalize == true ) {
277
+ $this->params[ "normalize" ] = "1";
278
+ } else if ( $normalize == false && isset( $this->params[ "normalize" ] ) ) {
279
+ unset( $this->params[ "normalize" ] );
280
+ }
281
+
282
+ return $this;
283
+ }
284
+
285
+ /**
286
+ * Set higher priority of sending message.
287
+ * Prohibited for bulk messages.
288
+ *
289
+ * @param bool $fast if true set higher priority otherwise normal priority
290
+ * @return $this
291
+ */
292
+ public function setFast( $fast ) {
293
+ if ( $fast == true ) {
294
+ $this->params[ "fast" ] = "1";
295
+ } else if ( $fast == false && isset( $this->params[ "fast" ] ) ) {
296
+ unset( $this->params[ "fast" ] );
297
+ }
298
+
299
+ return $this;
300
+ }
301
+
302
+ /**
303
+ * Set personalized parameters to bulk messages.
304
+ *
305
+ * @param int $i
306
+ * @param string|string[] $text
307
+ * @return $this
308
+ * @throws \OutOfRangeException
309
+ */
310
+ public function SetParam($i, $text) {
311
+
312
+ if ( $i > 3 || $i < 0 ) {
313
+ throw new \OutOfRangeException;
314
+ }
315
+
316
+ $value = is_array($text) ? implode('|', $text) : $text;
317
+ $this->params['param'.($i+1)] = urlencode( $value );
318
+
319
+ return $this;
320
+ }
321
+
322
+ /**
323
+ * Set template
324
+ * @param $name
325
+ * @return $this
326
+ */
327
+ public function setTemplate($name)
328
+ {
329
+ $this->params['template'] = urlencode($name);
330
+
331
+ return $this;
332
+ }
333
+
334
+ /**
335
+ * Return detailed information
336
+ * @param bool $details
337
+ * @return $this
338
+ */
339
+ public function setDetails($details)
340
+ {
341
+ if ($details) {
342
+ $this->params['details'] = 1;
343
+ } else {
344
+ unset($this->params['details']);
345
+ }
346
+
347
+ return $this;
348
+ }
349
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/Add.php ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\User;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\UserResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Add
11
+ * @package SMSApi\Api\Action\User
12
+ */
13
+ class Add extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return UserResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new UserResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/user.do", $query );
36
+ }
37
+
38
+ /**
39
+ * New account user name.
40
+ *
41
+ * @param string $username account name
42
+ * @return $this
43
+ */
44
+ public function setUsername( $username ) {
45
+ $this->params[ "add_user" ] = $username;
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * Set account password encoded md5 algorithm.
51
+ *
52
+ * @param string $password password encoded md5
53
+ * @return $this
54
+ */
55
+ public function setPassword( $password ) {
56
+ $this->params[ "pass" ] = $password;
57
+ return $this;
58
+ }
59
+
60
+ /**
61
+ * Set account api password hashed with md5.
62
+ *
63
+ * @param string $password password api encoded md5
64
+ * @return $this
65
+ */
66
+ public function setPasswordApi( $password ) {
67
+ $this->params[ "pass_api" ] = $password;
68
+ return $this;
69
+ }
70
+
71
+ /**
72
+ * Set credit limit granted to account.
73
+ *
74
+ * @param number $limit limit
75
+ * @return $this
76
+ */
77
+ public function setLimit( $limit ) {
78
+ $this->params[ "limit" ] = $limit;
79
+ return $this;
80
+ }
81
+
82
+ /**
83
+ * Set month credits, the amount that will be granted 1st day of every month.
84
+ *
85
+ * @param number $limit limit number
86
+ * @return $this
87
+ */
88
+ public function setMonthLimit( $limit ) {
89
+ $this->params[ "month_limit" ] = $limit;
90
+ return $this;
91
+ }
92
+
93
+ /**
94
+ * Set access to main account sender names.
95
+ *
96
+ * @param bool $access if true access is granted
97
+ * @return $this
98
+ */
99
+ public function setFullAccessSenderNames( $access ) {
100
+ if ( $access == true ) {
101
+ $this->params[ "senders" ] = "1";
102
+ } else if ( $access == false ) {
103
+ $this->params[ "senders" ] = "0";
104
+ }
105
+
106
+ return $this;
107
+ }
108
+
109
+ /**
110
+ * @deprecated since v1.0.0 use SMSApi\Api\Action\User\Add::setFullAccessSenderNames
111
+ */
112
+ public function setSenders( $access ) {
113
+ return $this->setFullAccessSenderNames($access);
114
+ }
115
+
116
+ /**
117
+ * Set access to main account phonebook contacts.
118
+ *
119
+ * @param bool $access
120
+ * @return $this
121
+ */
122
+
123
+ public function setFullAccessPhoneBook( $access ) {
124
+
125
+ if ( $access == true ) {
126
+ $this->params[ "phonebook" ] = "1";
127
+ } else if ( $access == false ) {
128
+ $this->params[ "phonebook" ] = "0";
129
+ }
130
+
131
+ return $this;
132
+ }
133
+
134
+
135
+ /**
136
+ * @deprecated since v1.0.0 use SMSApi\Api\Action\User\Add::setFullAccessPhoneBook
137
+ */
138
+ public function setPhonebook( $access )
139
+ {
140
+ return $this->setFullAccessPhoneBook($access);
141
+ }
142
+
143
+ /**
144
+ * Set account active status.
145
+ *
146
+ * @param bool $val if true set account enable otherwise disabled
147
+ * @return $this
148
+ */
149
+ public function setActive( $val ) {
150
+
151
+ if ( $val == true ) {
152
+ $this->params[ "active" ] = "1";
153
+ } else if ( $val == false ) {
154
+ $this->params[ "active" ] = "0";
155
+ }
156
+
157
+ return $this;
158
+ }
159
+
160
+ /**
161
+ * Set additional account description.
162
+ *
163
+ * @param string $info description
164
+ * @return $this
165
+ */
166
+ public function setInfo( $info ) {
167
+ $this->params[ "info" ] = $info;
168
+ return $this;
169
+ }
170
+
171
+ }
172
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/Edit.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\User;
4
+
5
+ /**
6
+ * Class Edit
7
+ * @package SMSApi\Api\Action\User
8
+ */
9
+ class Edit extends Add {
10
+
11
+ /**
12
+ * @deprecated since v1.0.0 use User::filterByUsername
13
+ * @param $username
14
+ * @return $this
15
+ */
16
+ public function setUsername( $username ) {
17
+ $this->params[ "set_user" ] = $username;
18
+ return $this;
19
+ }
20
+
21
+ /**
22
+ * Set username to edit account.
23
+ *
24
+ * @param string $username user name to edit
25
+ * @return $this
26
+ */
27
+ public function filterByUsername( $username ) {
28
+ $this->params[ "set_user" ] = $username;
29
+ return $this;
30
+ }
31
+
32
+ }
33
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/Get.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\User;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\UserResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Get
11
+ * @package SMSApi\Api\Action\User
12
+ */
13
+ class Get extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return UserResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new UserResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/user.do", $query );
36
+ }
37
+
38
+ /**
39
+ * @deprecated since v1.0.0
40
+ * @param $username
41
+ * @return $this
42
+ */
43
+ public function setUsername( $username ) {
44
+ $this->params[ "get_user" ] = $username;
45
+ return $this;
46
+ }
47
+
48
+ /**
49
+ * Set username to edit account.
50
+ *
51
+ * @param string $username username
52
+ * @return $this
53
+ */
54
+ public function filterByUserName( $username ) {
55
+ $this->params[ "get_user" ] = $username;
56
+ return $this;
57
+ }
58
+
59
+ }
60
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/GetPoints.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\User;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\PointsResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class GetPoints
11
+ *
12
+ * @package SMSApi\Api\Action\User
13
+ *
14
+ * @method PointsResponse|null execute() execute()
15
+ */
16
+ class GetPoints extends AbstractAction {
17
+
18
+ /**
19
+ * @param $data
20
+ * @return PointsResponse
21
+ */
22
+ protected function response( $data ) {
23
+
24
+ return new PointsResponse( $data );
25
+ }
26
+
27
+ /**
28
+ * @return Uri
29
+ */
30
+ public function uri() {
31
+
32
+ $query = "";
33
+
34
+ $query .= $this->paramsLoginToQuery();
35
+
36
+ $query .= $this->paramsOther();
37
+
38
+ $query .= "&credits=1";
39
+
40
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/user.do", $query );
41
+ }
42
+
43
+ /**
44
+ * Return detailed information
45
+ * @param bool $details
46
+ * @return $this
47
+ */
48
+ public function setDetails($details)
49
+ {
50
+ if ($details) {
51
+ $this->params['details'] = 1;
52
+ } else {
53
+ unset($this->params['details']);
54
+ }
55
+
56
+ return $this;
57
+ }
58
+ }
59
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/User/UserList.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\User;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\UsersResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class UserList
11
+ * @package SMSApi\Api\Action\User
12
+ */
13
+ class UserList extends AbstractAction {
14
+
15
+ /**
16
+ * @param $data
17
+ * @return UsersResponse
18
+ */
19
+ protected function response( $data ) {
20
+
21
+ return new UsersResponse( $data );
22
+ }
23
+
24
+ /**
25
+ * @return Uri
26
+ */
27
+ public function uri() {
28
+
29
+ $query = "";
30
+
31
+ $query .= $this->paramsLoginToQuery();
32
+
33
+ $query .= $this->paramsOther();
34
+
35
+ $query .= "&list=1";
36
+
37
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/user.do", $query );
38
+ }
39
+
40
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Vms/Delete.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Vms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\CountableResponse;
7
+ use SMSApi\Exception\ActionException;
8
+ use SMSApi\Proxy\Uri;
9
+
10
+ /**
11
+ * Class Delete
12
+ * @package SMSApi\Api\Action\Vms
13
+ *
14
+ * @method CountableResponse execute()
15
+ */
16
+ class Delete extends AbstractAction
17
+ {
18
+ /**
19
+ * @var \ArrayObject
20
+ */
21
+ private $id;
22
+
23
+ /**
24
+ *
25
+ */
26
+ function __construct() {
27
+ $this->id = new \ArrayObject();
28
+ }
29
+
30
+ /**
31
+ * @param $data
32
+ * @return CountableResponse
33
+ */
34
+ protected function response($data)
35
+ {
36
+ return new CountableResponse($data);
37
+ }
38
+
39
+ /**
40
+ * @return Uri
41
+ */
42
+ public function uri() {
43
+
44
+ $query = "";
45
+
46
+ $query .= $this->paramsLoginToQuery();
47
+
48
+ $query .= $this->paramsOther();
49
+
50
+ $query .= "&sch_del=" . implode(",", $this->id->getArrayCopy());
51
+
52
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/vms.do", $query );
53
+ }
54
+
55
+ /**
56
+ * Set ID of messages to delete.
57
+ *
58
+ * This id was returned after sending message.
59
+ *
60
+ * @param $id
61
+ * @return $this
62
+ * @throws ActionException
63
+ */
64
+ public function filterById( $id ) {
65
+ if ( !is_string( $id ) ) {
66
+ throw new ActionException( 'Invalid value id' );
67
+ }
68
+
69
+ $this->id->append( $id );
70
+ return $this;
71
+ }
72
+
73
+ /**
74
+ *
75
+ * Set array IDs of messages to delete.
76
+ *
77
+ * This id was returned after sending message.
78
+ *
79
+ * @param $ids
80
+ * @return $this
81
+ * @throws \SMSApi\Exception\ActionException
82
+ */
83
+ public function filterByIds( array $ids ) {
84
+
85
+ $this->id->exchangeArray( $ids );
86
+ return $this;
87
+ }
88
+
89
+ /**
90
+ * @deprecated since v1.0.0
91
+ * @param $array
92
+ * @return Delete
93
+ */
94
+ public function ids($array) {
95
+ return $this->filterByIds($array);
96
+ }
97
+
98
+ /**
99
+ * @deprecated since v1.0.0
100
+ * @param $id
101
+ * @return Delete
102
+ * @throws ActionException
103
+ */
104
+ public function id($id) {
105
+ return $this->filterById($id);
106
+ }
107
+
108
+ }
109
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Vms/Get.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Vms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\StatusResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Get
11
+ * @package SMSApi\Api\Action\Vms
12
+ *
13
+ * @method StatusResponse execute()
14
+ */
15
+ class Get extends AbstractAction
16
+ {
17
+ /**
18
+ * @var \ArrayObject
19
+ */
20
+ private $id;
21
+
22
+ /**
23
+ *
24
+ */
25
+ function __construct() {
26
+ $this->id = new \ArrayObject();
27
+ }
28
+
29
+ /**
30
+ * @param $data
31
+ * @return \SMSApi\Api\Response\StatusResponse
32
+ */
33
+ protected function response($data)
34
+ {
35
+ return new StatusResponse($data);
36
+ }
37
+
38
+ /**
39
+ * @return Uri
40
+ */
41
+ public function uri() {
42
+
43
+ $query = "";
44
+
45
+ $query .= $this->paramsLoginToQuery();
46
+
47
+ $query .= $this->paramsOther();
48
+
49
+ $query .= "&status=" . implode( "|", $this->id->getArrayCopy() );
50
+
51
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/vms.do", $query );
52
+ }
53
+
54
+ /**
55
+ * Set ID of messages to check.
56
+ *
57
+ * This id was returned after sending message.
58
+ *
59
+ * @param $id
60
+ * @return $this
61
+ * @throws \SMSApi\Exception\ActionException
62
+ */
63
+ public function filterById( $id ) {
64
+
65
+ $this->id->append( $id );
66
+ return $this;
67
+ }
68
+
69
+ /**
70
+ * Set IDs of messages to check.
71
+ *
72
+ * This id was returned after sending message.
73
+ *
74
+ * @param array $ids
75
+ * @return $this
76
+ * @throws \SMSApi\Exception\ActionException
77
+ */
78
+ public function filterByIds( array $ids ) {
79
+
80
+ $this->id->exchangeArray( $ids );
81
+ return $this;
82
+ }
83
+
84
+ /**
85
+ * @deprecated since v1.0.0
86
+ * @param $array
87
+ * @return Get
88
+ */
89
+ public function ids($array) {
90
+ return $this->filterByIds($array);
91
+ }
92
+
93
+ /**
94
+ * @deprecated since v1.0.0
95
+ * @param $id
96
+ * @return Get
97
+ */
98
+ public function id($id) {
99
+ return $this->filterById($id);
100
+ }
101
+
102
+
103
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Action/Vms/Send.php ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Action\Vms;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Api\Response\StatusResponse;
7
+ use SMSApi\Proxy\Uri;
8
+
9
+ /**
10
+ * Class Send
11
+ * @package SMSApi\Api\Action\Vms
12
+ *
13
+ * @method StatusResponse execute()
14
+ */
15
+ class Send extends AbstractAction
16
+ {
17
+ const LECTOR_AGNIESZKA = "agnieszka";
18
+ const LECTOR_EWA = "ewa";
19
+ const LECTOR_JACEK = "jacek";
20
+ const LECTOR_JAN = "jan";
21
+ const LECTOR_MAJA = "maja";
22
+
23
+ /**
24
+ * @var
25
+ */
26
+ private $tts;
27
+
28
+ /**
29
+ * @var
30
+ */
31
+ private $file;
32
+
33
+ /**
34
+ * @param $data
35
+ * @return StatusResponse
36
+ */
37
+ protected function response($data)
38
+ {
39
+ return new StatusResponse($data);
40
+ }
41
+
42
+ /**
43
+ * @return Uri
44
+ * @throws \SMSApi\Exception\ActionException
45
+ */
46
+ public function uri() {
47
+
48
+ $query = "";
49
+
50
+ $query .= $this->paramsLoginToQuery();
51
+
52
+ $query .= $this->paramsBasicToQuery();
53
+
54
+ $query .= $this->paramsOther();
55
+
56
+ if ( empty( $this->file ) && $this->tts != null ) {
57
+ $query .= "&tts=" . $this->tts;
58
+ }
59
+
60
+ return new Uri( $this->proxy->getProtocol(), $this->proxy->getHost(), $this->proxy->getPort(), "/api/vms.do", $query );
61
+ }
62
+
63
+ /**
64
+ * @return mixed
65
+ */
66
+ public function file() {
67
+ return $this->file;
68
+ }
69
+
70
+ /**
71
+ * Set mobile phone number of the recipients.
72
+ *
73
+ * @param $to array|string phone number
74
+ * @return $this
75
+ */
76
+ public function setTo( $to ) {
77
+
78
+ if ( !is_array( $to ) ) {
79
+ $to = array( $to );
80
+ }
81
+
82
+ $this->to->exchangeArray( $to );
83
+ return $this;
84
+ }
85
+
86
+ /**
87
+ * Set name of the group from the phone book to which message should be sent.
88
+ *
89
+ * @param string $group group name
90
+ * @return $this
91
+ */
92
+ public function setGroup( $group ) {
93
+ $this->group = $group;
94
+ return $this;
95
+ }
96
+
97
+ /**
98
+ * Set scheduled date sending message.
99
+ *
100
+ * Setting a past date will result in sending message instantly.
101
+ *
102
+ * @param $date
103
+ * @return $this
104
+ */
105
+ public function setDateSent( $date ) {
106
+ $this->date = $date;
107
+ return $this;
108
+ }
109
+
110
+ /**
111
+ * Set optional custom value sent with SMS and sent back in CALLBACK.
112
+ *
113
+ * @param string|array $idx
114
+ * @return $this
115
+ */
116
+ public function setIDx( $idx ) {
117
+ if ( !is_array( $idx ) ) {
118
+ $idx = array( $idx );
119
+ }
120
+
121
+ $this->idx->exchangeArray( $idx );
122
+ return $this;
123
+ }
124
+
125
+ /**
126
+ * Set checking idx is unique.
127
+ *
128
+ * Prevents from sending more than one message with the same idx.
129
+ * When this parameter is set and message with the same idx was
130
+ * already sent error 53 is returned.
131
+ *
132
+ * @param bool $check
133
+ * @return $this
134
+ */
135
+ public function setCheckIDx( $check ) {
136
+ if ( $check == true ) {
137
+ $this->params[ "check_idx" ] = "1";
138
+ } else if ( $check == false ) {
139
+ $this->params[ "check_idx" ] = "0";
140
+ }
141
+
142
+ return $this;
143
+ }
144
+
145
+ /**
146
+ * Set affiliate code.
147
+ *
148
+ * @param string $partner affiliate code
149
+ * @return $this
150
+ */
151
+ public function setPartner( $partner ) {
152
+ $this->params[ "partner_id" ] = $partner;
153
+ return $this;
154
+ }
155
+
156
+ /**
157
+ * Set local audio filename.
158
+ *
159
+ * @param $file
160
+ * @return $this
161
+ */
162
+ public function setFile( $file ) {
163
+ $this->file = $file;
164
+ return $this;
165
+ }
166
+
167
+ /**
168
+ * Set text to voice synthesizer.
169
+ *
170
+ * @param string $tts text to read
171
+ * @return $this
172
+ */
173
+ public function setTts( $tts ) {
174
+ $this->tts = $tts;
175
+ return $this;
176
+ }
177
+
178
+ /**
179
+ * Set flag to not send messages on cell phone numbers.
180
+ *
181
+ * @param $skipGsm
182
+ * @return $this
183
+ */
184
+ public function setSkipGsm( $skipGsm ) {
185
+
186
+ if ( $skipGsm == true ) {
187
+ $this->params[ "skip_gsm" ] = "1";
188
+ } else if ( $skipGsm == false && isset( $this->params[ "skip_gsm" ] ) ) {
189
+ unset( $this->params[ "skip_gsm" ] );
190
+ }
191
+
192
+ return $this;
193
+ }
194
+
195
+ /**
196
+ * Set lector name.
197
+ *
198
+ * @param string $lector The value of $lector can be: agnieszka, ewa, jacek, jan or maja
199
+ * @return $this
200
+ */
201
+ public function setTtsLector( $lector ) {
202
+ $this->params[ "tts_lector" ] = $lector;
203
+ return $this;
204
+ }
205
+
206
+ /**
207
+ * Set called number. Leaving the field blank causes the sending of the default number of callers.
208
+ *
209
+ * @param $from
210
+ * @return $this
211
+ */
212
+ public function setFrom( $from ) {
213
+ $this->params[ "from" ] = $from;
214
+ return $this;
215
+ }
216
+
217
+ /**
218
+ * Set number of connection attempts.
219
+ *
220
+ * @param integer $try Number of connection attempts
221
+ * @return $this
222
+ * @throws \OutOfRangeException
223
+ */
224
+ public function setTry($try)
225
+ {
226
+ if($try < 1 || $try > 6) {
227
+ throw new \OutOfRangeException;
228
+ }
229
+
230
+ $this->params['try'] = $try;
231
+ return $this;
232
+ }
233
+
234
+ /**
235
+ * Set the time in seconds where the connection have to be repeated
236
+ * in the case of not answer by receiver or reject this connection.
237
+ *
238
+ * @param integer $interval Time in seconds
239
+ *
240
+ * @return $this
241
+ * @throws \OutOfRangeException
242
+ */
243
+ public function setInterval($interval)
244
+ {
245
+ if($interval < 300 || $interval > 7200) {
246
+ throw new \OutOfRangeException;
247
+ }
248
+
249
+ $this->params['interval'] = $interval;
250
+ return $this;
251
+ }
252
+
253
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/ActionFactory.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ use SMSApi\Proxy\Http\Native;
6
+
7
+ /**
8
+ * Class ActionFactory
9
+ * @package SMSApi\Api
10
+ */
11
+ abstract class ActionFactory {
12
+
13
+ /**
14
+ * @var \SMSApi\Client
15
+ */
16
+ protected $client = null;
17
+
18
+ /**
19
+ * @var \SMSApi\Proxy\Proxy
20
+ */
21
+ protected $proxy = null;
22
+
23
+ /**
24
+ * @param null $proxy
25
+ * @param null $client
26
+ */
27
+ public function __construct( $proxy = null, $client = null ) {
28
+
29
+ if ( $proxy instanceof \SMSApi\Proxy\Proxy ) {
30
+ $this->setProxy( $proxy );
31
+ } else {
32
+ $this->setProxy(new Native('https://api.smsapi.pl'));
33
+ }
34
+
35
+ if ( $client instanceof \SMSApi\Client ) {
36
+ $this->setClient( $client );
37
+ }
38
+ }
39
+
40
+ /**
41
+ * @param \SMSApi\Client $client
42
+ * @return $this
43
+ */
44
+ public function setClient( \SMSApi\Client $client ) {
45
+ $this->client = $client;
46
+ return $this;
47
+ }
48
+
49
+ /**
50
+ * @param \SMSApi\Proxy\Proxy $proxy
51
+ * @return $this
52
+ */
53
+ public function setProxy( \SMSApi\Proxy\Proxy $proxy ) {
54
+ $this->proxy = $proxy;
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * @return \SMSApi\Client
60
+ */
61
+ public function getClient() {
62
+ return $this->client;
63
+ }
64
+
65
+ /**
66
+ * @return \SMSApi\Proxy\Proxy
67
+ */
68
+ public function getProxy() {
69
+ return $this->proxy;
70
+ }
71
+
72
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/ContactsFactory.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ use SMSApi\Api\Action\Contacts\ContactDeleteMultiple;
6
+ use SMSApi\Api\Action\Contacts\ContactAddByEmail;
7
+ use SMSApi\Api\Action\Contacts\ContactAddByPhoneNumber;
8
+ use SMSApi\Api\Action\Contacts\ContactCount;
9
+ use SMSApi\Api\Action\Contacts\ContactDelete;
10
+ use SMSApi\Api\Action\Contacts\ContactEdit;
11
+ use SMSApi\Api\Action\Contacts\ContactGet;
12
+ use SMSApi\Api\Action\Contacts\ContactGroupAdd;
13
+ use SMSApi\Api\Action\Contacts\ContactGroupDelete;
14
+ use SMSApi\Api\Action\Contacts\ContactGroupGet;
15
+ use SMSApi\Api\Action\Contacts\ContactGroupList;
16
+ use SMSApi\Api\Action\Contacts\ContactList;
17
+ use SMSApi\Api\Action\Contacts\FieldAdd;
18
+ use SMSApi\Api\Action\Contacts\FieldDelete;
19
+ use SMSApi\Api\Action\Contacts\FieldEdit;
20
+ use SMSApi\Api\Action\Contacts\FieldList;
21
+ use SMSApi\Api\Action\Contacts\GroupAdd;
22
+ use SMSApi\Api\Action\Contacts\GroupDelete;
23
+ use SMSApi\Api\Action\Contacts\GroupEdit;
24
+ use SMSApi\Api\Action\Contacts\GroupGet;
25
+ use SMSApi\Api\Action\Contacts\GroupList;
26
+ use SMSApi\Api\Action\Contacts\GroupMemberDelete;
27
+ use SMSApi\Api\Action\Contacts\GroupMemberAdd;
28
+ use SMSApi\Api\Action\Contacts\GroupMemberGet;
29
+ use SMSApi\Api\Action\Contacts\GroupPermissionAdd;
30
+ use SMSApi\Api\Action\Contacts\GroupPermissionDelete;
31
+ use SMSApi\Api\Action\Contacts\GroupPermissionEdit;
32
+ use SMSApi\Api\Action\Contacts\GroupPermissionGet;
33
+ use SMSApi\Api\Action\Contacts\GroupPermissionList;
34
+
35
+ final class ContactsFactory extends ActionFactory
36
+ {
37
+ public function actionContactList()
38
+ {
39
+ return new ContactList($this->client, $this->proxy);
40
+ }
41
+
42
+ public function actionContactCount()
43
+ {
44
+ return new ContactCount($this->client, $this->proxy);
45
+ }
46
+
47
+ public function actionContactGet($contactId)
48
+ {
49
+ return new ContactGet($contactId, $this->client, $this->proxy);
50
+ }
51
+
52
+ public function actionContactAddByEmail($email)
53
+ {
54
+ return new ContactAddByEmail($email, $this->client, $this->proxy);
55
+ }
56
+
57
+ /**
58
+ * @param $email
59
+ * @return ContactAddByEmail
60
+ * @deprecated use actionContactAddByEmail
61
+ */
62
+ public function actionContactAddFromEmail($email)
63
+ {
64
+ return new ContactAddByEmail($email, $this->client, $this->proxy);
65
+ }
66
+
67
+ public function actionContactAddByPhoneNumber($phoneNumber)
68
+ {
69
+ return new ContactAddByPhoneNumber($phoneNumber, $this->client, $this->proxy);
70
+ }
71
+
72
+ /**
73
+ * @param $phoneNumber
74
+ * @return ContactAddByPhoneNumber
75
+ * @deprecated use actionContactAddByPhoneNumber
76
+ */
77
+ public function actionContactAddFromPhoneNumber($phoneNumber)
78
+ {
79
+ return new ContactAddByPhoneNumber($phoneNumber, $this->client, $this->proxy);
80
+ }
81
+
82
+ public function actionContactEdit($contactId)
83
+ {
84
+ return new ContactEdit($contactId, $this->client, $this->proxy);
85
+ }
86
+
87
+ public function actionContactDelete($contactId)
88
+ {
89
+ return new ContactDelete($contactId, $this->client, $this->proxy);
90
+ }
91
+
92
+ public function actionContactDeleteMultiple()
93
+ {
94
+ return new ContactDeleteMultiple($this->client, $this->proxy);
95
+ }
96
+
97
+ public function actionContactGroupList($contactId)
98
+ {
99
+ return new ContactGroupList($contactId, $this->client, $this->proxy);
100
+ }
101
+
102
+ public function actionContactGroupGet($contactId, $groupId)
103
+ {
104
+ return new ContactGroupGet($contactId, $groupId, $this->client, $this->proxy);
105
+ }
106
+
107
+ public function actionContactGroupAdd($contactId, $groupId)
108
+ {
109
+ return new ContactGroupAdd($contactId, $groupId, $this->client, $this->proxy);
110
+ }
111
+
112
+ public function actionContactGroupDelete($contactId, $groupId)
113
+ {
114
+ return new ContactGroupDelete($contactId, $groupId, $this->client, $this->proxy);
115
+ }
116
+
117
+ public function actionGroupList()
118
+ {
119
+ return new GroupList($this->client, $this->proxy);
120
+ }
121
+
122
+ public function actionGroupGet($groupId)
123
+ {
124
+ return new GroupGet($groupId, $this->client, $this->proxy);
125
+ }
126
+
127
+ public function actionGroupAdd($groupName)
128
+ {
129
+ return new GroupAdd($groupName, $this->client, $this->proxy);
130
+ }
131
+
132
+ public function actionGroupEdit($groupId)
133
+ {
134
+ return new GroupEdit($groupId, $this->client, $this->proxy);
135
+ }
136
+
137
+ public function actionGroupDelete($groupId)
138
+ {
139
+ return new GroupDelete($groupId, $this->client, $this->proxy);
140
+ }
141
+
142
+ public function actionGroupPermissionList($groupId)
143
+ {
144
+ return new GroupPermissionList($groupId, $this->client, $this->proxy);
145
+ }
146
+
147
+ public function actionGroupPermissionGet($groupId, $username)
148
+ {
149
+ return new GroupPermissionGet($groupId, $username, $this->client, $this->proxy);
150
+ }
151
+
152
+ public function actionGroupPermissionAdd($groupId, $username)
153
+ {
154
+ return new GroupPermissionAdd($groupId, $username, $this->client, $this->proxy);
155
+ }
156
+
157
+ public function actionGroupPermissionEdit($groupId, $username)
158
+ {
159
+ return new GroupPermissionEdit($groupId, $username, $this->client, $this->proxy);
160
+ }
161
+
162
+ public function actionGroupPermissionDelete($groupId, $username)
163
+ {
164
+ return new GroupPermissionDelete($groupId, $username, $this->client, $this->proxy);
165
+ }
166
+
167
+ public function actionGroupMemberGet($groupId, $contactId)
168
+ {
169
+ return new GroupMemberGet($groupId, $contactId, $this->client, $this->proxy);
170
+ }
171
+
172
+ public function actionGroupMemberAdd($groupId, $contactId)
173
+ {
174
+ return new GroupMemberAdd($groupId, $contactId, $this->client, $this->proxy);
175
+ }
176
+
177
+ public function actionGroupMemberDelete($groupId, $contactId)
178
+ {
179
+ return new GroupMemberDelete($groupId, $contactId, $this->client, $this->proxy);
180
+ }
181
+ public function actionFieldList()
182
+ {
183
+ return new FieldList($this->client, $this->proxy);
184
+ }
185
+
186
+ public function actionFieldAdd($name)
187
+ {
188
+ return new FieldAdd($name, $this->client, $this->proxy);
189
+ }
190
+
191
+ public function actionFieldEdit($fieldId)
192
+ {
193
+ return new FieldEdit($fieldId, $this->client, $this->proxy);
194
+ }
195
+
196
+ public function actionFieldDelete($fieldId)
197
+ {
198
+ return new FieldDelete($fieldId, $this->client, $this->proxy);
199
+ }
200
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/MmsFactory.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ /**
6
+ * Class MmsFactory
7
+ * @package SMSApi\Api
8
+ */
9
+ class MmsFactory extends ActionFactory {
10
+
11
+ /**
12
+ * @return Action\Mms\Send
13
+ */
14
+ public function actionSend() {
15
+ $action = new \SMSApi\Api\Action\Mms\Send();
16
+ $action->client( $this->client );
17
+ $action->proxy( $this->proxy );
18
+
19
+ return $action;
20
+ }
21
+
22
+ /**
23
+ * @param null $id
24
+ * @return Action\Mms\Get
25
+ * @throws \SMSApi\Exception\ActionException
26
+ */
27
+ public function actionGet( $id = null ) {
28
+ $action = new \SMSApi\Api\Action\Mms\Get();
29
+ $action->client( $this->client );
30
+ $action->proxy( $this->proxy );
31
+
32
+ if ( !empty( $id ) && is_string( $id ) ) {
33
+ $action->filterById( $id );
34
+ } else if ( !empty( $id ) && is_array( $id ) ) {
35
+ $action->filterByIds( $id );
36
+ }
37
+
38
+ return $action;
39
+ }
40
+
41
+ /**
42
+ * @param null $id
43
+ * @return Action\Mms\Delete
44
+ * @throws \SMSApi\Exception\ActionException
45
+ */
46
+ public function actionDelete( $id = null ) {
47
+ $action = new \SMSApi\Api\Action\Mms\Delete();
48
+ $action->client( $this->client );
49
+ $action->proxy( $this->proxy );
50
+
51
+ if ( !empty( $id ) && is_string( $id ) ) {
52
+ $action->filterById( $id );
53
+ } else if ( !empty( $id ) && is_array( $id ) ) {
54
+ $action->filterByIds( $id );
55
+ }
56
+
57
+ return $action;
58
+ }
59
+
60
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/PhonebookFactory.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ /**
6
+ * Class PhonebookFactory
7
+ * @package SMSApi\Api
8
+ * @deprecated use ContactsFactory
9
+ */
10
+ class PhonebookFactory extends ActionFactory {
11
+
12
+ /**
13
+ * @return Action\Phonebook\GroupList
14
+ */
15
+ public function actionGroupList() {
16
+ $action = new \SMSApi\Api\Action\Phonebook\GroupList();
17
+ $action->client( $this->client );
18
+ $action->proxy( $this->proxy );
19
+
20
+ return $action;
21
+ }
22
+
23
+ /**
24
+ * @param null $groupName
25
+ * @return Action\Phonebook\GroupAdd
26
+ */
27
+ public function actionGroupAdd( $groupName = null ) {
28
+ $action = new \SMSApi\Api\Action\Phonebook\GroupAdd();
29
+ $action->client( $this->client );
30
+ $action->proxy( $this->proxy );
31
+
32
+ if ( !empty( $groupName ) ) {
33
+ $action->setName( $groupName );
34
+ }
35
+
36
+ return $action;
37
+ }
38
+
39
+ /**
40
+ * @param null $groupName
41
+ * @return Action\Phonebook\GroupEdit
42
+ */
43
+ public function actionGroupEdit( $groupName = null ) {
44
+ $action = new \SMSApi\Api\Action\Phonebook\GroupEdit();
45
+ $action->client( $this->client );
46
+ $action->proxy( $this->proxy );
47
+
48
+ if ( !empty( $groupName ) ) {
49
+ $action->filterByGroupName( $groupName );
50
+ }
51
+
52
+ return $action;
53
+ }
54
+
55
+ /**
56
+ * @param null $groupName
57
+ * @return Action\Phonebook\GroupGet
58
+ */
59
+ public function actionGroupGet( $groupName = null ) {
60
+ $action = new \SMSApi\Api\Action\Phonebook\GroupGet();
61
+ $action->client( $this->client );
62
+ $action->proxy( $this->proxy );
63
+
64
+ if ( !empty( $groupName ) ) {
65
+ $action->filterByGroupName( $groupName );
66
+ }
67
+
68
+ return $action;
69
+ }
70
+
71
+ /**
72
+ * @param null $groupName
73
+ * @return Action\Phonebook\GroupDelete
74
+ */
75
+ public function actionGroupDelete( $groupName = null ) {
76
+ $action = new \SMSApi\Api\Action\Phonebook\GroupDelete();
77
+ $action->client( $this->client );
78
+ $action->proxy( $this->proxy );
79
+
80
+ if ( !empty( $groupName ) ) {
81
+ $action->filterByGroupName( $groupName );
82
+ }
83
+
84
+ return $action;
85
+ }
86
+
87
+ /**
88
+ * @return Action\Phonebook\ContactList
89
+ */
90
+ public function actionContactList() {
91
+ $action = new \SMSApi\Api\Action\Phonebook\ContactList();
92
+ $action->client( $this->client );
93
+ $action->proxy( $this->proxy );
94
+
95
+ return $action;
96
+ }
97
+
98
+ /**
99
+ * @param null $number
100
+ * @return Action\Phonebook\ContactAdd
101
+ */
102
+ public function actionContactAdd( $number = null ) {
103
+ $action = new \SMSApi\Api\Action\Phonebook\ContactAdd();
104
+ $action->client( $this->client );
105
+ $action->proxy( $this->proxy );
106
+
107
+ if ( !empty( $number ) ) {
108
+ $action->setNumber( $number );
109
+ }
110
+
111
+ return $action;
112
+ }
113
+
114
+ /**
115
+ * @param null $number
116
+ * @return Action\Phonebook\ContactEdit
117
+ */
118
+ public function actionContactEdit( $number = null ) {
119
+ $action = new \SMSApi\Api\Action\Phonebook\ContactEdit();
120
+ $action->client( $this->client );
121
+ $action->proxy( $this->proxy );
122
+
123
+ if ( !empty( $number ) ) {
124
+ $action->filterByPhoneNumber( $number );
125
+ }
126
+
127
+ return $action;
128
+ }
129
+
130
+ /**
131
+ * @param null $number
132
+ * @return Action\Phonebook\ContactGet
133
+ */
134
+ public function actionContactGet( $number = null ) {
135
+ $action = new \SMSApi\Api\Action\Phonebook\ContactGet();
136
+ $action->client( $this->client );
137
+ $action->proxy( $this->proxy );
138
+
139
+ if ( !empty( $number ) ) {
140
+ $action->filterByPhoneNumber( $number );
141
+ }
142
+
143
+ return $action;
144
+ }
145
+
146
+ /**
147
+ * @param null $number
148
+ * @return Action\Phonebook\ContactDelete
149
+ */
150
+ public function actionContactDelete( $number = null ) {
151
+ $action = new \SMSApi\Api\Action\Phonebook\ContactDelete();
152
+ $action->client( $this->client );
153
+ $action->proxy( $this->proxy );
154
+
155
+ if ( !empty( $number ) ) {
156
+ $action->filterByPhoneNumber( $number );
157
+ }
158
+
159
+ return $action;
160
+ }
161
+
162
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/AbstractResponse.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class AbstractResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ abstract class AbstractResponse implements Response {
10
+
11
+ /**
12
+ * @var mixed
13
+ */
14
+ protected $obj;
15
+
16
+ /**
17
+ * @param $data
18
+ */
19
+ function __construct( $data ) {
20
+ $this->obj = $this->decode($data);
21
+ }
22
+
23
+ /**
24
+ * @param $string
25
+ * @return mixed
26
+ * @throws \SMSApi\Exception\SmsapiException
27
+ */
28
+ protected function decode($string) {
29
+
30
+ $result = json_decode($string);
31
+
32
+ if( $result === null ) {
33
+ throw new \SMSApi\Exception\SmsapiException("error json: ".json_last_error());
34
+ }
35
+
36
+ return $result;
37
+ }
38
+
39
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/ContactResponse.php ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ use SMSApi\Exception\InvalidParameterException;
6
+
7
+ /**
8
+ * Class ContactResponse
9
+ * @package SMSApi\Api\AbstractContactsResponse
10
+ * @deprecated use Contacts\ContactResponse
11
+ */
12
+ class ContactResponse extends AbstractResponse {
13
+
14
+ const GENDER_FEMALE = "female";
15
+ const GENDER_MALE = "male";
16
+
17
+ /**
18
+ * @var int
19
+ */
20
+ private $number;
21
+
22
+ /**
23
+ * @var string
24
+ */
25
+ private $firstName;
26
+
27
+ /**
28
+ * @var string
29
+ */
30
+ private $lastName;
31
+
32
+ /**
33
+ * @var string
34
+ */
35
+ private $info;
36
+
37
+ /**
38
+ * @var string
39
+ */
40
+ private $email;
41
+
42
+ /**
43
+ * @var string
44
+ */
45
+ private $birthday;
46
+
47
+ /**
48
+ * @var string
49
+ */
50
+ private $city;
51
+
52
+ /**
53
+ * @var string
54
+ */
55
+ private $gender;
56
+
57
+ /**
58
+ * @var int
59
+ */
60
+ private $dateAdd;
61
+
62
+ /**
63
+ * @var int
64
+ */
65
+ private $dateMod;
66
+
67
+ /**
68
+ * @var array
69
+ */
70
+ private $groups = null;
71
+
72
+ public function __construct( $data ) {
73
+
74
+ if ( is_object( $data ) ) {
75
+ $this->obj = $data;
76
+ } else if ( is_string( $data ) ) {
77
+ parent::__construct( $data );
78
+ }
79
+
80
+ if ( isset( $this->obj->number ) ) {
81
+ $this->number = $this->obj->number;
82
+ }
83
+
84
+ if ( isset( $this->obj->first_name ) ) {
85
+ $this->firstName = $this->obj->first_name;
86
+ }
87
+
88
+ if ( isset( $this->obj->last_name ) ) {
89
+ $this->lastName = $this->obj->last_name;
90
+ }
91
+
92
+ if ( isset( $this->obj->info ) ) {
93
+ $this->info = $this->obj->info;
94
+ }
95
+
96
+ if ( isset( $this->obj->birthday ) ) {
97
+ $this->birthday = $this->obj->birthday;
98
+ }
99
+
100
+ if ( isset( $this->obj->city ) ) {
101
+ $this->city = $this->obj->city;
102
+ }
103
+
104
+ if ( isset( $this->obj->gender ) ) {
105
+ $this->gender = $this->obj->gender;
106
+ }
107
+
108
+ if ( isset( $this->obj->date_add ) ) {
109
+ $this->dateAdd = $this->obj->date_add;
110
+ }
111
+
112
+ if ( isset( $this->obj->date_mod ) ) {
113
+ $this->dateMod = $this->obj->date_mod;
114
+ }
115
+
116
+ if (isset($this->obj->groups)) {
117
+ $this->groups = (array)$this->obj->groups;
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Returns phone number
123
+ *
124
+ * @return int
125
+ */
126
+ public function getNumber() {
127
+ return $this->number;
128
+ }
129
+
130
+ /**
131
+ * Returns contact first name
132
+ *
133
+ * @return string
134
+ */
135
+ public function getFirstName() {
136
+ return $this->firstName;
137
+ }
138
+
139
+ /**
140
+ * Returns contact last name
141
+ *
142
+ * @return string
143
+ */
144
+ public function getLastName() {
145
+ return $this->lastName;
146
+ }
147
+
148
+ /**
149
+ * Returns contact information text
150
+ *
151
+ * @return string
152
+ */
153
+ public function getInfo() {
154
+ return $this->info;
155
+ }
156
+
157
+ /**
158
+ * Returns contact e-mail address
159
+ *
160
+ * @return string Example: example@smsapi.pl
161
+ */
162
+ public function getEmail() {
163
+ return $this->email;
164
+ }
165
+
166
+ /**
167
+ * Returns contact birthday date
168
+ *
169
+ * @return string Example: 1974-1-14
170
+ */
171
+ public function getBirthday() {
172
+ return $this->birthday;
173
+ }
174
+
175
+ /**
176
+ * Returns contact city name
177
+ *
178
+ * @return string
179
+ */
180
+ public function getCity() {
181
+ return $this->city;
182
+ }
183
+
184
+ /**
185
+ * Returns contact gender
186
+ *
187
+ * @see \SMSApi\Api\Response\ContactResponse::GENDER_FEMALE
188
+ * @see \SMSApi\Api\Response\ContactResponse::GENDER_MALE
189
+ * @return string Example male or female
190
+ */
191
+ public function getGender() {
192
+ return $this->gender;
193
+ }
194
+
195
+ /**
196
+ * Returns create date in timestamp
197
+ *
198
+ * @return int date in timestamp
199
+ */
200
+ public function getDateAdd() {
201
+ return $this->dateAdd;
202
+ }
203
+
204
+ /**
205
+ * Returns modification date in timestamp
206
+ *
207
+ * @return int date in timestamp
208
+ */
209
+ public function getDateMod() {
210
+ return $this->dateMod;
211
+ }
212
+
213
+ /**
214
+ * Returns groups
215
+ *
216
+ * @throws InvalidParameterException
217
+ * @return array with group names
218
+ */
219
+ public function getGroups()
220
+ {
221
+
222
+ if ($this->groups === null) {
223
+ throw new InvalidParameterException('Use action \SMSApi\Api\Action\Phonebook\ContactGet::withGroups() method to load resources with groups');
224
+ }
225
+
226
+ return $this->groups;
227
+ }
228
+
229
+
230
+
231
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/AbstractContactsResponse.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ use SMSApi\Api\Response\Response;
6
+
7
+ abstract class AbstractContactsResponse implements Response
8
+ {
9
+ public static function fromJsonString($jsonString)
10
+ {
11
+ return new static(json_decode($jsonString, true));
12
+ }
13
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/ContactResponse.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ use DateTime;
6
+
7
+ final class ContactResponse extends AbstractContactsResponse implements IdentifiableResponse
8
+ {
9
+ const GENDER_UNDEFINED = 'undefined';
10
+ const GENDER_MALE = 'male';
11
+ const GENDER_FEMALE = 'female';
12
+
13
+ const FIELD_GENDER = 'gender';
14
+ const FIELD_PHONE_NUMBER = 'phone_number';
15
+ const FIELD_EMAIL = 'email';
16
+ const FIELD_FIRST_NAME = 'first_name';
17
+ const FIELD_LAST_NAME = 'last_name';
18
+ const FIELD_BIRTHDAY_DATE = 'birthday_date';
19
+ const FIELD_DESCRIPTION = 'description';
20
+ const FIELD_CITY = 'city';
21
+ const FIELD_SOURCE = 'source';
22
+
23
+ /** @var string */
24
+ private $id;
25
+
26
+ /** @var int|null */
27
+ private $phoneNumber;
28
+
29
+ /** @var string|null */
30
+ private $email;
31
+
32
+ /** @var string|null */
33
+ private $firstName;
34
+
35
+ /** @var string|null */
36
+ private $lastName;
37
+
38
+ /** @var string|null */
39
+ private $gender;
40
+
41
+ /** @var DateTime|null */
42
+ private $birthdayDate;
43
+
44
+ /** @var string|null */
45
+ private $description;
46
+
47
+ /** @var string|null */
48
+ private $city;
49
+
50
+ /** @var string|null */
51
+ private $source;
52
+
53
+ public function __construct(array $data)
54
+ {
55
+ $this->id = $data[self::FIELD_ID];
56
+ $this->phoneNumber = $data[self::FIELD_PHONE_NUMBER];
57
+ $this->email = $data[self::FIELD_EMAIL];
58
+ $this->firstName = $data[self::FIELD_FIRST_NAME];
59
+ $this->lastName = $data[self::FIELD_LAST_NAME];
60
+ $this->description = $data[self::FIELD_DESCRIPTION];
61
+ $this->city = $data[self::FIELD_CITY];
62
+ $this->source = $data[self::FIELD_SOURCE];
63
+ $this->gender = $data[self::FIELD_GENDER];
64
+
65
+ if ($data[self::FIELD_BIRTHDAY_DATE]) {
66
+ $this->birthdayDate = new DateTime($data[self::FIELD_BIRTHDAY_DATE]);
67
+ }
68
+ }
69
+
70
+ public function getId()
71
+ {
72
+ return $this->id;
73
+ }
74
+
75
+ public function getPhoneNumber()
76
+ {
77
+ return $this->phoneNumber;
78
+ }
79
+
80
+ public function getEmail()
81
+ {
82
+ return $this->email;
83
+ }
84
+
85
+ public function getFirstName()
86
+ {
87
+ return $this->firstName;
88
+ }
89
+
90
+ public function getLastName()
91
+ {
92
+ return $this->lastName;
93
+ }
94
+
95
+ public function getGender()
96
+ {
97
+ return $this->gender;
98
+ }
99
+
100
+ public function getBirthdayDate()
101
+ {
102
+ return $this->birthdayDate;
103
+ }
104
+
105
+ public function getDescription()
106
+ {
107
+ return $this->description;
108
+ }
109
+
110
+ public function getCity()
111
+ {
112
+ return $this->city;
113
+ }
114
+
115
+ public function getSource()
116
+ {
117
+ return $this->source;
118
+ }
119
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/ContactsResponse.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ /**
6
+ * @method ContactResponse[] getCollection()
7
+ */
8
+ final class ContactsResponse extends ListResponse
9
+ {
10
+ protected function createItem(array $item)
11
+ {
12
+ return new ContactResponse($item);
13
+ }
14
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/CountableResponse.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ interface CountableResponse
6
+ {
7
+ const FIELD_SIZE = 'size';
8
+
9
+ public function getSize();
10
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/DeleteResponse.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ use SMSApi\Api\Response\Response;
6
+
7
+ final class DeleteResponse implements Response
8
+ {
9
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/FieldResponse.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ final class FieldResponse extends AbstractContactsResponse implements IdentifiableResponse
6
+ {
7
+ const TYPE_TEXT = 'TEXT';
8
+ const TYPE_DATE = 'DATE';
9
+ const TYPE_EMAIL = 'EMAIL';
10
+ const TYPE_NUMBER = 'NUMBER';
11
+ const TYPE_PHONE_NUMBER = 'PHONE_NUMBER';
12
+
13
+ const FIELD_NAME = 'name';
14
+ const FIELD_TYPE = 'type';
15
+
16
+ private $id;
17
+ private $name;
18
+ private $type;
19
+
20
+ public function __construct(array $data)
21
+ {
22
+ $this->id = $data[self::FIELD_ID];
23
+ $this->name = $data[self::FIELD_NAME];
24
+ $this->type = $data[self::FIELD_TYPE];
25
+ }
26
+
27
+ public function getId()
28
+ {
29
+ return $this->id;
30
+ }
31
+
32
+ public function getName()
33
+ {
34
+ return $this->name;
35
+ }
36
+
37
+ public function getType()
38
+ {
39
+ return $this->type;
40
+ }
41
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/FieldsResponse.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ /**
6
+ * @method FieldResponse[] getCollection()
7
+ */
8
+ final class FieldsResponse extends ListResponse
9
+ {
10
+ protected function createItem(array $item)
11
+ {
12
+ return new FieldResponse($item);
13
+ }
14
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/GroupResponse.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ use DateTime;
6
+
7
+ final class GroupResponse extends AbstractContactsResponse implements IdentifiableResponse
8
+ {
9
+ const FIELD_NAME = 'name';
10
+ const FIELD_DESCRIPTION = 'description';
11
+ const FIELD_IDX = 'idx';
12
+ const FIELD_CONTACTS_COUNT = 'contacts_count';
13
+ const FIELD_DATE_CREATED = 'date_created';
14
+ const FIELD_DATE_UPDATED = 'date_updated';
15
+ const FIELD_CREATED_BY = 'created_by';
16
+ const FIELD_PERMISSIONS = 'permissions';
17
+
18
+ /** @var string */
19
+ private $id;
20
+
21
+ /** @var string */
22
+ private $name;
23
+
24
+ /** @var string */
25
+ private $description;
26
+
27
+ /** @var string */
28
+ private $idx;
29
+
30
+ /** @var int */
31
+ private $contactsCount;
32
+
33
+ /** @var DateTime */
34
+ private $dateCreated;
35
+
36
+ /** @var DateTime */
37
+ private $dateUpdated;
38
+
39
+ /** @var string */
40
+ private $createdBy;
41
+
42
+ /** @var array */
43
+ private $permissions;
44
+
45
+ public function __construct(array $data)
46
+ {
47
+ $this->id = $data[self::FIELD_ID];
48
+ $this->name = $data[self::FIELD_NAME];
49
+ $this->description = $data[self::FIELD_DESCRIPTION];
50
+ $this->idx = $data[self::FIELD_IDX];
51
+ $this->contactsCount = $data[self::FIELD_CONTACTS_COUNT];
52
+ $this->createdBy = $data[self::FIELD_CREATED_BY];
53
+ $this->permissions = $data[self::FIELD_PERMISSIONS];
54
+ $this->dateCreated = new DateTime($data[self::FIELD_DATE_CREATED]);
55
+ $this->dateUpdated = new DateTime($data[self::FIELD_DATE_UPDATED]);
56
+ }
57
+
58
+ public function getId()
59
+ {
60
+ return $this->id;
61
+ }
62
+
63
+ public function getName()
64
+ {
65
+ return $this->name;
66
+ }
67
+
68
+ public function getDescription()
69
+ {
70
+ return $this->description;
71
+ }
72
+
73
+ public function getIdx()
74
+ {
75
+ return $this->idx;
76
+ }
77
+
78
+ public function getContactsCount()
79
+ {
80
+ return $this->contactsCount;
81
+ }
82
+
83
+ public function getDateCreated()
84
+ {
85
+ return $this->dateCreated;
86
+ }
87
+
88
+ public function getDateUpdated()
89
+ {
90
+ return $this->dateUpdated;
91
+ }
92
+
93
+ public function getCreatedBy()
94
+ {
95
+ return $this->createdBy;
96
+ }
97
+
98
+ public function getPermissions()
99
+ {
100
+ return $this->permissions;
101
+ }
102
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/GroupsResponse.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ /**
6
+ * @method GroupResponse[] getCollection()
7
+ */
8
+ final class GroupsResponse extends ListResponse
9
+ {
10
+ protected function createItem(array $item)
11
+ {
12
+ return new GroupResponse($item);
13
+ }
14
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/IdentifiableResponse.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ interface IdentifiableResponse
6
+ {
7
+ const FIELD_ID = 'id';
8
+
9
+ public function getId();
10
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/ListResponse.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ abstract class ListResponse extends AbstractContactsResponse implements CountableResponse
6
+ {
7
+ const FIELD_COLLECTION = 'collection';
8
+
9
+ /** @var IdentifiableResponse[] */
10
+ private $collection = array();
11
+
12
+ /** @var int */
13
+ private $size;
14
+
15
+ function __construct(array $data)
16
+ {
17
+ $this->size = $data[self::FIELD_SIZE];
18
+
19
+ foreach ($data[self::FIELD_COLLECTION] as $contact) {
20
+ $this->collection[] = $this->createItem($contact);
21
+ }
22
+ }
23
+
24
+ /**
25
+ * @param array $item
26
+ * @return AbstractContactsResponse
27
+ */
28
+ abstract protected function createItem(array $item);
29
+
30
+ public function getSize()
31
+ {
32
+ return $this->size;
33
+ }
34
+
35
+ public function getCollection()
36
+ {
37
+ return $this->collection;
38
+ }
39
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/PermissionResponse.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ final class PermissionResponse extends AbstractContactsResponse
6
+ {
7
+ const FIELD_GROUP_ID = 'group_id';
8
+ const FIELD_READ = 'read';
9
+ const FIELD_WRITE = 'write';
10
+ const FIELD_SEND = 'send';
11
+ const FIELD_USERNAME = 'username';
12
+
13
+ private $groupId;
14
+ private $read;
15
+ private $write;
16
+ private $send;
17
+ private $username;
18
+
19
+ public function __construct(array $data)
20
+ {
21
+ $this->groupId = $data[self::FIELD_GROUP_ID];
22
+ $this->read = $data[self::FIELD_READ];
23
+ $this->write = $data[self::FIELD_WRITE];
24
+ $this->send = $data[self::FIELD_SEND];
25
+ $this->username = $data[self::FIELD_USERNAME];
26
+ }
27
+
28
+ public function getGroupId()
29
+ {
30
+ return $this->groupId;
31
+ }
32
+
33
+ public function getRead()
34
+ {
35
+ return $this->read;
36
+ }
37
+
38
+ public function getWrite()
39
+ {
40
+ return $this->write;
41
+ }
42
+
43
+ public function getSend()
44
+ {
45
+ return $this->send;
46
+ }
47
+
48
+ public function getUsername()
49
+ {
50
+ return $this->username;
51
+ }
52
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/PermissionsResponse.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ /**
6
+ * @method PermissionResponse[] getCollection()
7
+ */
8
+ final class PermissionsResponse extends ListResponse
9
+ {
10
+ protected function createItem(array $item)
11
+ {
12
+ return new PermissionResponse($item);
13
+ }
14
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Contacts/SizeResponse.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response\Contacts;
4
+
5
+ final class SizeResponse extends AbstractContactsResponse implements CountableResponse
6
+ {
7
+ /** @var int */
8
+ private $size;
9
+
10
+ function __construct(array $data)
11
+ {
12
+ $this->size = $data[self::FIELD_SIZE];
13
+ }
14
+
15
+ public function getSize()
16
+ {
17
+ return $this->size;
18
+ }
19
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/ContactsResponse.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class ContactsResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ * @deprecated use Contacts\ContactsResponse
9
+ */
10
+ class ContactsResponse extends CountableResponse {
11
+
12
+ /**
13
+ * @var \ArrayObject
14
+ */
15
+ private $list;
16
+
17
+ /**
18
+ * @param $data
19
+ */
20
+ function __construct( $data ) {
21
+ parent::__construct( $data );
22
+
23
+ $this->list = new \ArrayObject();
24
+
25
+ if ( isset( $this->obj->list ) ) {
26
+ foreach ( $this->obj->list as $res ) {
27
+ $this->list->append( new ContactResponse( $res ) );
28
+ }
29
+ }
30
+ }
31
+
32
+ /**
33
+ * @return \ArrayObject|ContactsResponse[]
34
+ */
35
+ public function getList() {
36
+ return $this->list;
37
+ }
38
+
39
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/CountableResponse.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class CountableResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class CountableResponse extends AbstractResponse {
10
+
11
+ /**
12
+ * @var int
13
+ */
14
+ protected $count;
15
+
16
+ /**
17
+ * @param $data
18
+ */
19
+ function __construct( $data ) {
20
+ parent::__construct( $data );
21
+
22
+ $this->count = isset( $this->obj->count ) ? $this->obj->count : 0;
23
+ }
24
+
25
+ /**
26
+ * @return int
27
+ */
28
+ public function getCount() {
29
+ return $this->count;
30
+ }
31
+
32
+ }
33
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/ErrorResponse.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class ErrorResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class ErrorResponse extends AbstractResponse {
10
+
11
+ /**
12
+ * @var int
13
+ */
14
+ public $code = 0;
15
+ /**
16
+ * @var string
17
+ */
18
+ public $message = "";
19
+
20
+ /**
21
+ * @param $data
22
+ */
23
+ function __construct( $data ) {
24
+ parent::__construct( $data );
25
+
26
+ if ( isset( $this->obj->error ) ) {
27
+ $this->code = $this->obj->error;
28
+ }
29
+
30
+ if ( isset( $this->obj->message ) ) {
31
+ $this->message = $this->obj->message;
32
+ }
33
+ }
34
+
35
+ /**
36
+ * @return bool
37
+ */
38
+ public function isError() {
39
+ return ($this->code != 0);
40
+ }
41
+
42
+ }
43
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/GroupResponse.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class GroupResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ * @deprecated use Contacts\GroupResponse
9
+ */
10
+ class GroupResponse extends AbstractResponse {
11
+
12
+ /**
13
+ * @var string
14
+ */
15
+ private $name = null;
16
+ /**
17
+ * @var string
18
+ */
19
+ private $info = null;
20
+ /**
21
+ * @var array
22
+ */
23
+ private $numbers_count = null;
24
+
25
+ /**
26
+ * @param $data
27
+ */
28
+ function __construct( $data ) {
29
+
30
+ if ( is_object( $data ) ) {
31
+ $this->obj = $data;
32
+ } else if ( is_string( $data ) ) {
33
+ parent::__construct( $data );
34
+ }
35
+
36
+ if ( isset( $this->obj->name ) ) {
37
+ $this->name = $this->obj->name;
38
+ }
39
+
40
+ if ( isset( $this->obj->info ) ) {
41
+ $this->info = $this->obj->info;
42
+ }
43
+
44
+ if ( isset( $this->obj->numbers_count ) ) {
45
+ $this->numbers_count = $this->obj->numbers_count;
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Returns group name
51
+ *
52
+ * @return string
53
+ */
54
+ public function getName() {
55
+ return $this->name;
56
+ }
57
+
58
+ /**
59
+ * Returns group information
60
+ *
61
+ * @return string
62
+ */
63
+ public function getInfo() {
64
+ return $this->info;
65
+ }
66
+
67
+ /**
68
+ * @deprecated since v1.0.0 use GroupResponse::getNumbersCount
69
+ * @return null
70
+ */
71
+ public function getNumbers() {
72
+ return $this->numbers_count;
73
+ }
74
+
75
+ /**
76
+ * Returns count numbers in group
77
+ *
78
+ * @return int
79
+ */
80
+ public function getNumbersCount() {
81
+ return $this->numbers_count;
82
+ }
83
+
84
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/GroupsResponse.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class GroupsResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ * @deprecated use Contacts\GroupsResponse
9
+ */
10
+ class GroupsResponse extends CountableResponse {
11
+
12
+ /**
13
+ * @var \ArrayObject
14
+ */
15
+ private $list;
16
+
17
+ /**
18
+ * @param $data
19
+ */
20
+ function __construct( $data ) {
21
+ parent::__construct( $data );
22
+
23
+ $this->list = new \ArrayObject();
24
+
25
+ if ( isset( $this->obj->list ) ) {
26
+ foreach ( $this->obj->list as $res ) {
27
+ $this->list->append( new GroupResponse( $res ) );
28
+ }
29
+ }
30
+ }
31
+
32
+ /**
33
+ * @return \ArrayObject}GroupResponse[]
34
+ */
35
+ public function getList() {
36
+ return $this->list;
37
+ }
38
+
39
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/MessageResponse.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class MessageResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class MessageResponse implements Response {
10
+
11
+
12
+ /**
13
+ * @var int
14
+ */
15
+ private $id = null;
16
+ /**
17
+ * @var int
18
+ */
19
+ private $number = null;
20
+ /**
21
+ * @var double
22
+ */
23
+ private $points = null;
24
+ /**
25
+ * @var string
26
+ */
27
+ private $status = null;
28
+
29
+ /**
30
+ * @var null
31
+ */
32
+ private $error = null;
33
+
34
+ /**
35
+ * @var string
36
+ */
37
+ private $idx = null;
38
+
39
+ /**
40
+ * @param $id
41
+ * @param $points
42
+ * @param $number
43
+ * @param $status
44
+ * @param $error
45
+ * @param $idx
46
+ */
47
+ function __construct( $id, $points, $number, $status, $error, $idx ) {
48
+ $this->id = $id;
49
+ $this->points = $points;
50
+ $this->number = $number;
51
+ $this->status = $status;
52
+ $this->error = $error;
53
+ $this->idx = $idx;
54
+ }
55
+
56
+ /**
57
+ * Returns system message ID number
58
+ *
59
+ * @return int
60
+ */
61
+ public function getId() {
62
+ return $this->id;
63
+ }
64
+
65
+ /**
66
+ * Returns phone number
67
+ *
68
+ * @return int Phone number
69
+ */
70
+ public function getNumber() {
71
+ return $this->number;
72
+ }
73
+
74
+ /**
75
+ * Returns costs of delivery
76
+ *
77
+ * @return double
78
+ */
79
+ public function getPoints() {
80
+ return $this->points;
81
+ }
82
+
83
+ /**
84
+ * Returns message status
85
+ *
86
+ * Example:
87
+ * DRAFT DELIVERED SENT UNDELIVERED EXPIRED QUEUE UNKNOWN UNDELIVERED FAILED PENDING ACCEPTED RENEWAL STOP
88
+ *
89
+ * @return string
90
+ */
91
+ public function getStatus() {
92
+ return $this->status;
93
+ }
94
+
95
+ /**
96
+ * @return null
97
+ */
98
+ public function getError() {
99
+ return $this->error;
100
+ }
101
+
102
+ /**
103
+ * Returns private idx number
104
+ *
105
+ * @return string
106
+ */
107
+ public function getIdx() {
108
+ return $this->idx;
109
+ }
110
+
111
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/PointsResponse.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class PointsResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class PointsResponse extends AbstractResponse
10
+ {
11
+ const className = __CLASS__;
12
+
13
+ /** @var int|null */
14
+ private $proCount;
15
+
16
+ /** @var int|null */
17
+ private $ecoCount;
18
+
19
+ /** @var int|null */
20
+ private $mmsCount;
21
+
22
+ /** @var int|null */
23
+ private $vmsGsmCount;
24
+
25
+ /** @var int|null */
26
+ private $vmsLandCount;
27
+
28
+ public function __construct($data)
29
+ {
30
+ parent::__construct($data);
31
+
32
+ if (isset($this->obj->proCount)) {
33
+ $this->proCount = $this->obj->proCount;
34
+ }
35
+
36
+ if (isset($this->obj->ecoCount)) {
37
+ $this->ecoCount = $this->obj->ecoCount;
38
+ }
39
+
40
+ if (isset($this->obj->mmsCount)) {
41
+ $this->mmsCount = $this->obj->mmsCount;
42
+ }
43
+
44
+ if (isset($this->obj->vmsGsmCount)) {
45
+ $this->vmsGsmCount = $this->obj->vmsGsmCount;
46
+ }
47
+
48
+ if (isset($this->obj->vmsLandCount)) {
49
+ $this->vmsLandCount = $this->obj->vmsLandCount;
50
+ }
51
+ }
52
+
53
+ /**
54
+ * Number of points available for user.
55
+ *
56
+ * @return number
57
+ */
58
+ public function getPoints()
59
+ {
60
+ return $this->obj->points;
61
+ }
62
+
63
+ public function getProCount()
64
+ {
65
+ return $this->proCount;
66
+ }
67
+
68
+ public function getEcoCount()
69
+ {
70
+ return $this->ecoCount;
71
+ }
72
+
73
+ public function getMmsCount()
74
+ {
75
+ return $this->mmsCount;
76
+ }
77
+
78
+ public function getVmsGsmCount()
79
+ {
80
+ return $this->vmsGsmCount;
81
+ }
82
+
83
+ public function getVmsLandCount()
84
+ {
85
+ return $this->vmsLandCount;
86
+ }
87
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/RawResponse.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class RawResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class RawResponse implements Response {
10
+
11
+ /**
12
+ * @var
13
+ */
14
+ private $text;
15
+
16
+ /**
17
+ * @param $data
18
+ */
19
+ function __construct( $data ) {
20
+
21
+ $this->text = $data;
22
+ }
23
+
24
+ /**
25
+ * @return mixed
26
+ */
27
+ public function getText() {
28
+ return $this->text;
29
+ }
30
+
31
+ }
32
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/Response.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ interface Response {
6
+
7
+ }
8
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/SenderResponse.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class SenderResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class SenderResponse extends AbstractResponse {
10
+
11
+ /**
12
+ * @var string
13
+ */
14
+ private $name;
15
+
16
+ /**
17
+ * @var string
18
+ */
19
+ private $status;
20
+
21
+ /**
22
+ * @var int
23
+ */
24
+ private $default;
25
+
26
+ /**
27
+ * @param $data
28
+ */
29
+ function __construct( $data ) {
30
+
31
+ if ( is_object( $data ) ) {
32
+ $this->obj = $data;
33
+ } else if ( is_string( $data ) ) {
34
+ parent::__construct( $data );
35
+ }
36
+
37
+ if( isset( $this->obj->sender ) ) {
38
+ $this->name = $this->obj->sender;
39
+ }
40
+
41
+ if( isset( $this->obj->status ) ) {
42
+ $this->status = $this->obj->status;
43
+ }
44
+
45
+ if( isset( $this->obj->default ) ) {
46
+ $this->default = $this->obj->default;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Is sender name is default selected.
52
+ *
53
+ * @return bool
54
+ */
55
+ public function isDefault() {
56
+ return (bool)$this->default;
57
+ }
58
+
59
+ /**
60
+ * Returns sender name.
61
+ *
62
+ * @return string
63
+ */
64
+ public function getName() {
65
+ return $this->name;
66
+ }
67
+
68
+ /**
69
+ * Returns status sender name.
70
+ *
71
+ * Example:
72
+ * ACTIVE INACTIVE
73
+ *
74
+ * @return string
75
+ */
76
+ public function getStatus() {
77
+ return $this->status;
78
+ }
79
+
80
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/SendersResponse.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class SendersResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class SendersResponse extends AbstractResponse {
10
+
11
+ /**
12
+ * @var \ArrayObject
13
+ */
14
+ private $list;
15
+
16
+ /**
17
+ * @param $data
18
+ */
19
+ function __construct( $data ) {
20
+ parent::__construct( $data );
21
+
22
+ $this->list = new \ArrayObject();
23
+
24
+ if ( isset( $this->obj ) ) {
25
+ foreach ( $this->obj as $res ) {
26
+ $this->list->append( new SenderResponse( $res ) );
27
+ }
28
+ }
29
+ }
30
+
31
+ /**
32
+ * @return SenderResponse[]|\ArrayObject
33
+ */
34
+ public function getList() {
35
+ return $this->list;
36
+ }
37
+
38
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/StatusResponse.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class StatusResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class StatusResponse extends CountableResponse {
10
+
11
+ /**
12
+ * @var \ArrayObject|MessageResponse[]
13
+ */
14
+ private $list;
15
+
16
+ /** @var string|null */
17
+ private $message;
18
+
19
+ /** @var int|null */
20
+ private $length;
21
+
22
+ /** @var int|null */
23
+ private $parts;
24
+
25
+ /**
26
+ * @param $data
27
+ */
28
+ function __construct( $data ) {
29
+ parent::__construct( $data );
30
+
31
+ $this->list = new \ArrayObject();
32
+
33
+ if ( isset( $this->obj->list ) ) {
34
+ foreach ( $this->obj->list as $res ) {
35
+ $this->list->append( new MessageResponse( $res->id, $res->points, $res->number, $res->status, $res->error, $res->idx ) );
36
+ }
37
+ }
38
+
39
+ if (isset($this->obj->message)) {
40
+ $this->message = (string)$this->obj->message;
41
+ }
42
+
43
+ if (isset($this->obj->length)) {
44
+ $this->length = (int)$this->obj->length;
45
+ }
46
+
47
+ if (isset($this->obj->parts)) {
48
+ $this->parts = (int)$this->obj->parts;
49
+ }
50
+ }
51
+
52
+ /**
53
+ * @return MessageResponse[]
54
+ */
55
+ public function getList() {
56
+ return $this->list;
57
+ }
58
+
59
+ public function getMessage()
60
+ {
61
+ return $this->message;
62
+ }
63
+
64
+ public function getLength()
65
+ {
66
+ return $this->length;
67
+ }
68
+
69
+ public function getParts()
70
+ {
71
+ return $this->parts;
72
+ }
73
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/UserResponse.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class UserResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class UserResponse extends AbstractResponse {
10
+
11
+ /**
12
+ * @var string
13
+ */
14
+ private $username;
15
+
16
+ /**
17
+ * @var double
18
+ */
19
+ private $limit;
20
+
21
+ /**
22
+ * @var double
23
+ */
24
+ private $monthLimit;
25
+
26
+ /**
27
+ * @var
28
+ */
29
+ private $senders;
30
+
31
+ /**
32
+ * @var int
33
+ */
34
+ private $phonebook;
35
+
36
+ /**
37
+ * @var int
38
+ */
39
+ private $active;
40
+
41
+ /**
42
+ * @var string
43
+ */
44
+ private $info;
45
+
46
+ /**
47
+ * @param $data
48
+ */
49
+ function __construct( $data ) {
50
+
51
+ if ( is_object( $data ) ) {
52
+ $this->obj = $data;
53
+ } else if ( is_string( $data ) ) {
54
+ parent::__construct( $data );
55
+ }
56
+
57
+ if ( isset( $this->obj->username ) ) {
58
+ $this->username = $this->obj->username;
59
+ }
60
+
61
+ if ( isset( $this->obj->limit ) ) {
62
+ $this->limit = $this->obj->limit;
63
+ }
64
+
65
+ if ( isset( $this->obj->month_limit ) ) {
66
+ $this->monthLimit = $this->obj->month_limit;
67
+ }
68
+
69
+ if ( isset( $this->obj->senders ) ) {
70
+ $this->senders = $this->obj->senders;
71
+ }
72
+
73
+ if ( isset( $this->obj->phonebook ) ) {
74
+ $this->phonebook = $this->obj->phonebook;
75
+ }
76
+
77
+ if ( isset( $this->obj->active ) ) {
78
+ $this->active = $this->obj->active;
79
+ }
80
+
81
+ if ( isset( $this->obj->info ) ) {
82
+ $this->info = $this->obj->info;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Returns the username used to authenticate the user.
88
+ *
89
+ * @return string The username
90
+ */
91
+ public function getUsername() {
92
+ return $this->username;
93
+ }
94
+
95
+ /**
96
+ * Returns limit points assigned to the user.
97
+ *
98
+ * @return double Points limit
99
+ */
100
+ public function getLimit() {
101
+ return $this->limit;
102
+ }
103
+
104
+ /**
105
+ * Returns number of points that will be assigned to user account each first day of month.
106
+ *
107
+ * @return double Monthly points limit
108
+ */
109
+ public function getMonthLimit() {
110
+ return $this->monthLimit;
111
+ }
112
+
113
+ /**
114
+ * @deprecated since v1.0.0 use UserResponse::hasFullAccessSenderNames
115
+ * @return mixed
116
+ */
117
+ public function getSenders() {
118
+ return $this->senders;
119
+ }
120
+
121
+ /**
122
+ * Returns whether the user has access to main account sender names.
123
+ *
124
+ * @return bool true if the user has access, false otherwise
125
+ */
126
+ public function hasFullAccessSenderNames() {
127
+ return (bool) $this->senders;
128
+ }
129
+
130
+ /**
131
+ * @deprecated since v1.0.0
132
+ * @return int
133
+ */
134
+ public function getPhonebook() {
135
+ return $this->phonebook;
136
+ }
137
+
138
+ /**
139
+ * Returns whether the user has access to main account phonebook contacts
140
+ *
141
+ * @return bool true if the user has access, false otherwise
142
+ */
143
+ public function hasFullAccessPhoneBook() {
144
+ return (bool)$this->phonebook;
145
+ }
146
+
147
+ /**
148
+ * @deprecated since v1.0.0
149
+ * @return int
150
+ */
151
+ public function getActive() {
152
+ return $this->active;
153
+ }
154
+
155
+ /**
156
+ * Check whether the user is enabled.
157
+ *
158
+ * @return Boolean true if the user is enabled, false otherwise
159
+ */
160
+ public function isActive() {
161
+ return (bool) $this->active;
162
+ }
163
+
164
+ /**
165
+ * Returns user description text.
166
+ *
167
+ * @return string
168
+ */
169
+ public function getInfo() {
170
+ return $this->info;
171
+ }
172
+
173
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/Response/UsersResponse.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api\Response;
4
+
5
+ /**
6
+ * Class UsersResponse
7
+ * @package SMSApi\Api\AbstractContactsResponse
8
+ */
9
+ class UsersResponse extends AbstractResponse {
10
+
11
+ /**
12
+ * @var \ArrayObject|UserResponse[]
13
+ */
14
+ private $list;
15
+
16
+ /**
17
+ * @param $data
18
+ */
19
+ function __construct( $data ) {
20
+ parent::__construct( $data );
21
+
22
+ $this->list = new \ArrayObject();
23
+
24
+ if ( isset( $this->obj ) ) {
25
+ foreach ( $this->obj as $res ) {
26
+ $this->list->append( new UserResponse( $res ) );
27
+ }
28
+ }
29
+ }
30
+
31
+ /**
32
+ * @return \ArrayObject|UserResponse[]
33
+ */
34
+ public function getList() {
35
+ return $this->list;
36
+ }
37
+
38
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/SenderFactory.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ /**
6
+ * Class SenderFactory
7
+ * @package SMSApi\Api
8
+ */
9
+ class SenderFactory extends ActionFactory {
10
+
11
+ /**
12
+ * @return Action\Sender\SenderList
13
+ */
14
+ public function actionList() {
15
+ $action = new \SMSApi\Api\Action\Sender\SenderList();
16
+ $action->client( $this->client );
17
+ $action->proxy( $this->proxy );
18
+
19
+ return $action;
20
+ }
21
+
22
+ /**
23
+ * @param null $senderName
24
+ * @return Action\Sender\Add
25
+ */
26
+ public function actionAdd( $senderName = null ) {
27
+ $action = new \SMSApi\Api\Action\Sender\Add();
28
+ $action->client( $this->client );
29
+ $action->proxy( $this->proxy );
30
+
31
+ if ( !empty( $senderName ) ) {
32
+ $action->setName( $senderName );
33
+ }
34
+
35
+ return $action;
36
+ }
37
+
38
+ /**
39
+ * @param null $senderName
40
+ * @return Action\Sender\Delete
41
+ */
42
+ public function actionDelete( $senderName = null ) {
43
+ $action = new \SMSApi\Api\Action\Sender\Delete();
44
+ $action->client( $this->client );
45
+ $action->proxy( $this->proxy );
46
+
47
+ if ( !empty( $senderName ) ) {
48
+ $action->filterBySenderName( $senderName );
49
+ }
50
+
51
+ return $action;
52
+ }
53
+
54
+ /**
55
+ * @param null $senderName
56
+ * @return Action\Sender\SenderDefault
57
+ */
58
+ public function actionSetDefault( $senderName = null ) {
59
+ $action = new \SMSApi\Api\Action\Sender\SenderDefault();
60
+ $action->client( $this->client );
61
+ $action->proxy( $this->proxy );
62
+
63
+ if ( !empty( $senderName ) ) {
64
+ $action->setSender( $senderName );
65
+ }
66
+
67
+ return $action;
68
+ }
69
+
70
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/SmsFactory.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //sms
3
+ namespace SMSApi\Api;
4
+
5
+ /**
6
+ * Class SmsFactory
7
+ * @package SMSApi\Api
8
+ */
9
+ class SmsFactory extends ActionFactory {
10
+
11
+ /**
12
+ * @return Action\Sms\Send
13
+ */
14
+ public function actionSend() {
15
+ $action = new \SMSApi\Api\Action\Sms\Send();
16
+ $action->client( $this->client );
17
+ $action->proxy( $this->proxy );
18
+
19
+ return $action;
20
+ }
21
+
22
+ /**
23
+ * @param null $id
24
+ * @return Action\Sms\Get
25
+ * @throws \SMSApi\Exception\ActionException
26
+ */
27
+ public function actionGet( $id = null ) {
28
+ $action = new \SMSApi\Api\Action\Sms\Get();
29
+ $action->client( $this->client );
30
+ $action->proxy( $this->proxy );
31
+
32
+ if ( !empty( $id ) && is_string( $id ) ) {
33
+ $action->filterById( $id );
34
+ } else if ( !empty( $id ) && is_array( $id ) ) {
35
+ $action->filterByIds( $id );
36
+ }
37
+
38
+ return $action;
39
+ }
40
+
41
+ /**
42
+ * @param null $id
43
+ * @return Action\Sms\Delete
44
+ * @throws \SMSApi\Exception\ActionException
45
+ */
46
+ public function actionDelete( $id = null ) {
47
+ $action = new \SMSApi\Api\Action\Sms\Delete();
48
+ $action->client( $this->client );
49
+ $action->proxy( $this->proxy );
50
+
51
+ if ( !empty( $id ) && is_string( $id ) ) {
52
+ $action->filterById( $id );
53
+ }
54
+
55
+ return $action;
56
+ }
57
+
58
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/UserFactory.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ /**
6
+ * Class UserFactory
7
+ * @package SMSApi\Api
8
+ */
9
+ class UserFactory extends ActionFactory {
10
+
11
+ /**
12
+ * @return Action\User\UserList
13
+ */
14
+ public function actionList() {
15
+ $action = new \SMSApi\Api\Action\User\UserList();
16
+ $action->client( $this->client );
17
+ $action->proxy( $this->proxy );
18
+
19
+ return $action;
20
+ }
21
+
22
+ /**
23
+ * @param null $username
24
+ * @return Action\User\Add
25
+ */
26
+ public function actionAdd( $username = null ) {
27
+ $action = new \SMSApi\Api\Action\User\Add();
28
+ $action->client( $this->client );
29
+ $action->proxy( $this->proxy );
30
+
31
+ if ( !empty( $username ) ) {
32
+ $action->setUsername( $username );
33
+ }
34
+
35
+ return $action;
36
+ }
37
+
38
+ /**
39
+ * @param null $username
40
+ * @return Action\User\Edit
41
+ */
42
+ public function actionEdit( $username = null ) {
43
+ $action = new \SMSApi\Api\Action\User\Edit();
44
+ $action->client( $this->client );
45
+ $action->proxy( $this->proxy );
46
+
47
+ if ( !empty( $username ) ) {
48
+ $action->filterByUsername( $username );
49
+ }
50
+
51
+ return $action;
52
+ }
53
+
54
+ /**
55
+ * @param null $username
56
+ * @return Action\User\Get
57
+ */
58
+ public function actionGet( $username = null ) {
59
+ $action = new \SMSApi\Api\Action\User\Get();
60
+ $action->client( $this->client );
61
+ $action->proxy( $this->proxy );
62
+
63
+ if ( !empty( $username ) ) {
64
+ $action->filterByUsername( $username );
65
+ }
66
+
67
+ return $action;
68
+ }
69
+
70
+ /**
71
+ * @return Action\User\GetPoints
72
+ */
73
+ public function actionGetPoints() {
74
+ $action = new \SMSApi\Api\Action\User\GetPoints();
75
+ $action->client( $this->client );
76
+ $action->proxy( $this->proxy );
77
+
78
+ return $action;
79
+ }
80
+
81
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Api/VmsFactory.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Api;
4
+
5
+ /**
6
+ * Class VmsFactory
7
+ * @package SMSApi\Api
8
+ */
9
+ class VmsFactory extends ActionFactory {
10
+
11
+ /**
12
+ * @return Action\Vms\Send
13
+ */
14
+ public function actionSend() {
15
+ $action = new \SMSApi\Api\Action\Vms\Send();
16
+ $action->client( $this->client );
17
+ $action->proxy( $this->proxy );
18
+
19
+ return $action;
20
+ }
21
+
22
+ /**
23
+ * @param null $id
24
+ * @return Action\Vms\Get
25
+ * @throws \SMSApi\Exception\ActionException
26
+ */
27
+ public function actionGet( $id = null ) {
28
+ $action = new \SMSApi\Api\Action\Vms\Get();
29
+ $action->client( $this->client );
30
+ $action->proxy( $this->proxy );
31
+
32
+ if ( !empty( $id ) && is_string( $id ) ) {
33
+ $action->filterById( $id );
34
+ } else if ( !empty( $id ) && is_array( $id ) ) {
35
+ $action->filterByIds( $id );
36
+ }
37
+
38
+ return $action;
39
+ }
40
+
41
+ /**
42
+ * @param null $id
43
+ * @return Action\Vms\Delete
44
+ * @throws \SMSApi\Exception\ActionException
45
+ */
46
+ public function actionDelete( $id = null ) {
47
+ $action = new \SMSApi\Api\Action\Vms\Delete();
48
+ $action->client( $this->client );
49
+ $action->proxy( $this->proxy );
50
+
51
+ if ( !empty( $id ) && is_string( $id ) ) {
52
+ $action->filterById( $id );
53
+ } else if ( !empty( $id ) && is_array( $id ) ) {
54
+ $action->filterByIds( $id );
55
+ }
56
+
57
+ return $action;
58
+ }
59
+
60
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Autoload.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ spl_autoload_register(
4
+ function ($class) {
5
+ static $classes = null;
6
+ static $path = null;
7
+
8
+ if ( $path === null ) {
9
+ $path = dirname( __FILE__ );
10
+ }
11
+
12
+ $cname = strtolower(str_replace("\\", "", $class));
13
+
14
+ if ( !isset( $classes[ $cname ] ) ) {
15
+
16
+ if ( preg_match( '/^smsapi/', $cname ) ) {
17
+
18
+ $classmap = include 'autoload_classmap.php';
19
+
20
+ if(isset($classmap[$cname])){
21
+ $class = explode( "\\", $classmap[$cname] );
22
+ }else{
23
+ $class = explode( "\\", $class );
24
+ }
25
+
26
+ unset( $class[ 0 ] );
27
+ $class = implode( DIRECTORY_SEPARATOR, $class );
28
+
29
+ $classes[ $cname ] = $path . DIRECTORY_SEPARATOR . $class . '.php';
30
+ }
31
+
32
+ }
33
+
34
+ if ( isset( $classes[ $cname ] ) ) {
35
+ require $classes[ $cname ];
36
+ }
37
+ }
38
+ );
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Client.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi;
4
+
5
+ use SMSApi\Exception\ClientException;
6
+
7
+ /**
8
+ * Class Client
9
+ * @package SMSApi
10
+ */
11
+ class Client {
12
+
13
+ /**
14
+ * @var string
15
+ */
16
+ private $username;
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ private $password;
22
+
23
+ /**
24
+ * @param $username
25
+ */
26
+ public function __construct( $username ) {
27
+ $this->setUsername( $username );
28
+ }
29
+
30
+ /**
31
+ * Set the username used to authenticate the user.
32
+
33
+ * @param $username string
34
+ * @return $this
35
+ * @throws Exception\ClientException
36
+ */
37
+ public function setUsername( $username ) {
38
+
39
+ if ( empty( $username ) ) {
40
+ throw new ClientException( "Username can not be empty" );
41
+ }
42
+
43
+ $this->username = $username;
44
+ return $this;
45
+ }
46
+
47
+ /**
48
+ * Set password encoded with md5 algorithm.
49
+ *
50
+ * @param $password
51
+ * @return $this
52
+ * @throws Exception\ClientException
53
+ */
54
+ public function setPasswordHash( $password ) {
55
+
56
+ if ( empty( $password ) ) {
57
+ throw new ClientException( "Password can not be empty" );
58
+ }
59
+
60
+ $this->password = $password;
61
+ return $this;
62
+ }
63
+
64
+ /**
65
+ * Set password in plain text.
66
+ *
67
+ * @param $password
68
+ * @return $this
69
+ * @throws Exception\ClientException
70
+ */
71
+ public function setPasswordRaw( $password ) {
72
+ $this->setPasswordHash( md5( $password ) );
73
+ return $this;
74
+ }
75
+
76
+ /**
77
+ * Returns the username used to authenticate the user.
78
+ *
79
+ * @return string The username
80
+ */
81
+ public function getUsername() {
82
+ return $this->username;
83
+ }
84
+
85
+ /**
86
+ * Returns password
87
+ *
88
+ * @return string The salt password
89
+ */
90
+ public function getPassword() {
91
+ return $this->password;
92
+ }
93
+
94
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ActionException.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ class ActionException extends SmsapiException {
6
+
7
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ClientException.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ class ClientException extends SmsapiException {
6
+
7
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ContactsException.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ use Exception;
6
+
7
+ class ContactsException extends SmsapiException
8
+ {
9
+ private $error;
10
+ private $errors;
11
+ private $shortMessage;
12
+
13
+ public function __construct(array $data, Exception $exception = null)
14
+ {
15
+ $output = json_decode($data['output'], true);
16
+ $this->error = $output['error'];
17
+ $this->errors = $output['errors'];
18
+ $this->shortMessage = $output['message'];
19
+ $message = '';
20
+
21
+ foreach ($this->errors as $k => $element) {
22
+ if ($k) {
23
+ $message .= '; ';
24
+ }
25
+
26
+ $message .=
27
+ '[' . $element['error'] . '] ' . $element['message']
28
+ . ' (path: ' . ($element['path'] ?: 'null')
29
+ . ', value: ' . ($element['value'] ?: 'null') . ')';
30
+ }
31
+
32
+ parent::__construct(
33
+ '[' . $output['error'] . '] '
34
+ . $output['message']
35
+ . ($message ? ': ' . $message : ''),
36
+ $data['code'],
37
+ $exception
38
+ );
39
+ }
40
+
41
+ public function getShortMessage()
42
+ {
43
+ return $this->error;
44
+ }
45
+
46
+ public function getError()
47
+ {
48
+ return $this->error;
49
+ }
50
+
51
+ public function getErrors()
52
+ {
53
+ return $this->errors;
54
+ }
55
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/HostException.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ class HostException extends SmsapiException {
6
+
7
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/InvalidParameterException.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ class InvalidParameterException extends SmsapiException {
6
+
7
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/ProxyException.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ class ProxyException extends SmsapiException {
6
+
7
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Exception/SmsapiException.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Exception;
4
+
5
+ class SmsapiException extends \Exception {
6
+
7
+ public static function isClientError( $code ) {
8
+
9
+
10
+ switch ( $code ) {
11
+ case 101:
12
+ case 102:
13
+ case 103:
14
+ case 105:
15
+ case 110:
16
+ case 1000:
17
+ case 1001:
18
+ return true;
19
+ }
20
+
21
+ return false;
22
+ }
23
+
24
+ public static function isHostError( $code ) {
25
+
26
+ switch ( $code ) {
27
+ case 8:
28
+ case 201:
29
+ case 666:
30
+ case 999:
31
+ return true;
32
+ }
33
+
34
+ return false;
35
+ }
36
+
37
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Http/AbstractHttp.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Proxy\Http;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Client;
7
+ use SMSApi\Exception\ProxyException;
8
+ use SMSApi\Proxy\Proxy;
9
+ use SMSApi\Proxy\Uri;
10
+
11
+ abstract class AbstractHttp implements Proxy
12
+ {
13
+ protected $protocol;
14
+ protected $host;
15
+ protected $port;
16
+ protected $boundary = '**RGRG87VFSGF86796GSD**';
17
+ protected $timeout = 5;
18
+ protected $maxRedirects = 1;
19
+
20
+ /**
21
+ * @deprecated - no usages
22
+ */
23
+ protected $uri;
24
+
25
+ /**
26
+ * @deprecated - no usages
27
+ */
28
+ protected $file;
29
+
30
+ /**
31
+ * @deprecated - no usages
32
+ */
33
+ protected $userAgent = "SMSAPI";
34
+
35
+ /**
36
+ * @deprecated - no usages
37
+ */
38
+ protected $headers = array();
39
+
40
+ /** @var Client */
41
+ private $basicAuthentication;
42
+
43
+ public function __construct( $host ) {
44
+
45
+ $tmp = explode( "://", $host );
46
+
47
+ if ( isset( $tmp[ 0 ] ) ) {
48
+ $this->protocol = $tmp[ 0 ];
49
+ if ( $this->protocol == "http" ) {
50
+ $this->port = 80;
51
+ } else if ( $this->protocol == "https" ) {
52
+ $this->port = 443;
53
+ }
54
+ }
55
+
56
+ if ( isset( $tmp[ 1 ] ) ) {
57
+ $this->host = $tmp[ 1 ];
58
+ }
59
+ }
60
+
61
+ public function getHost()
62
+ {
63
+ return $this->host;
64
+ }
65
+
66
+ public function getPort()
67
+ {
68
+ return $this->port;
69
+ }
70
+
71
+ public function getProtocol()
72
+ {
73
+ return $this->protocol;
74
+ }
75
+
76
+ public function execute(AbstractAction $action)
77
+ {
78
+ try {
79
+ $uri = $action->uri();
80
+ $file = $action->file();
81
+
82
+ if ($uri == null) {
83
+ throw new ProxyException("Invalid URI");
84
+ }
85
+
86
+ $method = $action->getMethod();
87
+ $url = $this->prepareRequestUrl($uri);
88
+ $query = $uri->getQuery();
89
+
90
+ $response = $this->makeRequest($method, $url, $query, $file, $action->isContacts());
91
+
92
+ if (!$action->isContacts()) {
93
+ $this->checkCode($response['code']);
94
+ }
95
+
96
+ $notDeleteOrHead = !in_array($method, array(AbstractAction::METHOD_DELETE, AbstractAction::METHOD_HEAD));
97
+ if ($notDeleteOrHead and empty($response['output'])) {
98
+ throw new ProxyException('Error fetching remote content empty');
99
+ }
100
+ } catch (\Exception $e) {
101
+ throw new ProxyException($e->getMessage(), 0, $e);
102
+ }
103
+
104
+ return $response;
105
+ }
106
+
107
+ public function setBasicAuthentication(Client $client)
108
+ {
109
+ $this->basicAuthentication = $client;
110
+
111
+ return $this;
112
+ }
113
+
114
+ abstract protected function makeRequest($method, $url, $query, $file, $isContacts);
115
+
116
+ protected function checkCode($code)
117
+ {
118
+ if ($code AND $code < 200 OR $code > 299) {
119
+ throw new ProxyException('Error fetching remote');
120
+ }
121
+ }
122
+
123
+ protected function detectFileMimeType( $file ) {
124
+ $type = null;
125
+
126
+ if ( function_exists( 'finfo_open' ) ) {
127
+ $fo = finfo_open( FILEINFO_MIME );
128
+ if ( $fo ) {
129
+ $type = finfo_file( $fo, $file );
130
+ }
131
+ } elseif ( function_exists( 'mime_content_type' ) ) {
132
+ $type = mime_content_type( $file );
133
+ }
134
+
135
+ if ( !$type ) {
136
+ $type = 'application/octet-stream';
137
+ }
138
+
139
+ return $type;
140
+ }
141
+
142
+ protected function encodeFormData( $boundary, $name, $value, $filename = null, $headers = array() ) {
143
+ $ret = "--{$boundary}\r\n" .
144
+ 'Content-Disposition: form-data; name="' . $name . '"';
145
+
146
+ if ( $filename ) {
147
+ $ret .= '; filename="' . $filename . '"';
148
+ }
149
+ $ret .= "\r\n";
150
+
151
+ foreach ( $headers as $hname => $hvalue ) {
152
+ $ret .= "{$hname}: {$hvalue}\r\n";
153
+ }
154
+ $ret .= "\r\n";
155
+ $ret .= "{$value}\r\n";
156
+
157
+ return $ret;
158
+ }
159
+
160
+ protected function prepareFileContent( $filename ) {
161
+
162
+ $file[ 'formname' ] = 'file';
163
+ $file[ 'data' ] = file_get_contents( $filename );
164
+ $file[ 'filename' ] = basename( $filename );
165
+ $file[ 'ctype' ] = $this->detectFileMimeType( $filename );
166
+ $fhead = array('Content-Type' => $file[ 'ctype' ]);
167
+
168
+ $body = $this->encodeFormData( $this->boundary, $file[ 'formname' ], $file[ 'data' ], $file[ 'filename' ], $fhead );
169
+
170
+ $body .= "--{$this->boundary}--\r\n";
171
+
172
+ return $body;
173
+ }
174
+
175
+ protected function renderQueryByBody( $query, $body ) {
176
+
177
+ $tmpBody = "";
178
+
179
+ if ( !empty( $query ) && !empty( $body ) ) {
180
+ $params = array();
181
+ parse_str( $query, $params );
182
+ foreach ( $params as $k2 => $v2 ) {
183
+ $tmpBody .= $this->encodeFormData( $this->boundary, $k2, $v2 );
184
+ }
185
+ } else {
186
+ $tmpBody = $query;
187
+ }
188
+
189
+ if ( !empty( $body ) ) {
190
+ $tmpBody .= $body;
191
+ }
192
+
193
+ return $tmpBody;
194
+ }
195
+
196
+ /**
197
+ * @param Uri $uri
198
+ * @return string
199
+ */
200
+ protected function prepareRequestUrl(Uri $uri)
201
+ {
202
+ $url = $uri->getSchema() . "://" . $uri->getHost() . $uri->getPath();
203
+ return $url;
204
+ }
205
+
206
+ /**
207
+ * @param $file
208
+ * @return string
209
+ */
210
+ protected function prepareRequestBody($file)
211
+ {
212
+ $body = "";
213
+
214
+ if ($this->isFileValid($file)) {
215
+ $body = $this->prepareFileContent($file);
216
+ }
217
+
218
+ return $body;
219
+ }
220
+
221
+ private function isFileValid($file)
222
+ {
223
+ return !empty($file) && file_exists($file);
224
+ }
225
+
226
+ /**
227
+ * @param $file
228
+ * @return array
229
+ */
230
+ protected function prepareRequestHeaders($file)
231
+ {
232
+ $headers = array();
233
+
234
+ $headers['User-Agent'] = 'smsapi-php-client';
235
+ $headers['Accept'] = '';
236
+
237
+ if ($this->isFileValid($file)) {
238
+ $headers['Content-Type'] = 'multipart/form-data; boundary=' . $this->boundary;
239
+ } else {
240
+ $headers['Content-Type'] = 'application/x-www-form-urlencoded';
241
+ }
242
+
243
+ if ($this->basicAuthentication) {
244
+ $headers['Authorization'] =
245
+ 'Basic '
246
+ . base64_encode(
247
+ $this->basicAuthentication->getUsername()
248
+ . ':' . $this->basicAuthentication->getPassword()
249
+ );
250
+ }
251
+
252
+ return $headers;
253
+ }
254
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Http/Curl.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Proxy\Http;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Exception\ProxyException;
7
+
8
+ class Curl extends AbstractHttp
9
+ {
10
+ protected function makeRequest($method, $url, $query, $file, $isContacts)
11
+ {
12
+ $body = $this->prepareRequestBody($file);
13
+
14
+ $headers = $this->prepareRequestHeaders($file);
15
+
16
+ $curl = curl_init();
17
+
18
+ curl_setopt( $curl, CURL_HTTP_VERSION_1_1, true );
19
+
20
+ curl_setopt($curl, CURLOPT_HEADER, true);
21
+
22
+ curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
23
+
24
+ if ( $this->getPort() != 80 ) {
25
+ curl_setopt( $curl, CURLOPT_PORT, intval( $this->getPort() ) );
26
+ }
27
+
28
+ if ( isset( $this->timeout ) ) {
29
+ curl_setopt( $curl, CURLOPT_CONNECTTIMEOUT, $this->timeout );
30
+ }
31
+
32
+ if ( isset( $this->maxRedirects ) ) {
33
+ curl_setopt( $curl, CURLOPT_MAXREDIRS, $this->maxRedirects );
34
+ }
35
+
36
+ if ( !$curl ) {
37
+ throw new ProxyException( 'Unable to connect' );
38
+ }
39
+
40
+ $data = $this->renderQueryByBody($query, $body);
41
+
42
+ $curlHeaders = array( );
43
+ foreach ( $headers as $key => $value ) {
44
+ $curlHeaders[ ] = $key . ': ' . $value;
45
+ }
46
+
47
+ curl_setopt( $curl, CURLOPT_HTTPHEADER, $curlHeaders );
48
+ curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
49
+
50
+ switch ($method) {
51
+ case AbstractAction::METHOD_GET:
52
+ curl_setopt($curl, CURLOPT_URL, $url . ($query ? '?' . $query : ''));
53
+ break;
54
+ case AbstractAction::METHOD_POST:
55
+ curl_setopt($curl, CURLOPT_URL, $url);
56
+ curl_setopt($curl, CURLOPT_POST, true);
57
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
58
+ break;
59
+ case AbstractAction::METHOD_HEAD:
60
+ curl_setopt($curl, CURLOPT_URL, $url . ($query ? '?' . $query : ''));
61
+ curl_setopt($curl, CURLOPT_NOBODY, true);
62
+ //curl_setopt($curl, CURLOPT_CUSTOMREQUEST, AbstractAction::METHOD_HEAD);
63
+ //curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
64
+ break;
65
+ case AbstractAction::METHOD_DELETE:
66
+ curl_setopt($curl, CURLOPT_URL, $url . ($query ? '?' . $query : ''));
67
+ curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
68
+ break;
69
+ case AbstractAction::METHOD_PUT:
70
+ curl_setopt($curl, CURLOPT_URL, $url);
71
+ curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
72
+ curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
73
+ }
74
+
75
+ list($headers, $body) = explode(
76
+ "\r\n\r\n",
77
+ preg_replace('#HTTP/1\.1 100 Continue\s+#', '', curl_exec($curl)),
78
+ 2
79
+ );
80
+
81
+ $response = array(
82
+ 'output' => $body,
83
+ 'code' => curl_getinfo($curl, CURLINFO_HTTP_CODE),
84
+ 'size' => $this->getResultCount($headers),
85
+ );
86
+
87
+ curl_close( $curl );
88
+
89
+ return $response;
90
+ }
91
+
92
+ protected function getResultCount($headers)
93
+ {
94
+ foreach (explode("\n", $headers) as $header) {
95
+ if (preg_match('#X-Result-Count:\s+(\d+)#i', $header, $code)) {
96
+ return (int)next($code);
97
+ }
98
+ }
99
+
100
+ return null;
101
+ }
102
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Http/Native.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Proxy\Http;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+
7
+ class Native extends AbstractHttp
8
+ {
9
+ /**
10
+ * @deprecated
11
+ */
12
+ const CONNECT_FOPEN = 1;
13
+
14
+ /**
15
+ * @deprecated
16
+ */
17
+ const CONNECT_SOCKET = 2;
18
+
19
+ protected function makeRequest($method, $url, $query, $file, $isContacts)
20
+ {
21
+ $body = $this->prepareRequestBody($file);
22
+ $headers = $this->prepareRequestHeaders($file);
23
+ $getHeadOrDelete = in_array(
24
+ $method,
25
+ array(AbstractAction::METHOD_GET, AbstractAction::METHOD_HEAD, AbstractAction::METHOD_DELETE)
26
+ );
27
+
28
+ if (!empty($body) or ($query and $getHeadOrDelete)) {
29
+ $url .= '?' . $query;
30
+ }
31
+
32
+ $headersString = $this->preparePlainTextHeaders($headers);
33
+
34
+ $options = array(
35
+ 'http' => array(
36
+ 'method' => $method,
37
+ 'header' => $headersString,
38
+ 'content' => empty($body) ? $query : $body,
39
+ 'ignore_errors' => $isContacts,
40
+ )
41
+ );
42
+
43
+ $context = stream_context_create($options);
44
+
45
+ $fp = fopen($url, 'r', false, $context);
46
+
47
+ $metaData = stream_get_meta_data($fp);
48
+
49
+ $response['code'] = $this->getStatusCode($metaData);
50
+ $response['output'] = stream_get_contents($fp);
51
+ $response['size'] = $this->getResultCount($metaData);
52
+
53
+ if ($fp) {
54
+ fclose($fp);
55
+ }
56
+
57
+ return $response;
58
+ }
59
+
60
+ private function getHeaders(array $metaData)
61
+ {
62
+ if (isset($metaData['wrapper_data']) and is_array($metaData['wrapper_data'])) {
63
+ if (isset($metaData['wrapper_data']['headers']) and is_array($metaData['wrapper_data']['headers'])) {
64
+ return $metaData['wrapper_data']['headers'];
65
+ } else {
66
+ return $metaData['wrapper_data'];
67
+ }
68
+ }
69
+
70
+ return array();
71
+ }
72
+
73
+ private function getStatusCode(array $metaData)
74
+ {
75
+ foreach ($this->getHeaders($metaData) as $wrapperRow) {
76
+ if (preg_match('#HTTP/1\.[01]\s+([\d]+)#i', $wrapperRow, $code)) {
77
+ return next($code);
78
+ }
79
+ }
80
+
81
+ return null;
82
+ }
83
+
84
+ private function getResultCount(array $metaData)
85
+ {
86
+ foreach ($this->getHeaders($metaData) as $wrapperRow) {
87
+ if (preg_match('#X-Result-Count:\s+(\d+)#i', $wrapperRow, $code)) {
88
+ return (int)next($code);
89
+ }
90
+ }
91
+
92
+ return null;
93
+ }
94
+
95
+ /**
96
+ * @param $headers
97
+ * @return string
98
+ */
99
+ private function preparePlainTextHeaders($headers)
100
+ {
101
+ $headersString = "";
102
+
103
+ foreach ($headers as $k => $v) {
104
+ if (is_string($k)) {
105
+ $v = ucfirst($k) . ": " . $v;
106
+ }
107
+
108
+ $headersString .= $v . "\r\n";
109
+ }
110
+
111
+ return $headersString;
112
+ }
113
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Proxy.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Proxy;
4
+
5
+ use SMSApi\Api\Action\AbstractAction;
6
+ use SMSApi\Client;
7
+ use SMSApi\Exception\ProxyException;
8
+
9
+ interface Proxy
10
+ {
11
+ /**
12
+ * @param AbstractAction $action
13
+ * @return string
14
+ * @throws ProxyException
15
+ */
16
+ public function execute(AbstractAction $action);
17
+
18
+ /**
19
+ * @return string|null
20
+ */
21
+ public function getProtocol();
22
+
23
+ /**
24
+ * @return string|null
25
+ */
26
+ public function getHost();
27
+
28
+ /**
29
+ * @return int|null
30
+ */
31
+ public function getPort();
32
+
33
+ public function setBasicAuthentication(Client $client);
34
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/Proxy/Uri.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace SMSApi\Proxy;
4
+
5
+ class Uri {
6
+
7
+ private $schema;
8
+ private $host;
9
+ private $port;
10
+ private $path;
11
+ private $query;
12
+
13
+ function __construct( $schema, $host, $port, $path, $query ) {
14
+
15
+ $this->schema = $schema;
16
+ $this->host = rtrim($host, '/');
17
+ $this->port = $port;
18
+ $this->path = '/' . ltrim($path, '/');
19
+ $this->query = $query;
20
+ }
21
+
22
+ public function getSchema() {
23
+ return $this->schema;
24
+ }
25
+
26
+ public function getHost() {
27
+ return $this->host;
28
+ }
29
+
30
+ public function getPort() {
31
+ return $this->port;
32
+ }
33
+
34
+ public function getPath() {
35
+ return $this->path;
36
+ }
37
+
38
+ public function getQuery() {
39
+ return $this->query;
40
+ }
41
+
42
+ }
43
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/smsapi/autoload_classmap.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ return array(
4
+ 'smsapiapimmsfactory' => 'SMSApi\Api\MmsFactory',
5
+ 'smsapiapiactionfactory' => 'SMSApi\Api\ActionFactory',
6
+ 'smsapiclient' => 'SMSApi\Client',
7
+ 'smsapiproxyhttpnative' => 'SMSApi\Proxy\Http\Native',
8
+ 'smsapiproxyhttpcurl' => 'SMSApi\Proxy\Http\Curl',
9
+ 'smsapiproxyhttpabstracthttp' => 'SMSApi\Proxy\Http\AbstractHttp',
10
+ 'smsapiproxyproxy' => 'SMSApi\Proxy\Proxy',
11
+ 'smsapiapiactionmmssend' => 'SMSApi\Api\Action\Mms\Send',
12
+ 'smsapiapiactionabstractaction' => 'SMSApi\Api\Action\AbstractAction',
13
+ 'smsapiproxyuri' => 'SMSApi\Proxy\Uri',
14
+ 'smsapiapiresponseerrorresponse' => 'SMSApi\Api\Response\ErrorResponse',
15
+ 'smsapiapiresponseabstractresponse' => 'SMSApi\Api\Response\AbstractResponse',
16
+ 'smsapiapiresponseresponse' => 'SMSApi\Api\Response\Response',
17
+ 'smsapiapiresponsestatusresponse' => 'SMSApi\Api\Response\StatusResponse',
18
+ 'smsapiapiresponsecountableresponse' => 'SMSApi\Api\Response\CountableResponse',
19
+ 'smsapiapiresponsemessageresponse' => 'SMSApi\Api\Response\MessageResponse',
20
+ 'smsapiapiactionmmsget' => 'SMSApi\Api\Action\Mms\Get',
21
+ 'smsapiapiactionmmsdelete' => 'SMSApi\Api\Action\Mms\Delete',
22
+ 'smsapiapiphonebookfactory' => 'SMSApi\Api\PhonebookFactory',
23
+ 'smsapiapiactionphonebookgroupadd' => 'SMSApi\Api\Action\Phonebook\GroupAdd',
24
+ 'smsapiapiresponsegroupresponse' => 'SMSApi\Api\Response\GroupResponse',
25
+ 'smsapiapiactionphonebookgroupedit' => 'SMSApi\Api\Action\Phonebook\GroupEdit',
26
+ 'smsapiapiactionphonebookcontactadd' => 'SMSApi\Api\Action\Phonebook\ContactAdd',
27
+ 'smsapiapiresponsecontactresponse' => 'SMSApi\Api\Response\ContactResponse',
28
+ 'smsapiapiactionphonebookgroupget' => 'SMSApi\Api\Action\Phonebook\GroupGet',
29
+ 'smsapiapiactionphonebookcontactedit' => 'SMSApi\Api\Action\Phonebook\ContactEdit',
30
+ 'smsapiapiactionphonebookcontactget' => 'SMSApi\Api\Action\Phonebook\ContactGet',
31
+ 'smsapiapiactionphonebookcontactdelete' => 'SMSApi\Api\Action\Phonebook\ContactDelete',
32
+ 'smsapiapiresponserawresponse' => 'SMSApi\Api\Response\RawResponse',
33
+ 'smsapiapiactionphonebookgroupdelete' => 'SMSApi\Api\Action\Phonebook\GroupDelete',
34
+ 'smsapiapiactionphonebookcontactlist' => 'SMSApi\Api\Action\Phonebook\ContactList',
35
+ 'smsapiapiresponsecontactsresponse' => 'SMSApi\Api\Response\ContactsResponse',
36
+ 'smsapiapiactionphonebookgrouplist' => 'SMSApi\Api\Action\Phonebook\GroupList',
37
+ 'smsapiapiresponsegroupsresponse' => 'SMSApi\Api\Response\GroupsResponse',
38
+ 'smsapiapisenderfactory' => 'SMSApi\Api\SenderFactory',
39
+ 'smsapiapiactionsenderadd' => 'SMSApi\Api\Action\Sender\Add',
40
+ 'smsapiapiactionsendersenderlist' => 'SMSApi\Api\Action\Sender\SenderList',
41
+ 'smsapiapiresponsesendersresponse' => 'SMSApi\Api\Response\SendersResponse',
42
+ 'smsapiapiresponsesenderresponse' => 'SMSApi\Api\Response\SenderResponse',
43
+ 'smsapiapiactionsenderdelete' => 'SMSApi\Api\Action\Sender\Delete',
44
+ 'smsapiapiactionsendersenderdefault' => 'SMSApi\Api\Action\Sender\SenderDefault',
45
+ 'smsapiapismsfactory' => 'SMSApi\Api\SmsFactory',
46
+ 'smsapiapiactionsmssend' => 'SMSApi\Api\Action\Sms\Send',
47
+ 'smsapiapiactionsmsget' => 'SMSApi\Api\Action\Sms\Get',
48
+ 'smsapiapiactionsmsdelete' => 'SMSApi\Api\Action\Sms\Delete',
49
+ 'smsapiapiuserfactory' => 'SMSApi\Api\UserFactory',
50
+ 'smsapiapiactionuseradd' => 'SMSApi\Api\Action\User\Add',
51
+ 'smsapiapiresponseuserresponse' => 'SMSApi\Api\Response\UserResponse',
52
+ 'smsapiapiactionuserget' => 'SMSApi\Api\Action\User\Get',
53
+ 'smsapiapiactionuseredit' => 'SMSApi\Api\Action\User\Edit',
54
+ 'smsapiapiactionusergetpoints' => 'SMSApi\Api\Action\User\GetPoints',
55
+ 'smsapiapiactionuseruserlist' => 'SMSApi\Api\Action\User\UserList',
56
+ 'smsapiapiresponseusersresponse' => 'SMSApi\Api\Response\UsersResponse',
57
+ 'smsapiapivmsfactory' => 'SMSApi\Api\VmsFactory',
58
+ 'smsapiapiactionvmssend' => 'SMSApi\Api\Action\Vms\Send',
59
+ 'smsapiexceptionsmsapiexception' => 'SMSApi\Exception\SmsapiException',
60
+ 'smsapiexceptionhostexception' => 'SMSApi\Exception\HostException',
61
+ 'smsapiexceptionactionexception' => 'SMSApi\Exception\ActionException',
62
+ 'smsapiexceptionclientexception' => 'SMSApi\Exception\ClientException',
63
+ 'smsapiexceptionproxyexception' => 'SMSApi\Exception\ProxyException',
64
+ 'smsapiapiactionvmsget' => 'SMSApi\Api\Action\Vms\Get',
65
+ 'smsapiapiactionvmsdelete' => 'SMSApi\Api\Action\Vms\Delete',
66
+ );
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer' . '/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit87dd85b0c04a029403b47e08c05f5d7f::getLoader();
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0 class loader
17
+ *
18
+ * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
19
+ *
20
+ * $loader = new \Composer\Autoload\ClassLoader();
21
+ *
22
+ * // register classes with namespaces
23
+ * $loader->add('Symfony\Component', __DIR__.'/component');
24
+ * $loader->add('Symfony', __DIR__.'/framework');
25
+ *
26
+ * // activate the autoloader
27
+ * $loader->register();
28
+ *
29
+ * // to enable searching the include path (eg. for PEAR packages)
30
+ * $loader->setUseIncludePath(true);
31
+ *
32
+ * In this example, if you try to use a class in the Symfony\Component
33
+ * namespace or one of its children (Symfony\Component\Console for instance),
34
+ * the autoloader will first look for the class under the component/
35
+ * directory, and it will then fallback to the framework/ directory if not
36
+ * found before giving up.
37
+ *
38
+ * This class is loosely based on the Symfony UniversalClassLoader.
39
+ *
40
+ * @author Fabien Potencier <fabien@symfony.com>
41
+ * @author Jordi Boggiano <j.boggiano@seld.be>
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+
57
+ private $classMapAuthoritative = false;
58
+
59
+ public function getPrefixes()
60
+ {
61
+ if (!empty($this->prefixesPsr0)) {
62
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
63
+ }
64
+
65
+ return array();
66
+ }
67
+
68
+ public function getPrefixesPsr4()
69
+ {
70
+ return $this->prefixDirsPsr4;
71
+ }
72
+
73
+ public function getFallbackDirs()
74
+ {
75
+ return $this->fallbackDirsPsr0;
76
+ }
77
+
78
+ public function getFallbackDirsPsr4()
79
+ {
80
+ return $this->fallbackDirsPsr4;
81
+ }
82
+
83
+ public function getClassMap()
84
+ {
85
+ return $this->classMap;
86
+ }
87
+
88
+ /**
89
+ * @param array $classMap Class to filename map
90
+ */
91
+ public function addClassMap(array $classMap)
92
+ {
93
+ if ($this->classMap) {
94
+ $this->classMap = array_merge($this->classMap, $classMap);
95
+ } else {
96
+ $this->classMap = $classMap;
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Registers a set of PSR-0 directories for a given prefix, either
102
+ * appending or prepending to the ones previously set for this prefix.
103
+ *
104
+ * @param string $prefix The prefix
105
+ * @param array|string $paths The PSR-0 root directories
106
+ * @param bool $prepend Whether to prepend the directories
107
+ */
108
+ public function add($prefix, $paths, $prepend = false)
109
+ {
110
+ if (!$prefix) {
111
+ if ($prepend) {
112
+ $this->fallbackDirsPsr0 = array_merge(
113
+ (array) $paths,
114
+ $this->fallbackDirsPsr0
115
+ );
116
+ } else {
117
+ $this->fallbackDirsPsr0 = array_merge(
118
+ $this->fallbackDirsPsr0,
119
+ (array) $paths
120
+ );
121
+ }
122
+
123
+ return;
124
+ }
125
+
126
+ $first = $prefix[0];
127
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
+
130
+ return;
131
+ }
132
+ if ($prepend) {
133
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
134
+ (array) $paths,
135
+ $this->prefixesPsr0[$first][$prefix]
136
+ );
137
+ } else {
138
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
139
+ $this->prefixesPsr0[$first][$prefix],
140
+ (array) $paths
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Registers a set of PSR-4 directories for a given namespace, either
147
+ * appending or prepending to the ones previously set for this namespace.
148
+ *
149
+ * @param string $prefix The prefix/namespace, with trailing '\\'
150
+ * @param array|string $paths The PSR-0 base directories
151
+ * @param bool $prepend Whether to prepend the directories
152
+ *
153
+ * @throws \InvalidArgumentException
154
+ */
155
+ public function addPsr4($prefix, $paths, $prepend = false)
156
+ {
157
+ if (!$prefix) {
158
+ // Register directories for the root namespace.
159
+ if ($prepend) {
160
+ $this->fallbackDirsPsr4 = array_merge(
161
+ (array) $paths,
162
+ $this->fallbackDirsPsr4
163
+ );
164
+ } else {
165
+ $this->fallbackDirsPsr4 = array_merge(
166
+ $this->fallbackDirsPsr4,
167
+ (array) $paths
168
+ );
169
+ }
170
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
+ // Register directories for a new namespace.
172
+ $length = strlen($prefix);
173
+ if ('\\' !== $prefix[$length - 1]) {
174
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
+ }
176
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
+ } elseif ($prepend) {
179
+ // Prepend directories for an already registered namespace.
180
+ $this->prefixDirsPsr4[$prefix] = array_merge(
181
+ (array) $paths,
182
+ $this->prefixDirsPsr4[$prefix]
183
+ );
184
+ } else {
185
+ // Append directories for an already registered namespace.
186
+ $this->prefixDirsPsr4[$prefix] = array_merge(
187
+ $this->prefixDirsPsr4[$prefix],
188
+ (array) $paths
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Registers a set of PSR-0 directories for a given prefix,
195
+ * replacing any others previously set for this prefix.
196
+ *
197
+ * @param string $prefix The prefix
198
+ * @param array|string $paths The PSR-0 base directories
199
+ */
200
+ public function set($prefix, $paths)
201
+ {
202
+ if (!$prefix) {
203
+ $this->fallbackDirsPsr0 = (array) $paths;
204
+ } else {
205
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Registers a set of PSR-4 directories for a given namespace,
211
+ * replacing any others previously set for this namespace.
212
+ *
213
+ * @param string $prefix The prefix/namespace, with trailing '\\'
214
+ * @param array|string $paths The PSR-4 base directories
215
+ *
216
+ * @throws \InvalidArgumentException
217
+ */
218
+ public function setPsr4($prefix, $paths)
219
+ {
220
+ if (!$prefix) {
221
+ $this->fallbackDirsPsr4 = (array) $paths;
222
+ } else {
223
+ $length = strlen($prefix);
224
+ if ('\\' !== $prefix[$length - 1]) {
225
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
+ }
227
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Turns on searching the include path for class files.
234
+ *
235
+ * @param bool $useIncludePath
236
+ */
237
+ public function setUseIncludePath($useIncludePath)
238
+ {
239
+ $this->useIncludePath = $useIncludePath;
240
+ }
241
+
242
+ /**
243
+ * Can be used to check if the autoloader uses the include path to check
244
+ * for classes.
245
+ *
246
+ * @return bool
247
+ */
248
+ public function getUseIncludePath()
249
+ {
250
+ return $this->useIncludePath;
251
+ }
252
+
253
+ /**
254
+ * Turns off searching the prefix and fallback directories for classes
255
+ * that have not been registered with the class map.
256
+ *
257
+ * @param bool $classMapAuthoritative
258
+ */
259
+ public function setClassMapAuthoritative($classMapAuthoritative)
260
+ {
261
+ $this->classMapAuthoritative = $classMapAuthoritative;
262
+ }
263
+
264
+ /**
265
+ * Should class lookup fail if not found in the current class map?
266
+ *
267
+ * @return bool
268
+ */
269
+ public function isClassMapAuthoritative()
270
+ {
271
+ return $this->classMapAuthoritative;
272
+ }
273
+
274
+ /**
275
+ * Registers this instance as an autoloader.
276
+ *
277
+ * @param bool $prepend Whether to prepend the autoloader or not
278
+ */
279
+ public function register($prepend = false)
280
+ {
281
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
+ }
283
+
284
+ /**
285
+ * Unregisters this instance as an autoloader.
286
+ */
287
+ public function unregister()
288
+ {
289
+ spl_autoload_unregister(array($this, 'loadClass'));
290
+ }
291
+
292
+ /**
293
+ * Loads the given class or interface.
294
+ *
295
+ * @param string $class The name of the class
296
+ * @return bool|null True if loaded, null otherwise
297
+ */
298
+ public function loadClass($class)
299
+ {
300
+ if ($file = $this->findFile($class)) {
301
+ includeFile($file);
302
+
303
+ return true;
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Finds the path to the file where the class is defined.
309
+ *
310
+ * @param string $class The name of the class
311
+ *
312
+ * @return string|false The path if found, false otherwise
313
+ */
314
+ public function findFile($class)
315
+ {
316
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
+ if ('\\' == $class[0]) {
318
+ $class = substr($class, 1);
319
+ }
320
+
321
+ // class map lookup
322
+ if (isset($this->classMap[$class])) {
323
+ return $this->classMap[$class];
324
+ }
325
+ if ($this->classMapAuthoritative) {
326
+ return false;
327
+ }
328
+
329
+ $file = $this->findFileWithExtension($class, '.php');
330
+
331
+ // Search for Hack files if we are running on HHVM
332
+ if ($file === null && defined('HHVM_VERSION')) {
333
+ $file = $this->findFileWithExtension($class, '.hh');
334
+ }
335
+
336
+ if ($file === null) {
337
+ // Remember that this class does not exist.
338
+ return $this->classMap[$class] = false;
339
+ }
340
+
341
+ return $file;
342
+ }
343
+
344
+ private function findFileWithExtension($class, $ext)
345
+ {
346
+ // PSR-4 lookup
347
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
+
349
+ $first = $class[0];
350
+ if (isset($this->prefixLengthsPsr4[$first])) {
351
+ foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
+ if (0 === strpos($class, $prefix)) {
353
+ foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
+ return $file;
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ // PSR-4 fallback dirs
363
+ foreach ($this->fallbackDirsPsr4 as $dir) {
364
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
+ return $file;
366
+ }
367
+ }
368
+
369
+ // PSR-0 lookup
370
+ if (false !== $pos = strrpos($class, '\\')) {
371
+ // namespaced class name
372
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
+ } else {
375
+ // PEAR-like class name
376
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
+ }
378
+
379
+ if (isset($this->prefixesPsr0[$first])) {
380
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
+ if (0 === strpos($class, $prefix)) {
382
+ foreach ($dirs as $dir) {
383
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
+ return $file;
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ // PSR-0 fallback dirs
392
+ foreach ($this->fallbackDirsPsr0 as $dir) {
393
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
+ return $file;
395
+ }
396
+ }
397
+
398
+ // PSR-0 include paths.
399
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
+ return $file;
401
+ }
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Scope isolated include.
407
+ *
408
+ * Prevents access to $this/self from included files.
409
+ */
410
+ function includeFile($file)
411
+ {
412
+ include $file;
413
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) 2015 Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'SMSApi\\Api\\ActionFactory' => $baseDir . '/smsapi/Api/ActionFactory.php',
10
+ 'SMSApi\\Api\\Action\\AbstractAction' => $baseDir . '/smsapi/Api/Action/AbstractAction.php',
11
+ 'SMSApi\\Api\\Action\\Contacts\\ContactAdd' => $baseDir . '/smsapi/Api/Action/Contacts/ContactAdd.php',
12
+ 'SMSApi\\Api\\Action\\Contacts\\ContactAddByEmail' => $baseDir . '/smsapi/Api/Action/Contacts/ContactAddByEmail.php',
13
+ 'SMSApi\\Api\\Action\\Contacts\\ContactAddByPhoneNumber' => $baseDir . '/smsapi/Api/Action/Contacts/ContactAddByPhoneNumber.php',
14
+ 'SMSApi\\Api\\Action\\Contacts\\ContactCount' => $baseDir . '/smsapi/Api/Action/Contacts/ContactCount.php',
15
+ 'SMSApi\\Api\\Action\\Contacts\\ContactDelete' => $baseDir . '/smsapi/Api/Action/Contacts/ContactDelete.php',
16
+ 'SMSApi\\Api\\Action\\Contacts\\ContactDeleteMultiple' => $baseDir . '/smsapi/Api/Action/Contacts/ContactDeleteMultiple.php',
17
+ 'SMSApi\\Api\\Action\\Contacts\\ContactEdit' => $baseDir . '/smsapi/Api/Action/Contacts/ContactEdit.php',
18
+ 'SMSApi\\Api\\Action\\Contacts\\ContactGet' => $baseDir . '/smsapi/Api/Action/Contacts/ContactGet.php',
19
+ 'SMSApi\\Api\\Action\\Contacts\\ContactGroupAdd' => $baseDir . '/smsapi/Api/Action/Contacts/ContactGroupAdd.php',
20
+ 'SMSApi\\Api\\Action\\Contacts\\ContactGroupDelete' => $baseDir . '/smsapi/Api/Action/Contacts/ContactGroupDelete.php',
21
+ 'SMSApi\\Api\\Action\\Contacts\\ContactGroupGet' => $baseDir . '/smsapi/Api/Action/Contacts/ContactGroupGet.php',
22
+ 'SMSApi\\Api\\Action\\Contacts\\ContactGroupList' => $baseDir . '/smsapi/Api/Action/Contacts/ContactGroupList.php',
23
+ 'SMSApi\\Api\\Action\\Contacts\\ContactList' => $baseDir . '/smsapi/Api/Action/Contacts/ContactList.php',
24
+ 'SMSApi\\Api\\Action\\Contacts\\ContactsAction' => $baseDir . '/smsapi/Api/Action/Contacts/ContactsAction.php',
25
+ 'SMSApi\\Api\\Action\\Contacts\\FieldAdd' => $baseDir . '/smsapi/Api/Action/Contacts/FieldAdd.php',
26
+ 'SMSApi\\Api\\Action\\Contacts\\FieldDelete' => $baseDir . '/smsapi/Api/Action/Contacts/FieldDelete.php',
27
+ 'SMSApi\\Api\\Action\\Contacts\\FieldEdit' => $baseDir . '/smsapi/Api/Action/Contacts/FieldEdit.php',
28
+ 'SMSApi\\Api\\Action\\Contacts\\FieldList' => $baseDir . '/smsapi/Api/Action/Contacts/FieldList.php',
29
+ 'SMSApi\\Api\\Action\\Contacts\\GroupAdd' => $baseDir . '/smsapi/Api/Action/Contacts/GroupAdd.php',
30
+ 'SMSApi\\Api\\Action\\Contacts\\GroupDelete' => $baseDir . '/smsapi/Api/Action/Contacts/GroupDelete.php',
31
+ 'SMSApi\\Api\\Action\\Contacts\\GroupEdit' => $baseDir . '/smsapi/Api/Action/Contacts/GroupEdit.php',
32
+ 'SMSApi\\Api\\Action\\Contacts\\GroupGet' => $baseDir . '/smsapi/Api/Action/Contacts/GroupGet.php',
33
+ 'SMSApi\\Api\\Action\\Contacts\\GroupList' => $baseDir . '/smsapi/Api/Action/Contacts/GroupList.php',
34
+ 'SMSApi\\Api\\Action\\Contacts\\GroupMemberAdd' => $baseDir . '/smsapi/Api/Action/Contacts/GroupMemberAdd.php',
35
+ 'SMSApi\\Api\\Action\\Contacts\\GroupMemberDelete' => $baseDir . '/smsapi/Api/Action/Contacts/GroupMemberDelete.php',
36
+ 'SMSApi\\Api\\Action\\Contacts\\GroupMemberGet' => $baseDir . '/smsapi/Api/Action/Contacts/GroupMemberGet.php',
37
+ 'SMSApi\\Api\\Action\\Contacts\\GroupPermissionAdd' => $baseDir . '/smsapi/Api/Action/Contacts/GroupPermissionAdd.php',
38
+ 'SMSApi\\Api\\Action\\Contacts\\GroupPermissionDelete' => $baseDir . '/smsapi/Api/Action/Contacts/GroupPermissionDelete.php',
39
+ 'SMSApi\\Api\\Action\\Contacts\\GroupPermissionEdit' => $baseDir . '/smsapi/Api/Action/Contacts/GroupPermissionEdit.php',
40
+ 'SMSApi\\Api\\Action\\Contacts\\GroupPermissionGet' => $baseDir . '/smsapi/Api/Action/Contacts/GroupPermissionGet.php',
41
+ 'SMSApi\\Api\\Action\\Contacts\\GroupPermissionList' => $baseDir . '/smsapi/Api/Action/Contacts/GroupPermissionList.php',
42
+ 'SMSApi\\Api\\Action\\Mms\\Delete' => $baseDir . '/smsapi/Api/Action/Mms/Delete.php',
43
+ 'SMSApi\\Api\\Action\\Mms\\Get' => $baseDir . '/smsapi/Api/Action/Mms/Get.php',
44
+ 'SMSApi\\Api\\Action\\Mms\\Send' => $baseDir . '/smsapi/Api/Action/Mms/Send.php',
45
+ 'SMSApi\\Api\\Action\\Phonebook\\ContactAdd' => $baseDir . '/smsapi/Api/Action/Phonebook/ContactAdd.php',
46
+ 'SMSApi\\Api\\Action\\Phonebook\\ContactDelete' => $baseDir . '/smsapi/Api/Action/Phonebook/ContactDelete.php',
47
+ 'SMSApi\\Api\\Action\\Phonebook\\ContactEdit' => $baseDir . '/smsapi/Api/Action/Phonebook/ContactEdit.php',
48
+ 'SMSApi\\Api\\Action\\Phonebook\\ContactGet' => $baseDir . '/smsapi/Api/Action/Phonebook/ContactGet.php',
49
+ 'SMSApi\\Api\\Action\\Phonebook\\ContactList' => $baseDir . '/smsapi/Api/Action/Phonebook/ContactList.php',
50
+ 'SMSApi\\Api\\Action\\Phonebook\\GroupAdd' => $baseDir . '/smsapi/Api/Action/Phonebook/GroupAdd.php',
51
+ 'SMSApi\\Api\\Action\\Phonebook\\GroupDelete' => $baseDir . '/smsapi/Api/Action/Phonebook/GroupDelete.php',
52
+ 'SMSApi\\Api\\Action\\Phonebook\\GroupEdit' => $baseDir . '/smsapi/Api/Action/Phonebook/GroupEdit.php',
53
+ 'SMSApi\\Api\\Action\\Phonebook\\GroupGet' => $baseDir . '/smsapi/Api/Action/Phonebook/GroupGet.php',
54
+ 'SMSApi\\Api\\Action\\Phonebook\\GroupList' => $baseDir . '/smsapi/Api/Action/Phonebook/GroupList.php',
55
+ 'SMSApi\\Api\\Action\\Sender\\Add' => $baseDir . '/smsapi/Api/Action/Sender/Add.php',
56
+ 'SMSApi\\Api\\Action\\Sender\\Delete' => $baseDir . '/smsapi/Api/Action/Sender/Delete.php',
57
+ 'SMSApi\\Api\\Action\\Sender\\SenderDefault' => $baseDir . '/smsapi/Api/Action/Sender/SenderDefault.php',
58
+ 'SMSApi\\Api\\Action\\Sender\\SenderList' => $baseDir . '/smsapi/Api/Action/Sender/SenderList.php',
59
+ 'SMSApi\\Api\\Action\\Sms\\Delete' => $baseDir . '/smsapi/Api/Action/Sms/Delete.php',
60
+ 'SMSApi\\Api\\Action\\Sms\\Get' => $baseDir . '/smsapi/Api/Action/Sms/Get.php',
61
+ 'SMSApi\\Api\\Action\\Sms\\Send' => $baseDir . '/smsapi/Api/Action/Sms/Send.php',
62
+ 'SMSApi\\Api\\Action\\User\\Add' => $baseDir . '/smsapi/Api/Action/User/Add.php',
63
+ 'SMSApi\\Api\\Action\\User\\Edit' => $baseDir . '/smsapi/Api/Action/User/Edit.php',
64
+ 'SMSApi\\Api\\Action\\User\\Get' => $baseDir . '/smsapi/Api/Action/User/Get.php',
65
+ 'SMSApi\\Api\\Action\\User\\GetPoints' => $baseDir . '/smsapi/Api/Action/User/GetPoints.php',
66
+ 'SMSApi\\Api\\Action\\User\\UserList' => $baseDir . '/smsapi/Api/Action/User/UserList.php',
67
+ 'SMSApi\\Api\\Action\\Vms\\Delete' => $baseDir . '/smsapi/Api/Action/Vms/Delete.php',
68
+ 'SMSApi\\Api\\Action\\Vms\\Get' => $baseDir . '/smsapi/Api/Action/Vms/Get.php',
69
+ 'SMSApi\\Api\\Action\\Vms\\Send' => $baseDir . '/smsapi/Api/Action/Vms/Send.php',
70
+ 'SMSApi\\Api\\ContactsFactory' => $baseDir . '/smsapi/Api/ContactsFactory.php',
71
+ 'SMSApi\\Api\\MmsFactory' => $baseDir . '/smsapi/Api/MmsFactory.php',
72
+ 'SMSApi\\Api\\PhonebookFactory' => $baseDir . '/smsapi/Api/PhonebookFactory.php',
73
+ 'SMSApi\\Api\\Response\\AbstractResponse' => $baseDir . '/smsapi/Api/Response/AbstractResponse.php',
74
+ 'SMSApi\\Api\\Response\\ContactResponse' => $baseDir . '/smsapi/Api/Response/ContactResponse.php',
75
+ 'SMSApi\\Api\\Response\\ContactsResponse' => $baseDir . '/smsapi/Api/Response/ContactsResponse.php',
76
+ 'SMSApi\\Api\\Response\\Contacts\\AbstractContactsResponse' => $baseDir . '/smsapi/Api/Response/Contacts/AbstractContactsResponse.php',
77
+ 'SMSApi\\Api\\Response\\Contacts\\ContactResponse' => $baseDir . '/smsapi/Api/Response/Contacts/ContactResponse.php',
78
+ 'SMSApi\\Api\\Response\\Contacts\\ContactsResponse' => $baseDir . '/smsapi/Api/Response/Contacts/ContactsResponse.php',
79
+ 'SMSApi\\Api\\Response\\Contacts\\CountableResponse' => $baseDir . '/smsapi/Api/Response/Contacts/CountableResponse.php',
80
+ 'SMSApi\\Api\\Response\\Contacts\\DeleteResponse' => $baseDir . '/smsapi/Api/Response/Contacts/DeleteResponse.php',
81
+ 'SMSApi\\Api\\Response\\Contacts\\FieldResponse' => $baseDir . '/smsapi/Api/Response/Contacts/FieldResponse.php',
82
+ 'SMSApi\\Api\\Response\\Contacts\\FieldsResponse' => $baseDir . '/smsapi/Api/Response/Contacts/FieldsResponse.php',
83
+ 'SMSApi\\Api\\Response\\Contacts\\GroupResponse' => $baseDir . '/smsapi/Api/Response/Contacts/GroupResponse.php',
84
+ 'SMSApi\\Api\\Response\\Contacts\\GroupsResponse' => $baseDir . '/smsapi/Api/Response/Contacts/GroupsResponse.php',
85
+ 'SMSApi\\Api\\Response\\Contacts\\IdentifiableResponse' => $baseDir . '/smsapi/Api/Response/Contacts/IdentifiableResponse.php',
86
+ 'SMSApi\\Api\\Response\\Contacts\\ListResponse' => $baseDir . '/smsapi/Api/Response/Contacts/ListResponse.php',
87
+ 'SMSApi\\Api\\Response\\Contacts\\PermissionResponse' => $baseDir . '/smsapi/Api/Response/Contacts/PermissionResponse.php',
88
+ 'SMSApi\\Api\\Response\\Contacts\\PermissionsResponse' => $baseDir . '/smsapi/Api/Response/Contacts/PermissionsResponse.php',
89
+ 'SMSApi\\Api\\Response\\Contacts\\SizeResponse' => $baseDir . '/smsapi/Api/Response/Contacts/SizeResponse.php',
90
+ 'SMSApi\\Api\\Response\\CountableResponse' => $baseDir . '/smsapi/Api/Response/CountableResponse.php',
91
+ 'SMSApi\\Api\\Response\\ErrorResponse' => $baseDir . '/smsapi/Api/Response/ErrorResponse.php',
92
+ 'SMSApi\\Api\\Response\\GroupResponse' => $baseDir . '/smsapi/Api/Response/GroupResponse.php',
93
+ 'SMSApi\\Api\\Response\\GroupsResponse' => $baseDir . '/smsapi/Api/Response/GroupsResponse.php',
94
+ 'SMSApi\\Api\\Response\\MessageResponse' => $baseDir . '/smsapi/Api/Response/MessageResponse.php',
95
+ 'SMSApi\\Api\\Response\\PointsResponse' => $baseDir . '/smsapi/Api/Response/PointsResponse.php',
96
+ 'SMSApi\\Api\\Response\\RawResponse' => $baseDir . '/smsapi/Api/Response/RawResponse.php',
97
+ 'SMSApi\\Api\\Response\\Response' => $baseDir . '/smsapi/Api/Response/Response.php',
98
+ 'SMSApi\\Api\\Response\\SenderResponse' => $baseDir . '/smsapi/Api/Response/SenderResponse.php',
99
+ 'SMSApi\\Api\\Response\\SendersResponse' => $baseDir . '/smsapi/Api/Response/SendersResponse.php',
100
+ 'SMSApi\\Api\\Response\\StatusResponse' => $baseDir . '/smsapi/Api/Response/StatusResponse.php',
101
+ 'SMSApi\\Api\\Response\\UserResponse' => $baseDir . '/smsapi/Api/Response/UserResponse.php',
102
+ 'SMSApi\\Api\\Response\\UsersResponse' => $baseDir . '/smsapi/Api/Response/UsersResponse.php',
103
+ 'SMSApi\\Api\\SenderFactory' => $baseDir . '/smsapi/Api/SenderFactory.php',
104
+ 'SMSApi\\Api\\SmsFactory' => $baseDir . '/smsapi/Api/SmsFactory.php',
105
+ 'SMSApi\\Api\\UserFactory' => $baseDir . '/smsapi/Api/UserFactory.php',
106
+ 'SMSApi\\Api\\VmsFactory' => $baseDir . '/smsapi/Api/VmsFactory.php',
107
+ 'SMSApi\\Client' => $baseDir . '/smsapi/Client.php',
108
+ 'SMSApi\\Exception\\ActionException' => $baseDir . '/smsapi/Exception/ActionException.php',
109
+ 'SMSApi\\Exception\\ClientException' => $baseDir . '/smsapi/Exception/ClientException.php',
110
+ 'SMSApi\\Exception\\ContactsException' => $baseDir . '/smsapi/Exception/ContactsException.php',
111
+ 'SMSApi\\Exception\\HostException' => $baseDir . '/smsapi/Exception/HostException.php',
112
+ 'SMSApi\\Exception\\InvalidParameterException' => $baseDir . '/smsapi/Exception/InvalidParameterException.php',
113
+ 'SMSApi\\Exception\\ProxyException' => $baseDir . '/smsapi/Exception/ProxyException.php',
114
+ 'SMSApi\\Exception\\SmsapiException' => $baseDir . '/smsapi/Exception/SmsapiException.php',
115
+ 'SMSApi\\Proxy\\Http\\AbstractHttp' => $baseDir . '/smsapi/Proxy/Http/AbstractHttp.php',
116
+ 'SMSApi\\Proxy\\Http\\Curl' => $baseDir . '/smsapi/Proxy/Http/Curl.php',
117
+ 'SMSApi\\Proxy\\Http\\Native' => $baseDir . '/smsapi/Proxy/Http/Native.php',
118
+ 'SMSApi\\Proxy\\Proxy' => $baseDir . '/smsapi/Proxy/Proxy.php',
119
+ 'SMSApi\\Proxy\\Uri' => $baseDir . '/smsapi/Proxy/Uri.php',
120
+ );
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'SMSApi\\' => array($baseDir . '/smsapi'),
10
+ );
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit87dd85b0c04a029403b47e08c05f5d7f
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInit87dd85b0c04a029403b47e08c05f5d7f', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit87dd85b0c04a029403b47e08c05f5d7f', 'loadClassLoader'));
25
+
26
+ $map = require __DIR__ . '/autoload_namespaces.php';
27
+ foreach ($map as $namespace => $path) {
28
+ $loader->set($namespace, $path);
29
+ }
30
+
31
+ $map = require __DIR__ . '/autoload_psr4.php';
32
+ foreach ($map as $namespace => $path) {
33
+ $loader->setPsr4($namespace, $path);
34
+ }
35
+
36
+ $classMap = require __DIR__ . '/autoload_classmap.php';
37
+ if ($classMap) {
38
+ $loader->addClassMap($classMap);
39
+ }
40
+
41
+ $loader->register(true);
42
+
43
+ return $loader;
44
+ }
45
+ }
46
+
47
+ function composerRequire87dd85b0c04a029403b47e08c05f5d7f($file)
48
+ {
49
+ require $file;
50
+ }
app/code/community/Smsapi/Sms/vendor/smsapi-client/vendor/composer/installed.json ADDED
@@ -0,0 +1 @@
 
1
+ []
app/locale/pl_PL/Smsapi_Sms.csv CHANGED
@@ -74,6 +74,8 @@
74
 
75
  "SMS notification sent", "Powiadomienie SMS zostało wysłane"
76
 
77
- "SMS notification error", "Błąd wysyłki powiadomienia sms",
78
 
79
- "You have used {TRACKINGNUMBER} variable but tracking number is not defined. Please delete {TRACKINGNUMBER} variable from the message.", "W wiadomości została użyta zmienna {TRACKINGNUMBER}, która nie jest zdefiniowana. Proszę usuń tę zmienną z wiadomości."
 
 
74
 
75
  "SMS notification sent", "Powiadomienie SMS zostało wysłane"
76
 
77
+ "SMS notification error", "Błąd wysyłki powiadomienia sms"
78
 
79
+ "You have used {TRACKINGNUMBER} variable but tracking number is not defined. Please delete {TRACKINGNUMBER} variable from the message.", "W wiadomości została użyta zmienna {TRACKINGNUMBER}, która nie jest zdefiniowana. Proszę usuń tę zmienną z wiadomości."
80
+
81
+ "Authorization fail", "Błąd autoryzacji"
package.xml CHANGED
@@ -1,20 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Smsapi_Sms</name>
4
- <version>0.1.3</version>
5
  <stability>stable</stability>
6
- <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>SMS Plugin</summary>
10
  <description>SMSAPI Module for Magento-based stores enables automatic send SMS notifications to customers. SMS communication has many benefits including facilitates communication with your customers and speeds up reaching the details of the order. Short text messages are sent primarily as information on the status of the order, such as a message confirming the correct course of a transaction or message about delivery time of orders. SMS is fastest communication with your customers, and savings for the company due to reduced costs associated with undelivered shipments. SMS notifications in Magento module can be sent from the field in active sender SMSAPI account. Content templates are fully editable.</description>
11
- <notes>+ message box in order&#xD;
12
- + change status code to status name in sms&#xD;
13
- + add sms at status "pending"</notes>
 
14
  <authors><author><name>SMSAPI</name><user>SMSAPI</user><email>bok@smsapi.pl</email></author></authors>
15
- <date>2015-10-22</date>
16
- <time>13:38:13</time>
17
- <contents><target name="magecommunity"><dir name="Smsapi"><dir name="Sms"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Branding.php" hash="0dbad05e38f0755b06aa30a61c22af62"/></dir></dir></dir></dir><file name="Buttons.php" hash="9c3419026c5a9e89ccd6d0203faeee51"/><dir name="sales"><dir name="order"><dir name="view"><file name="Info.php" hash="63734807fafe6bfbbccc1a4aeb9333ea"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c9f5c5eda233f035bf8d44d5bdf040ea"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Attributes.php" hash="daec22c1bf38a90c4cce45a264f82516"/></dir><file name="ApiClient.php" hash="74ab753538d8effa2d837ac50ebb9b40"/><file name="Config.php" hash="e19170fc3519ba96493770096f730ba0"/><file name="Observer.php" hash="8d33275d5b8fc642b6ef1e01277a06dc"/></dir><dir name="controllers"><file name="IndexController.php" hash="7fe68c78eeca4a1a290276d55fd90da9"/></dir><dir name="etc"><file name="config.xml" hash="6070fc60aff325ea97641afeba804c78"/><file name="system.xml" hash="9e9784ffacd82d993fc9a521bfb8445b"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sms"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="6424a69999cb16dbd56c087e798f1e80"/></dir></dir></dir></dir></dir><dir name="layout"><file name="smsapi_sms.xml" hash="d3e85084ec20b0f180b2be0787f7975d"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smsapi_Sms.xml" hash="4e65007f9573a00788a27745861bcaab"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Smsapi_Sms.csv" hash="8654b78e7a429dd084ffa671a1600685"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Smsapi_Sms</name>
4
+ <version>0.2.0</version>
5
  <stability>stable</stability>
6
+ <license>Open Source License</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>SMS Notifications</summary>
10
  <description>SMSAPI Module for Magento-based stores enables automatic send SMS notifications to customers. SMS communication has many benefits including facilitates communication with your customers and speeds up reaching the details of the order. Short text messages are sent primarily as information on the status of the order, such as a message confirming the correct course of a transaction or message about delivery time of orders. SMS is fastest communication with your customers, and savings for the company due to reduced costs associated with undelivered shipments. SMS notifications in Magento module can be sent from the field in active sender SMSAPI account. Content templates are fully editable.</description>
11
+ <notes>+ fix low balance notification&#xD;
12
+ + add smsapi.pl or smsapi.pl switching&#xD;
13
+ + remove test mode&#xD;
14
+ + change soap to rest interface</notes>
15
  <authors><author><name>SMSAPI</name><user>SMSAPI</user><email>bok@smsapi.pl</email></author></authors>
16
+ <date>2015-10-29</date>
17
+ <time>12:30:26</time>
18
+ <contents><target name="magecommunity"><dir name="Smsapi"><dir name="Sms"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Branding.php" hash="0dbad05e38f0755b06aa30a61c22af62"/></dir></dir></dir></dir><file name="Buttons.php" hash="9c3419026c5a9e89ccd6d0203faeee51"/><dir name="sales"><dir name="order"><dir name="view"><file name="Info.php" hash="63734807fafe6bfbbccc1a4aeb9333ea"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c9f5c5eda233f035bf8d44d5bdf040ea"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Attributes.php" hash="208bdbe6f05705e77e54e43ff3eb5db5"/><file name="Balancelow.php" hash="11c2367a8d24e67a63d3d85e2873fb97"/><file name="Version.php" hash="a62ba0e54eb53b1c0eff9c21565928d6"/></dir><file name="Config.php" hash="31121f477b91b0e1b66964c96b49e27c"/><file name="Observer.php" hash="21086a398fb56a809082ef41eeda6c71"/></dir><dir name="controllers"><file name="IndexController.php" hash="2487bbd2b9e671bb07991c8fac02f42f"/></dir><dir name="etc"><file name="config.xml" hash="28dc24f90b3861a1002862acce3c3c2f"/><file name="system.xml" hash="9582bdb02a3ffc74e58a6be515f81db6"/></dir><dir name="smsapi-classes"><file name="AbstractsSmsapi.php" hash="e6da5f096b9356ecba80eb6584079f27"/><file name="Sender.php" hash="9ea1ac1c2d211f3d61f9e6ba53814f27"/><file name="SenderFactory.php" hash="e4a51364f88f7c0ff10f754542db8c15"/><file name="Sms.php" hash="19034101391c6fd99c2819de8bef7fcd"/><file name="SmsFactory.php" hash="b8b0dd0c1ef0e2e0c09655d610539325"/><file name="User.php" hash="e0188b5bcc2b0b819b326b3636007712"/><file name="UserFactory.php" hash="2d966b2c954b9481dce0ca5d12fd708e"/></dir><dir name="vendor"><dir name="smsapi-client"><dir name="smsapi"><dir name="Api"><dir name="Action"><file name="AbstractAction.php" hash="4dfb1b55903c2c6c6b3c88d52ea0fae0"/><dir name="Contacts"><file name="ContactAdd.php" hash="3aac77aedc9a73ff3f53b7921b24cdd4"/><file name="ContactAddByEmail.php" hash="6f00f85f46fe35773d077fd716251fbe"/><file name="ContactAddByPhoneNumber.php" hash="2458fb2047349d33c4023555a6b311ab"/><file name="ContactCount.php" hash="b92171dc1eb6fb92ed2e56c85a5711c2"/><file name="ContactDelete.php" hash="c1e62bd34d52058e52a6384858d83a0a"/><file name="ContactDeleteMultiple.php" hash="2231d070a071d3620c2bbf92ddf8ea2f"/><file name="ContactEdit.php" hash="445e4d39f13a6415492da4a64ee9ca1d"/><file name="ContactGet.php" hash="c8b6bb67a4954493b8fcbdb3d041d409"/><file name="ContactGroupAdd.php" hash="9316ca78ca45aa394f5e2208c6ed8411"/><file name="ContactGroupDelete.php" hash="b91a53ce8737b7cd39bef27cf3110f22"/><file name="ContactGroupGet.php" hash="bf1f60a8aeb67d2843711f410cac06d1"/><file name="ContactGroupList.php" hash="b017c6766b89f48cb620c242d1a3e6f6"/><file name="ContactList.php" hash="c4188e874fbb29dd3b235fff8f1cb76c"/><file name="ContactsAction.php" hash="7e252b972377c021c44aa8257f38c98a"/><file name="FieldAdd.php" hash="57113acf36bd5ca6a155dfd2b427cc6f"/><file name="FieldDelete.php" hash="5b1352a4a5760c6066dbd4331910bd1b"/><file name="FieldEdit.php" hash="a3feb1ea5c6b5856cd5697ef89256d91"/><file name="FieldList.php" hash="118016f4066f2b359c594e33510585c3"/><file name="GroupAdd.php" hash="caee3dc125a9206bc3fabc2bc01a4eb9"/><file name="GroupDelete.php" hash="c5b58ecce0461c6c0e18f0449617e64c"/><file name="GroupEdit.php" hash="12242218db3be6f7bdf28cae985e11a7"/><file name="GroupGet.php" hash="caf71acffc6eefb05806d1229752960f"/><file name="GroupList.php" hash="22de8cbdc64a82f81ee89e002dbb5a7c"/><file name="GroupMemberAdd.php" hash="cecbb6beada504af0e9361e1b60d5618"/><file name="GroupMemberDelete.php" hash="01a0b41b4bb4000c6b9bce235ce26416"/><file name="GroupMemberGet.php" hash="78c50676e8589ccacf8cb47e92069a73"/><file name="GroupPermissionAdd.php" hash="cb90055f032f69af183ab33a93d88571"/><file name="GroupPermissionDelete.php" hash="608191d3bba7742ba21ea459c6338972"/><file name="GroupPermissionEdit.php" hash="69b96213f99cc30f25551936425c6f80"/><file name="GroupPermissionGet.php" hash="c77a85926cbdab1e5ade39fcb47a44bb"/><file name="GroupPermissionList.php" hash="e6f5bb1355412abd77490b8424649af5"/></dir><dir name="Mms"><file name="Delete.php" hash="5dba01354309bfd6c1b1ab66d60410b6"/><file name="Get.php" hash="755f531a55d2e2360463c05f47f3b127"/><file name="Send.php" hash="abbf8e6305ad90e02a7e69310783cc47"/></dir><dir name="Phonebook"><file name="ContactAdd.php" hash="46fe7c7a406b353f3a82f3eb664189ad"/><file name="ContactDelete.php" hash="5eed0e67dd99a69704239b596f711001"/><file name="ContactEdit.php" hash="3bbc198d5c1ed2e5f82d50e9fb5459b8"/><file name="ContactGet.php" hash="8a56e9733697c148ab647bb3b1c86c47"/><file name="ContactList.php" hash="691b3ef0849d7f971b7db3b4b3e9e33d"/><file name="GroupAdd.php" hash="85abe5ab2ff14d80ef7b97aa6bff8877"/><file name="GroupDelete.php" hash="49232d2b740f9f7ea1fbd8b699b0ca76"/><file name="GroupEdit.php" hash="3fcaba8ab4ad2220912425e4afd3d58e"/><file name="GroupGet.php" hash="dda213dfd9349e77dd1c3e314b6eced8"/><file name="GroupList.php" hash="3ed6b3552bde95df4ee683e0178954b2"/></dir><dir name="Sender"><file name="Add.php" hash="2f56f363fcef2de31587cb7718e80506"/><file name="Delete.php" hash="95d28b99c325ae976fc663c74f9f30df"/><file name="SenderDefault.php" hash="cf720213bc08e8e03edc3d468859d0e2"/><file name="SenderList.php" hash="941712bbdd3c42d695362649111d4936"/></dir><dir name="Sms"><file name="Delete.php" hash="e981ed9b3757644314403c9cfb822fec"/><file name="Get.php" hash="3d7731b6f2d62cdbeb467b6007a2e65c"/><file name="Send.php" hash="7c43438f6cc289a6243094fbfa3ba6a7"/></dir><dir name="User"><file name="Add.php" hash="42e0575f6396d48e9bc39898ea5c0cf5"/><file name="Edit.php" hash="d01f99c4e66e49ff78a83d86d4f23807"/><file name="Get.php" hash="ca164b2838220a239a9fc431db7339b8"/><file name="GetPoints.php" hash="f692deaa6c30b75715bcb48ac7fe4a2e"/><file name="UserList.php" hash="98125be7b7d6a17e86aedd17079a64b6"/></dir><dir name="Vms"><file name="Delete.php" hash="338375589f9f9d12f7d83587308012f1"/><file name="Get.php" hash="a75934c63f441ec76fd26b7c4656431f"/><file name="Send.php" hash="597d4ad3d4b264d60edf5bb99cb9952c"/></dir></dir><file name="ActionFactory.php" hash="2870fa2eb5898bbd5a0752373225bfbb"/><file name="ContactsFactory.php" hash="9876d995077bf90958f8eeb1d16bbaf0"/><file name="MmsFactory.php" hash="e7a765cf76a1a65edd8b6b3f2600f2a1"/><file name="PhonebookFactory.php" hash="5312a8d6fc1e5726ac6a9e7d67b798d0"/><dir name="Response"><file name="AbstractResponse.php" hash="944ff5bba2c413a643e35fc62031d64a"/><file name="ContactResponse.php" hash="9232f8a2521db86011cc3c18ad9160f6"/><dir name="Contacts"><file name="AbstractContactsResponse.php" hash="03a9dea1ca1d503a7338553e2700b13f"/><file name="ContactResponse.php" hash="2ca97da3254a18aff01aa0c80bf7d295"/><file name="ContactsResponse.php" hash="2f5cfde1406e7434fdf45987ad3e0f59"/><file name="CountableResponse.php" hash="dfa472c37511e601e7be061564f52d3a"/><file name="DeleteResponse.php" hash="4587ff46fdcfd3efd8bf24f66ee33622"/><file name="FieldResponse.php" hash="b8361ec971d28b193be6943cedc47d7d"/><file name="FieldsResponse.php" hash="125fe285a44498f84fda95ca3f264428"/><file name="GroupResponse.php" hash="d70b920242cb04a5519370b3d03bd4c2"/><file name="GroupsResponse.php" hash="3ca005ff4d58bf9d2648a95774d1b894"/><file name="IdentifiableResponse.php" hash="333765cdc668554b2d1134de572f0dc2"/><file name="ListResponse.php" hash="e0be45ec5b82296ebaee9d77edb75abf"/><file name="PermissionResponse.php" hash="6fde7163e3bb66c2b740d0548be913ab"/><file name="PermissionsResponse.php" hash="9bb528e831e5104e0ab869c818751da7"/><file name="SizeResponse.php" hash="be02d3cf82d2e4421fb47aacf463eb78"/></dir><file name="ContactsResponse.php" hash="5ad05510aeaa79bc58ac12c84a9a7798"/><file name="CountableResponse.php" hash="2036386ef2e1b73068c5a89a5f68022a"/><file name="ErrorResponse.php" hash="dcb28545642d2fa11f47a86520be890f"/><file name="GroupResponse.php" hash="885782cbea0d394356ebb34480513947"/><file name="GroupsResponse.php" hash="56fadc291ff7631b67ed55739af0d96a"/><file name="MessageResponse.php" hash="5b8c96504a6448fff93148681d82ad57"/><file name="PointsResponse.php" hash="34bcd7272b01b03fa99278b2190f1e4b"/><file name="RawResponse.php" hash="8e8cd42607ff028cee8556a1bfcb9aaa"/><file name="Response.php" hash="371f5c39103b21a235d73e98543fda4d"/><file name="SenderResponse.php" hash="2c4aa3466713848de206120305f2d415"/><file name="SendersResponse.php" hash="85941932a8ac84f71bf1532e019a5ee9"/><file name="StatusResponse.php" hash="41841df91f7b4c743ed1f0235268483b"/><file name="UserResponse.php" hash="3f588eb01864f943af402285320ed25e"/><file name="UsersResponse.php" hash="4b08311cb04faa1c60ffca64561598a0"/></dir><file name="SenderFactory.php" hash="0600de89407e46c6a570fc9f4b897cfa"/><file name="SmsFactory.php" hash="215071a61e791e2a08d80c0568563d2b"/><file name="UserFactory.php" hash="65f221b038fe3be6d0a9354eb2181654"/><file name="VmsFactory.php" hash="ba0abd02ff4f64bcaae89bfb32eaf216"/></dir><file name="Autoload.php" hash="69fd5e8c01d71511ed12dde8992d5f31"/><file name="Client.php" hash="d58500df22221d2a1363fd250cde8e91"/><dir name="Exception"><file name="ActionException.php" hash="d6a3e835e33bf2f0113014d8ed7983a9"/><file name="ClientException.php" hash="ef1ab9f7016a6d33fbeba7253c8e4552"/><file name="ContactsException.php" hash="9c6ad56496e27bc8b6734643f66a247e"/><file name="HostException.php" hash="49a8d536abf2af5cb1c5ac6f2138149f"/><file name="InvalidParameterException.php" hash="38b8191c80d9121d2b607bb7786b5df9"/><file name="ProxyException.php" hash="0d11c758f448cf7d520f4966c87769c1"/><file name="SmsapiException.php" hash="f3ce764bec7a9b456199cdf6b88a9b0a"/></dir><dir name="Proxy"><dir name="Http"><file name="AbstractHttp.php" hash="d08c081baf80990750fe83d395c87fbd"/><file name="Curl.php" hash="fad8cc4c508c4fa82de96428a9432789"/><file name="Native.php" hash="989a8bf3868023de24ff4a4bad524e9d"/></dir><file name="Proxy.php" hash="8efe9c618c579b9b2cb031ca75dd3d42"/><file name="Uri.php" hash="cc8f087180386ca77dc7e090e7b88255"/></dir><file name="autoload_classmap.php" hash="422334706544eb1986b1439fec7211a5"/></dir><dir name="vendor"><file name="autoload.php" hash="d86d7aef26411f349b12286272d5886b"/><dir name="composer"><file name="ClassLoader.php" hash="9c1e7fe1a9eb1693e07ee4420ca5361e"/><file name="LICENSE" hash="084a034acbad39464e3df608c6dc064f"/><file name="autoload_classmap.php" hash="5ef5e43d9bb639d86ed0acac07da74c5"/><file name="autoload_namespaces.php" hash="35e12c7d76c4a81633bcf547c0e229a9"/><file name="autoload_psr4.php" hash="e360a2cc5a31de0cc753e24d09636afb"/><file name="autoload_real.php" hash="2d0f671f07bd743635c9b36edef4a315"/><file name="installed.json" hash="58e0494c51d30eb3494f7c9198986bb9"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="smsapi_sms.xml" hash="d3e85084ec20b0f180b2be0787f7975d"/></dir><dir name="template"><dir name="sms"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="6424a69999cb16dbd56c087e798f1e80"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Smsapi_Sms.xml" hash="4e65007f9573a00788a27745861bcaab"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Smsapi_Sms.csv" hash="7196ca665034aff6f4d950121298775f"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>