1 | <?php |
||
8 | class ExpressCheckout |
||
9 | { |
||
10 | // Integrate PayPal Request trait |
||
11 | use PayPalAPIRequest; |
||
12 | |||
13 | /** |
||
14 | * PayPal Processor Constructor. |
||
15 | * |
||
16 | * @param array $config |
||
17 | */ |
||
18 | public function __construct(array $config = []) |
||
25 | |||
26 | /** |
||
27 | * Set Http Client request body param. Should only be called when Guzzle version 5 is used. |
||
28 | */ |
||
29 | public function setPreviousHttpBodyParam() |
||
33 | |||
34 | /** |
||
35 | * Set ExpressCheckout API endpoints & options. |
||
36 | * |
||
37 | * @param array $credentials |
||
38 | * @param string $mode |
||
39 | * |
||
40 | * @return void |
||
41 | */ |
||
42 | public function setExpressCheckoutOptions($credentials, $mode) |
||
62 | |||
63 | /** |
||
64 | * Set cart item details for PayPal. |
||
65 | * |
||
66 | * @param array $items |
||
67 | * |
||
68 | * @return \Illuminate\Support\Collection |
||
69 | */ |
||
70 | protected function setCartItems($items) |
||
82 | |||
83 | /** |
||
84 | * Function to perform SetExpressCheckout PayPal API operation. |
||
85 | * |
||
86 | * @param array $data |
||
87 | * @param bool $subscription |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function setExpressCheckout($data, $subscription = false) |
||
123 | |||
124 | /** |
||
125 | * Function to perform GetExpressCheckoutDetails PayPal API operation. |
||
126 | * |
||
127 | * @param string $token |
||
128 | * |
||
129 | * @return array |
||
130 | */ |
||
131 | public function getExpressCheckoutDetails($token) |
||
139 | |||
140 | /** |
||
141 | * Function to perform DoExpressCheckoutPayment PayPal API operation. |
||
142 | * |
||
143 | * @param array $data |
||
144 | * @param string $token |
||
145 | * @param string $payerid |
||
146 | * |
||
147 | * @return array |
||
148 | */ |
||
149 | public function doExpressCheckoutPayment($data, $token, $payerid) |
||
165 | |||
166 | /** |
||
167 | * Function to perform DoCapture PayPal API operation. |
||
168 | * |
||
169 | * @param string $authorization_id Transaction ID |
||
170 | * @param float $amount Amount to capture |
||
171 | * @param string $complete Indicates whether or not this is the last capture. |
||
172 | * @param array $data Optional request fields |
||
173 | * |
||
174 | * @return array |
||
175 | */ |
||
176 | public function doCapture($authorization_id, $amount, $complete = 'Complete', $data = []) |
||
189 | |||
190 | /** |
||
191 | * Function to perform DoAuthorization PayPal API operation. |
||
192 | * |
||
193 | * @param string $authorization_id Transaction ID |
||
194 | * @param float $amount Amount to capture |
||
195 | * @param array $data Optional request fields |
||
196 | * |
||
197 | * @return array |
||
198 | */ |
||
199 | public function doAuthorization($authorization_id, $amount, $data = []) |
||
210 | |||
211 | /** |
||
212 | * Function to perform DoVoid PayPal API operation. |
||
213 | * |
||
214 | * @param string $authorization_id Transaction ID |
||
215 | * @param array $data Optional request fields |
||
216 | * |
||
217 | * @return array |
||
218 | */ |
||
219 | public function doVoid($authorization_id, $data = []) |
||
229 | |||
230 | /** |
||
231 | * Function to perform CreateBillingAgreement PayPal API operation. |
||
232 | * |
||
233 | * @param string $token |
||
234 | * |
||
235 | * @return array |
||
236 | */ |
||
237 | public function createBillingAgreement($token) |
||
245 | |||
246 | /** |
||
247 | * Function to perform CreateRecurringPaymentsProfile PayPal API operation. |
||
248 | * |
||
249 | * @param array $data |
||
250 | * @param string $token |
||
251 | * |
||
252 | * @return array |
||
253 | */ |
||
254 | public function createRecurringPaymentsProfile($data, $token) |
||
262 | |||
263 | /** |
||
264 | * Function to perform GetRecurringPaymentsProfileDetails PayPal API operation. |
||
265 | * |
||
266 | * @param string $id |
||
267 | * |
||
268 | * @return array |
||
269 | */ |
||
270 | public function getRecurringPaymentsProfileDetails($id) |
||
278 | |||
279 | /** |
||
280 | * Function to perform UpdateRecurringPaymentsProfile PayPal API operation. |
||
281 | * |
||
282 | * @param array $data |
||
283 | * @param string $id |
||
284 | * |
||
285 | * @return array |
||
286 | */ |
||
287 | public function updateRecurringPaymentsProfile($data, $id) |
||
295 | |||
296 | /** |
||
297 | * Function to cancel RecurringPaymentsProfile on PayPal. |
||
298 | * |
||
299 | * @param string $id |
||
300 | * |
||
301 | * @return array |
||
302 | */ |
||
303 | public function cancelRecurringPaymentsProfile($id) |
||
312 | |||
313 | /** |
||
314 | * Function to suspend an active RecurringPaymentsProfile on PayPal. |
||
315 | * |
||
316 | * @param string $id |
||
317 | * |
||
318 | * @return array |
||
319 | */ |
||
320 | public function suspendRecurringPaymentsProfile($id) |
||
329 | |||
330 | /** |
||
331 | * Function to reactivate a suspended RecurringPaymentsProfile on PayPal. |
||
332 | * |
||
333 | * @param string $id |
||
334 | * |
||
335 | * @return array |
||
336 | */ |
||
337 | public function reactivateRecurringPaymentsProfile($id) |
||
346 | } |
||
347 |