1 | <?php |
||
11 | class Gateway extends AbstractGateway |
||
12 | { |
||
13 | use HasSpreedlyConfig; |
||
14 | |||
15 | 2 | public function getName() |
|
19 | |||
20 | /** |
||
21 | * @param array $options |
||
22 | * @return Message\AuthorizeRequest |
||
23 | */ |
||
24 | 10 | public function authorize(array $options = array()) |
|
28 | |||
29 | /** |
||
30 | * @param array $options |
||
31 | * @return Message\CaptureRequest |
||
32 | */ |
||
33 | 8 | public function capture(array $options = array()) |
|
37 | |||
38 | /** |
||
39 | * @param array $options |
||
40 | * @return Message\PurchaseRequest |
||
41 | */ |
||
42 | 8 | public function purchase(array $options = array()) |
|
46 | |||
47 | /** |
||
48 | * @param array $options |
||
49 | * @return Message\RefundRequest |
||
50 | */ |
||
51 | 8 | public function refund(array $options = array()) |
|
55 | |||
56 | /** |
||
57 | * @param array $options |
||
58 | * @return Message\VoidRequest |
||
59 | */ |
||
60 | 12 | public function void(array $options = array()) |
|
64 | |||
65 | /** |
||
66 | * @param array $options |
||
67 | * @return Message\CreatePaymentMethodRequest |
||
68 | */ |
||
69 | 8 | public function createCard(array $options = array()) |
|
73 | |||
74 | /** |
||
75 | * @param array $options |
||
76 | * @return Message\UpdatePaymentMethodRequest |
||
77 | */ |
||
78 | 8 | public function updateCard(array $options = array()) |
|
82 | |||
83 | /** |
||
84 | * @param array $options |
||
85 | * @return Message\RetainPaymentMethodRequest |
||
86 | */ |
||
87 | 4 | public function retainCard(array $options = array()) |
|
91 | |||
92 | /** |
||
93 | * @param array $options |
||
94 | * @return Message\StorePaymentMethodRequest |
||
95 | */ |
||
96 | 2 | public function storeCard(array $options = array()) |
|
100 | |||
101 | /** |
||
102 | * @param array $options |
||
103 | * @return Message\VerifyPaymentMethodRequest |
||
104 | */ |
||
105 | 2 | public function verifyCard(array $options = array()) |
|
109 | |||
110 | /** |
||
111 | * @param array $options |
||
112 | * @return Message\Response |
||
113 | */ |
||
114 | public function emulateVerifyCard(array $options = array()) |
||
118 | |||
119 | /** |
||
120 | * @param array $options |
||
121 | * @return Message\DeletePaymentMethodRequest |
||
122 | */ |
||
123 | 8 | public function deleteCard(array $options = array()) |
|
127 | |||
128 | /** |
||
129 | * @param array $options |
||
130 | * @return Message\FetchPaymentMethodRequest |
||
131 | */ |
||
132 | 4 | public function fetchCard(array $options = array()) |
|
136 | |||
137 | /** |
||
138 | * @param array $options |
||
139 | * @return Message\ListPaymentMethodsRequest |
||
140 | */ |
||
141 | 4 | public function listCards(array $options = array()) |
|
145 | |||
146 | /** |
||
147 | * @param array $options |
||
148 | * @return Message\CreatePaymentMethodRequest |
||
149 | */ |
||
150 | 10 | public function createPaymentMethod(array $options = array()) |
|
154 | |||
155 | /** |
||
156 | * @param array $options |
||
157 | * @return Message\UpdatePaymentMethodRequest |
||
158 | */ |
||
159 | 10 | public function updatePaymentMethod(array $options = array()) |
|
163 | |||
164 | /** |
||
165 | * @param array $options |
||
166 | * @return Message\RetainPaymentMethodRequest |
||
167 | */ |
||
168 | 6 | public function retainPaymentMethod(array $options = array()) |
|
172 | |||
173 | /** |
||
174 | * @param array $options |
||
175 | * @return Message\StorePaymentMethodRequest |
||
176 | */ |
||
177 | 2 | public function storePaymentMethod(array $options = array()) |
|
181 | |||
182 | /** |
||
183 | * @param array $options |
||
184 | * @return Message\VerifyPaymentMethodRequest |
||
185 | */ |
||
186 | 2 | public function verifyPaymentMethod(array $options = array()) |
|
190 | |||
191 | /** |
||
192 | * @param array $options |
||
193 | * @return Message\Response |
||
194 | */ |
||
195 | 2 | public function emulateVerifyPaymentMethod(array $options = array()) |
|
196 | { |
||
197 | 2 | $authorizeResponse = $this->authorize($options)->send(); |
|
198 | |||
199 | 2 | if ($authorizeResponse->isSuccessful()) { |
|
200 | 2 | $this->void([ |
|
201 | 2 | 'transactionReference' => $authorizeResponse->getTransactionReference(), |
|
202 | 2 | ])->send(); |
|
203 | 2 | } |
|
204 | |||
205 | 2 | return $authorizeResponse; |
|
206 | } |
||
207 | |||
208 | /** |
||
209 | * @param array $options |
||
210 | * @return Message\DeletePaymentMethodRequest |
||
211 | */ |
||
212 | 10 | public function deletePaymentMethod(array $options = array()) |
|
216 | |||
217 | /** |
||
218 | * @param array $options |
||
219 | * @return Message\FetchPaymentMethodRequest |
||
220 | */ |
||
221 | 6 | public function fetchPaymentMethod(array $options = array()) |
|
225 | |||
226 | /** |
||
227 | * @param array $options |
||
228 | * @return Message\ListPaymentMethodsRequest |
||
229 | */ |
||
230 | 6 | public function listPaymentMethods(array $options = array()) |
|
234 | |||
235 | /** |
||
236 | * @param array $options |
||
237 | * @return Message\ListGatewaysRequest |
||
238 | */ |
||
239 | 8 | public function listGateways(array $options = array()) |
|
243 | |||
244 | /** |
||
245 | * @param array $options |
||
246 | * @return Message\CreateGatewayRequest |
||
247 | */ |
||
248 | 6 | public function createGateway(array $options = array()) |
|
252 | |||
253 | /** |
||
254 | * @param array $gatewayToken |
||
255 | * @return $this |
||
256 | */ |
||
257 | 4 | public function addGatewayToken($gatewayToken) |
|
265 | |||
266 | /** |
||
267 | * @param array $options |
||
268 | * @return array|null |
||
269 | */ |
||
270 | 2 | public function addGateway(array $options = array()) |
|
293 | |||
294 | /** |
||
295 | * Load previously created gateways |
||
296 | */ |
||
297 | 2 | public function loadGateways() |
|
312 | } |
||
313 |