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) |
||
131 | |||
132 | /** |
||
133 | * Function to perform GetExpressCheckoutDetails PayPal API operation. |
||
134 | * |
||
135 | * @param string $token |
||
136 | * |
||
137 | * @return array |
||
138 | */ |
||
139 | public function getExpressCheckoutDetails($token) |
||
147 | |||
148 | /** |
||
149 | * Function to perform DoExpressCheckoutPayment PayPal API operation. |
||
150 | * |
||
151 | * @param array $data |
||
152 | * @param string $token |
||
153 | * @param string $payerid |
||
154 | * |
||
155 | * @return array |
||
156 | */ |
||
157 | public function doExpressCheckoutPayment($data, $token, $payerid) |
||
173 | |||
174 | /** |
||
175 | * Function to perform DoCapture PayPal API operation. |
||
176 | * |
||
177 | * @param string $authorization_id Transaction ID |
||
178 | * @param float $amount Amount to capture |
||
179 | * @param string $complete Indicates whether or not this is the last capture. |
||
180 | * @param array $data Optional request fields |
||
181 | * |
||
182 | * @return array |
||
183 | */ |
||
184 | public function doCapture($authorization_id, $amount, $complete = 'Complete', $data = []) |
||
197 | |||
198 | /** |
||
199 | * Function to perform DoAuthorization PayPal API operation. |
||
200 | * |
||
201 | * @param string $authorization_id Transaction ID |
||
202 | * @param float $amount Amount to capture |
||
203 | * @param array $data Optional request fields |
||
204 | * |
||
205 | * @return array |
||
206 | */ |
||
207 | public function doAuthorization($authorization_id, $amount, $data = []) |
||
218 | |||
219 | /** |
||
220 | * Function to perform DoVoid PayPal API operation. |
||
221 | * |
||
222 | * @param string $authorization_id Transaction ID |
||
223 | * @param array $data Optional request fields |
||
224 | * |
||
225 | * @return array |
||
226 | */ |
||
227 | public function doVoid($authorization_id, $data = []) |
||
237 | |||
238 | /** |
||
239 | * Function to perform CreateBillingAgreement PayPal API operation. |
||
240 | * |
||
241 | * @param string $token |
||
242 | * |
||
243 | * @return array |
||
244 | */ |
||
245 | public function createBillingAgreement($token) |
||
253 | |||
254 | /** |
||
255 | * Function to perform CreateRecurringPaymentsProfile PayPal API operation. |
||
256 | * |
||
257 | * @param array $data |
||
258 | * @param string $token |
||
259 | * |
||
260 | * @return array |
||
261 | */ |
||
262 | public function createRecurringPaymentsProfile($data, $token) |
||
270 | |||
271 | /** |
||
272 | * Function to perform GetRecurringPaymentsProfileDetails PayPal API operation. |
||
273 | * |
||
274 | * @param string $id |
||
275 | * |
||
276 | * @return array |
||
277 | */ |
||
278 | public function getRecurringPaymentsProfileDetails($id) |
||
286 | |||
287 | /** |
||
288 | * Function to perform UpdateRecurringPaymentsProfile PayPal API operation. |
||
289 | * |
||
290 | * @param array $data |
||
291 | * @param string $id |
||
292 | * |
||
293 | * @return array |
||
294 | */ |
||
295 | public function updateRecurringPaymentsProfile($data, $id) |
||
303 | |||
304 | /** |
||
305 | * Function to cancel RecurringPaymentsProfile on PayPal. |
||
306 | * |
||
307 | * @param string $id |
||
308 | * |
||
309 | * @return array |
||
310 | */ |
||
311 | public function cancelRecurringPaymentsProfile($id) |
||
320 | |||
321 | /** |
||
322 | * Function to suspend an active RecurringPaymentsProfile on PayPal. |
||
323 | * |
||
324 | * @param string $id |
||
325 | * |
||
326 | * @return array |
||
327 | */ |
||
328 | public function suspendRecurringPaymentsProfile($id) |
||
337 | |||
338 | /** |
||
339 | * Function to reactivate a suspended RecurringPaymentsProfile on PayPal. |
||
340 | * |
||
341 | * @param string $id |
||
342 | * |
||
343 | * @return array |
||
344 | */ |
||
345 | public function reactivateRecurringPaymentsProfile($id) |
||
354 | } |
||
355 |