|
1 <?php |
|
2 /** |
|
3 * Zend Framework |
|
4 * |
|
5 * LICENSE |
|
6 * |
|
7 * This source file is subject to the new BSD license that is bundled |
|
8 * with this package in the file LICENSE.txt. |
|
9 * It is also available through the world-wide-web at this URL: |
|
10 * http://framework.zend.com/license/new-bsd |
|
11 * If you did not receive a copy of the license and are unable to |
|
12 * obtain it through the world-wide-web, please send an email |
|
13 * to license@zend.com so we can send you a copy immediately. |
|
14 * |
|
15 * @category Zend |
|
16 * @package Zend_Service |
|
17 * @subpackage DeveloperGarden |
|
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
20 * @version $Id: SmsValidation.php 20166 2010-01-09 19:00:17Z bkarwin $ |
|
21 */ |
|
22 |
|
23 /** |
|
24 * @see Zend_Service_DeveloperGarden_Client_ClientAbstract |
|
25 */ |
|
26 require_once 'Zend/Service/DeveloperGarden/Client/ClientAbstract.php'; |
|
27 |
|
28 /** |
|
29 * @see Zend_Service_DeveloperGarden_Request_SmsValidation_GetValidatedNumbers |
|
30 */ |
|
31 require_once 'Zend/Service/DeveloperGarden/Request/SmsValidation/GetValidatedNumbers.php'; |
|
32 |
|
33 /** |
|
34 * @see Zend_Service_DeveloperGarden_Response_SmsValidation_GetValidatedNumbersResponse |
|
35 */ |
|
36 require_once 'Zend/Service/DeveloperGarden/Response/SmsValidation/GetValidatedNumbersResponse.php'; |
|
37 |
|
38 /** |
|
39 * @see Zend_Service_DeveloperGarden_Response_SmsValidation_ValidatedNumber |
|
40 */ |
|
41 require_once 'Zend/Service/DeveloperGarden/Response/SmsValidation/ValidatedNumber.php'; |
|
42 |
|
43 /** |
|
44 * @see Zend_Service_DeveloperGarden_Request_SmsValidation_SendValidationKeyword |
|
45 */ |
|
46 require_once 'Zend/Service/DeveloperGarden/Request/SmsValidation/SendValidationKeyword.php'; |
|
47 |
|
48 /** |
|
49 * @see Zend_Service_DeveloperGarden_Response_SmsValidation_SendValidationKeywordResponse |
|
50 */ |
|
51 require_once 'Zend/Service/DeveloperGarden/Response/SmsValidation/SendValidationKeywordResponse.php'; |
|
52 |
|
53 /** |
|
54 * @see Zend_Service_DeveloperGarden_Request_SmsValidation_Validate |
|
55 */ |
|
56 require_once 'Zend/Service/DeveloperGarden/Request/SmsValidation/Validate.php'; |
|
57 |
|
58 /** |
|
59 * @see Zend_Service_DeveloperGarden_Response_SmsValidation_ValidateResponse |
|
60 */ |
|
61 require_once 'Zend/Service/DeveloperGarden/Response/SmsValidation/ValidateResponse.php'; |
|
62 |
|
63 /** |
|
64 * @see Zend_Service_DeveloperGarden_Request_SmsValidation_Invalidate |
|
65 */ |
|
66 require_once 'Zend/Service/DeveloperGarden/Request/SmsValidation/Invalidate.php'; |
|
67 |
|
68 /** |
|
69 * @see Zend_Service_DeveloperGarden_Response_SmsValidation_InvalidateResponse |
|
70 */ |
|
71 require_once 'Zend/Service/DeveloperGarden/Response/SmsValidation/InvalidateResponse.php'; |
|
72 |
|
73 /** |
|
74 * @category Zend |
|
75 * @package Zend_Service |
|
76 * @subpackage DeveloperGarden |
|
77 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
78 * @author Marco Kaiser |
|
79 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
80 */ |
|
81 class Zend_Service_DeveloperGarden_SmsValidation extends Zend_Service_DeveloperGarden_Client_ClientAbstract |
|
82 { |
|
83 // @codeCoverageIgnoreStart |
|
84 /** |
|
85 * wsdl file |
|
86 * |
|
87 * @var string |
|
88 */ |
|
89 protected $_wsdlFile = 'https://gateway.developer.telekom.com/p3gw-mod-odg-sms-validation/services/SmsValidationUserService?wsdl'; |
|
90 |
|
91 /** |
|
92 * wsdl file local |
|
93 * |
|
94 * @var string |
|
95 */ |
|
96 protected $_wsdlFileLocal = 'Wsdl/SmsValidationUserService.wsdl'; |
|
97 |
|
98 /** |
|
99 * Response, Request Classmapping |
|
100 * |
|
101 * @var array |
|
102 * |
|
103 */ |
|
104 protected $_classMap = array( |
|
105 'getValidatedNumbersResponse' => 'Zend_Service_DeveloperGarden_Response_SmsValidation_GetValidatedNumbersResponse', |
|
106 'ValidatedNumber' => 'Zend_Service_DeveloperGarden_Response_SmsValidation_ValidatedNumber', |
|
107 'sendValidationKeywordResponse' => 'Zend_Service_DeveloperGarden_Response_SmsValidation_SendValidationKeywordResponse', |
|
108 'validateResponse' => 'Zend_Service_DeveloperGarden_Response_SmsValidation_ValidateResponse', |
|
109 'invalidateResponse' => 'Zend_Service_DeveloperGarden_Response_SmsValidation_InvalidateResponse', |
|
110 ); |
|
111 |
|
112 /** |
|
113 * validate the given number with the keyword |
|
114 * |
|
115 * @param string $keyword |
|
116 * @param string $number |
|
117 * @return Zend_Service_DeveloperGarden_Response_SmsValidation_ValidateResponse |
|
118 */ |
|
119 public function validate($keyword = null, $number = null) |
|
120 { |
|
121 $request = new Zend_Service_DeveloperGarden_Request_SmsValidation_Validate( |
|
122 $this->getEnvironment(), |
|
123 $keyword, |
|
124 $number |
|
125 ); |
|
126 |
|
127 return $this->getSoapClient() |
|
128 ->validate($request) |
|
129 ->parse(); |
|
130 } |
|
131 |
|
132 /** |
|
133 * invalidate the given number |
|
134 * |
|
135 * @param string $number |
|
136 * @return Zend_Service_DeveloperGarden_Response_SmsValidation_InvalidateResponse |
|
137 */ |
|
138 public function inValidate($number = null) |
|
139 { |
|
140 $request = new Zend_Service_DeveloperGarden_Request_SmsValidation_Invalidate( |
|
141 $this->getEnvironment(), |
|
142 $number |
|
143 ); |
|
144 |
|
145 return $this->getSoapClient() |
|
146 ->invalidate($request) |
|
147 ->parse(); |
|
148 } |
|
149 |
|
150 /** |
|
151 * this function sends the validation sms to the given number, |
|
152 * if message is provided it should have to placeholder: |
|
153 * #key# = the validation key |
|
154 * #validUntil# = the valid until date |
|
155 * |
|
156 * @param string $number |
|
157 * @param string $message |
|
158 * @param string $originator |
|
159 * @param integer $account |
|
160 * |
|
161 * @return Zend_Service_DeveloperGarden_Request_SmsValidation_SendValidationKeywordResponse |
|
162 */ |
|
163 public function sendValidationKeyword($number = null, $message = null, $originator = null, $account = null) |
|
164 { |
|
165 $request = new Zend_Service_DeveloperGarden_Request_SmsValidation_SendValidationKeyword( |
|
166 $this->getEnvironment() |
|
167 ); |
|
168 $request->setNumber($number) |
|
169 ->setMessage($message) |
|
170 ->setOriginator($originator) |
|
171 ->setAccount($account); |
|
172 |
|
173 return $this->getSoapClient() |
|
174 ->sendValidationKeyword($request) |
|
175 ->parse(); |
|
176 } |
|
177 |
|
178 /** |
|
179 * returns a list of validated numbers |
|
180 * |
|
181 * @return Zend_Service_DeveloperGarden_Response_SmsValidation_GetValidatedNumbersResponse |
|
182 */ |
|
183 public function getValidatedNumbers() |
|
184 { |
|
185 $request = new Zend_Service_DeveloperGarden_Request_SmsValidation_GetValidatedNumbers( |
|
186 $this->getEnvironment() |
|
187 ); |
|
188 return $this->getSoapClient() |
|
189 ->getValidatedNumbers($request) |
|
190 ->parse(); |
|
191 } |
|
192 // @codeCoverageIgnoreEnd |
|
193 } |