1 | <?php |
||
8 | class ExpressCheckout |
||
9 | { |
||
10 | // Integrate PayPal Request trait |
||
11 | use PayPalAPIRequest; |
||
12 | |||
13 | /** |
||
14 | * PayPal Processor Constructor. |
||
15 | */ |
||
16 | public function __construct() |
||
21 | |||
22 | /** |
||
23 | * Set ExpressCheckout API endpoints & options. |
||
24 | * |
||
25 | * @param array $credentials |
||
26 | * @param string $mode |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function setExpressCheckoutOptions($credentials, $mode) |
||
50 | |||
51 | protected function setCartItems($items) |
||
63 | |||
64 | /** |
||
65 | * Function to perform SetExpressCheckout PayPal API operation. |
||
66 | * |
||
67 | * @param array $data |
||
68 | * @param bool $subscription |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | public function setExpressCheckout($data, $subscription = false) |
||
104 | |||
105 | /** |
||
106 | * Function to perform GetExpressCheckoutDetails PayPal API operation. |
||
107 | * |
||
108 | * @param string $token |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function getExpressCheckoutDetails($token) |
||
120 | |||
121 | /** |
||
122 | * Function to perform DoExpressCheckoutPayment PayPal API operation. |
||
123 | * |
||
124 | * @param array $data |
||
125 | * @param string $token |
||
126 | * @param string $payerid |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | public function doExpressCheckoutPayment($data, $token, $payerid) |
||
146 | |||
147 | /** |
||
148 | * Function to perform DoCapture PayPal API operation. |
||
149 | * |
||
150 | * @param string $authorization_id Transaction ID |
||
151 | * @param float $amount Amount to capture |
||
152 | * @param string $complete Indicates whether or not this is the last capture. |
||
153 | * @param array $data Optional request fields |
||
154 | * |
||
155 | * @return array |
||
156 | */ |
||
157 | public function doCapture($authorization_id, $amount, $complete = 'Complete', $data = []) |
||
170 | |||
171 | /** |
||
172 | * Function to perform DoAuthorization PayPal API operation. |
||
173 | * |
||
174 | * @param string $authorization_id Transaction ID |
||
175 | * @param float $amount Amount to capture |
||
176 | * @param array $data Optional request fields |
||
177 | * |
||
178 | * @return array |
||
179 | */ |
||
180 | public function doAuthorization($authorization_id, $amount, $data = []) |
||
191 | |||
192 | /** |
||
193 | * Function to perform DoVoid PayPal API operation. |
||
194 | * |
||
195 | * @param string $authorization_id Transaction ID |
||
196 | * @param array $data Optional request fields |
||
197 | * |
||
198 | * @return array |
||
199 | */ |
||
200 | public function doVoid($authorization_id, $data = []) |
||
210 | |||
211 | /** |
||
212 | * Function to perform CreateBillingAgreement PayPal API operation. |
||
213 | * |
||
214 | * @param string $token |
||
215 | * |
||
216 | * @return array |
||
217 | */ |
||
218 | public function createBillingAgreement($token) |
||
226 | |||
227 | /** |
||
228 | * Function to perform CreateRecurringPaymentsProfile PayPal API operation. |
||
229 | * |
||
230 | * @param array $data |
||
231 | * @param string $token |
||
232 | * |
||
233 | * @return array |
||
234 | */ |
||
235 | public function createRecurringPaymentsProfile($data, $token) |
||
243 | |||
244 | /** |
||
245 | * Function to perform GetRecurringPaymentsProfileDetails PayPal API operation. |
||
246 | * |
||
247 | * @param string $id |
||
248 | * |
||
249 | * @return array |
||
250 | */ |
||
251 | public function getRecurringPaymentsProfileDetails($id) |
||
259 | |||
260 | /** |
||
261 | * Function to perform UpdateRecurringPaymentsProfile PayPal API operation. |
||
262 | * |
||
263 | * @param array $data |
||
264 | * @param string $id |
||
265 | * |
||
266 | * @return array |
||
267 | */ |
||
268 | public function updateRecurringPaymentsProfile($data, $id) |
||
276 | |||
277 | /** |
||
278 | * Function to cancel RecurringPaymentsProfile on PayPal. |
||
279 | * |
||
280 | * @param string $id |
||
281 | * |
||
282 | * @return array |
||
283 | */ |
||
284 | public function cancelRecurringPaymentsProfile($id) |
||
293 | |||
294 | /** |
||
295 | * Function to suspend an active RecurringPaymentsProfile on PayPal. |
||
296 | * |
||
297 | * @param string $id |
||
298 | * |
||
299 | * @return array |
||
300 | */ |
||
301 | public function suspendRecurringPaymentsProfile($id) |
||
310 | |||
311 | /** |
||
312 | * Function to reactivate a suspended RecurringPaymentsProfile on PayPal. |
||
313 | * |
||
314 | * @param string $id |
||
315 | * |
||
316 | * @return array |
||
317 | */ |
||
318 | public function reactivateRecurringPaymentsProfile($id) |
||
327 | } |
||
328 |