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 | * |
||
39 | * @return void |
||
40 | */ |
||
41 | public function setExpressCheckoutOptions($credentials) |
||
61 | |||
62 | /** |
||
63 | * Set cart item details for PayPal. |
||
64 | * |
||
65 | * @param array $items |
||
66 | * |
||
67 | * @return \Illuminate\Support\Collection |
||
68 | */ |
||
69 | protected function setCartItems($items) |
||
81 | |||
82 | /** |
||
83 | * Set Recurring payments details for SetExpressCheckout API call. |
||
84 | * |
||
85 | * @param array $data |
||
86 | * @param bool $subscription |
||
87 | */ |
||
88 | protected function setExpressCheckoutRecurringPaymentConfig($data, $subscription = false) |
||
98 | |||
99 | /** |
||
100 | * Function to perform SetExpressCheckout PayPal API operation. |
||
101 | * |
||
102 | * @param array $data |
||
103 | * @param bool $subscription |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | public function setExpressCheckout($data, $subscription = false) |
||
126 | |||
127 | /** |
||
128 | * Function to perform GetExpressCheckoutDetails PayPal API operation. |
||
129 | * |
||
130 | * @param string $token |
||
131 | * |
||
132 | * @return array |
||
133 | */ |
||
134 | public function getExpressCheckoutDetails($token) |
||
142 | |||
143 | /** |
||
144 | * Function to perform DoExpressCheckoutPayment PayPal API operation. |
||
145 | * |
||
146 | * @param array $data |
||
147 | * @param string $token |
||
148 | * @param string $payerid |
||
149 | * |
||
150 | * @return array |
||
151 | */ |
||
152 | public function doExpressCheckoutPayment($data, $token, $payerid) |
||
168 | |||
169 | /** |
||
170 | * Function to perform DoCapture PayPal API operation. |
||
171 | * |
||
172 | * @param string $authorization_id Transaction ID |
||
173 | * @param float $amount Amount to capture |
||
174 | * @param string $complete Indicates whether or not this is the last capture. |
||
175 | * @param array $data Optional request fields |
||
176 | * |
||
177 | * @return array |
||
178 | */ |
||
179 | public function doCapture($authorization_id, $amount, $complete = 'Complete', $data = []) |
||
192 | |||
193 | /** |
||
194 | * Function to perform DoAuthorization PayPal API operation. |
||
195 | * |
||
196 | * @param string $authorization_id Transaction ID |
||
197 | * @param float $amount Amount to capture |
||
198 | * @param array $data Optional request fields |
||
199 | * |
||
200 | * @return array |
||
201 | */ |
||
202 | public function doAuthorization($authorization_id, $amount, $data = []) |
||
213 | |||
214 | /** |
||
215 | * Function to perform DoVoid PayPal API operation. |
||
216 | * |
||
217 | * @param string $authorization_id Transaction ID |
||
218 | * @param array $data Optional request fields |
||
219 | * |
||
220 | * @return array |
||
221 | */ |
||
222 | public function doVoid($authorization_id, $data = []) |
||
232 | |||
233 | /** |
||
234 | * Function to perform CreateBillingAgreement PayPal API operation. |
||
235 | * |
||
236 | * @param string $token |
||
237 | * |
||
238 | * @return array |
||
239 | */ |
||
240 | public function createBillingAgreement($token) |
||
248 | |||
249 | /** |
||
250 | * Function to perform CreateRecurringPaymentsProfile PayPal API operation. |
||
251 | * |
||
252 | * @param array $data |
||
253 | * @param string $token |
||
254 | * |
||
255 | * @return array |
||
256 | */ |
||
257 | public function createRecurringPaymentsProfile($data, $token) |
||
265 | |||
266 | /** |
||
267 | * Function to perform GetRecurringPaymentsProfileDetails PayPal API operation. |
||
268 | * |
||
269 | * @param string $id |
||
270 | * |
||
271 | * @return array |
||
272 | */ |
||
273 | public function getRecurringPaymentsProfileDetails($id) |
||
281 | |||
282 | /** |
||
283 | * Function to perform UpdateRecurringPaymentsProfile PayPal API operation. |
||
284 | * |
||
285 | * @param array $data |
||
286 | * @param string $id |
||
287 | * |
||
288 | * @return array |
||
289 | */ |
||
290 | public function updateRecurringPaymentsProfile($data, $id) |
||
298 | |||
299 | /** |
||
300 | * Function to cancel RecurringPaymentsProfile on PayPal. |
||
301 | * |
||
302 | * @param string $id |
||
303 | * |
||
304 | * @return array |
||
305 | */ |
||
306 | public function cancelRecurringPaymentsProfile($id) |
||
315 | |||
316 | /** |
||
317 | * Function to suspend an active RecurringPaymentsProfile on PayPal. |
||
318 | * |
||
319 | * @param string $id |
||
320 | * |
||
321 | * @return array |
||
322 | */ |
||
323 | public function suspendRecurringPaymentsProfile($id) |
||
332 | |||
333 | /** |
||
334 | * Function to reactivate a suspended RecurringPaymentsProfile on PayPal. |
||
335 | * |
||
336 | * @param string $id |
||
337 | * |
||
338 | * @return array |
||
339 | */ |
||
340 | public function reactivateRecurringPaymentsProfile($id) |
||
349 | } |
||
350 |