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) |
||
69 | |||
70 | /** |
||
71 | * Set cart item details for PayPal. |
||
72 | * |
||
73 | * @param array $items |
||
74 | * |
||
75 | * @return \Illuminate\Support\Collection |
||
76 | */ |
||
77 | protected function setCartItems($items) |
||
89 | |||
90 | /** |
||
91 | * Function to perform SetExpressCheckout PayPal API operation. |
||
92 | * |
||
93 | * @param array $data |
||
94 | * @param bool $subscription |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | public function setExpressCheckout($data, $subscription = false) |
||
128 | |||
129 | /** |
||
130 | * Function to perform GetExpressCheckoutDetails PayPal API operation. |
||
131 | * |
||
132 | * @param string $token |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | public function getExpressCheckoutDetails($token) |
||
144 | |||
145 | /** |
||
146 | * Function to perform DoExpressCheckoutPayment PayPal API operation. |
||
147 | * |
||
148 | * @param array $data |
||
149 | * @param string $token |
||
150 | * @param string $payerid |
||
151 | * |
||
152 | * @return array |
||
153 | */ |
||
154 | public function doExpressCheckoutPayment($data, $token, $payerid) |
||
170 | |||
171 | /** |
||
172 | * Function to perform DoCapture PayPal API operation. |
||
173 | * |
||
174 | * @param string $authorization_id Transaction ID |
||
175 | * @param float $amount Amount to capture |
||
176 | * @param string $complete Indicates whether or not this is the last capture. |
||
177 | * @param array $data Optional request fields |
||
178 | * |
||
179 | * @return array |
||
180 | */ |
||
181 | public function doCapture($authorization_id, $amount, $complete = 'Complete', $data = []) |
||
194 | |||
195 | /** |
||
196 | * Function to perform DoAuthorization PayPal API operation. |
||
197 | * |
||
198 | * @param string $authorization_id Transaction ID |
||
199 | * @param float $amount Amount to capture |
||
200 | * @param array $data Optional request fields |
||
201 | * |
||
202 | * @return array |
||
203 | */ |
||
204 | public function doAuthorization($authorization_id, $amount, $data = []) |
||
215 | |||
216 | /** |
||
217 | * Function to perform DoVoid PayPal API operation. |
||
218 | * |
||
219 | * @param string $authorization_id Transaction ID |
||
220 | * @param array $data Optional request fields |
||
221 | * |
||
222 | * @return array |
||
223 | */ |
||
224 | public function doVoid($authorization_id, $data = []) |
||
234 | |||
235 | /** |
||
236 | * Function to perform CreateBillingAgreement PayPal API operation. |
||
237 | * |
||
238 | * @param string $token |
||
239 | * |
||
240 | * @return array |
||
241 | */ |
||
242 | public function createBillingAgreement($token) |
||
250 | |||
251 | /** |
||
252 | * Function to perform CreateRecurringPaymentsProfile PayPal API operation. |
||
253 | * |
||
254 | * @param array $data |
||
255 | * @param string $token |
||
256 | * |
||
257 | * @return array |
||
258 | */ |
||
259 | public function createRecurringPaymentsProfile($data, $token) |
||
267 | |||
268 | /** |
||
269 | * Function to perform GetRecurringPaymentsProfileDetails PayPal API operation. |
||
270 | * |
||
271 | * @param string $id |
||
272 | * |
||
273 | * @return array |
||
274 | */ |
||
275 | public function getRecurringPaymentsProfileDetails($id) |
||
283 | |||
284 | /** |
||
285 | * Function to perform UpdateRecurringPaymentsProfile PayPal API operation. |
||
286 | * |
||
287 | * @param array $data |
||
288 | * @param string $id |
||
289 | * |
||
290 | * @return array |
||
291 | */ |
||
292 | public function updateRecurringPaymentsProfile($data, $id) |
||
300 | |||
301 | /** |
||
302 | * Function to cancel RecurringPaymentsProfile on PayPal. |
||
303 | * |
||
304 | * @param string $id |
||
305 | * |
||
306 | * @return array |
||
307 | */ |
||
308 | public function cancelRecurringPaymentsProfile($id) |
||
317 | |||
318 | /** |
||
319 | * Function to suspend an active RecurringPaymentsProfile on PayPal. |
||
320 | * |
||
321 | * @param string $id |
||
322 | * |
||
323 | * @return array |
||
324 | */ |
||
325 | public function suspendRecurringPaymentsProfile($id) |
||
334 | |||
335 | /** |
||
336 | * Function to reactivate a suspended RecurringPaymentsProfile on PayPal. |
||
337 | * |
||
338 | * @param string $id |
||
339 | * |
||
340 | * @return array |
||
341 | */ |
||
342 | public function reactivateRecurringPaymentsProfile($id) |
||
351 | } |
||
352 |