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