1 | <?php |
||
12 | class AuthorizeRequest extends AbstractRequest |
||
13 | { |
||
14 | /** |
||
|
|||
15 | * @var string; |
||
16 | */ |
||
17 | protected $requestName = 'AuthorizeRequest'; |
||
18 | |||
19 | /** |
||
20 | * Transaction code (flag as a authorization) |
||
21 | * |
||
22 | * @var int; |
||
23 | */ |
||
24 | protected $transactionCode = 0; |
||
25 | |||
26 | /** |
||
27 | * Returns the signature for the request. |
||
28 | * |
||
29 | * @return string base64 encoded sha1 hash of the merchantPassword, merchantId, |
||
30 | * acquirerId, transactionId, amount and currency code. |
||
31 | */ |
||
32 | protected function generateSignature() |
||
43 | |||
44 | /** |
||
45 | * Validate and construct the data for the request |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | public function getData() |
||
128 | |||
129 | /** |
||
130 | * Returns the country as the numeric ISO 3166-1 code |
||
131 | * |
||
132 | * @throws Omnipay\Common\Exception\InvalidRequestException |
||
133 | * |
||
134 | * @return int ISO 3166-1 numeric country |
||
135 | */ |
||
136 | protected function formatCountry() |
||
160 | |||
161 | /** |
||
162 | * Returns the billing state if its a US abbreviation or throws an exception |
||
163 | * |
||
164 | * @throws Omnipay\Common\Exception\InvalidRequestException |
||
165 | * |
||
166 | * @return string State abbreviation |
||
167 | */ |
||
168 | public function formatState() |
||
179 | |||
180 | /** |
||
181 | * Returns the postal code sanitizing dashes and spaces and throws exceptions with other |
||
182 | * non-alphanumeric characters |
||
183 | * |
||
184 | * @throws Omnipay\Common\Exception\InvalidRequestException |
||
185 | * |
||
186 | * @return string Postal code |
||
187 | */ |
||
188 | public function formatPostcode() |
||
199 | |||
200 | /** |
||
201 | * Returns endpoint for authorize requests |
||
202 | * |
||
203 | * @return string Endpoint URL |
||
204 | */ |
||
205 | protected function getEndpoint() |
||
209 | |||
210 | /** |
||
211 | * Returns the transaction code based on the AVS check requirement |
||
212 | * |
||
213 | * @return int Transaction Code |
||
214 | */ |
||
215 | protected function getTransactionCode() |
||
219 | |||
220 | /** |
||
221 | * Return the authorize response object |
||
222 | * |
||
223 | * @param \SimpleXMLElement $xml Response xml object |
||
224 | * |
||
225 | * @return AuthorizeResponse |
||
226 | */ |
||
227 | protected function newResponse($xml) |
||
231 | } |
||
232 |