1 | <?php |
||
11 | trait PayPalRequest |
||
12 | { |
||
13 | /** |
||
14 | * @var HttpClient |
||
15 | */ |
||
16 | private $client; |
||
17 | |||
18 | /** |
||
19 | * @var \Illuminate\Support\Collection |
||
20 | */ |
||
21 | protected $post; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $config; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $currency; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $options; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | private $paymentAction; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $locale; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | private $notifyUrl; |
||
52 | |||
53 | /** |
||
54 | * Function To Set PayPal API Configuration. |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | private function setConfig() |
||
72 | |||
73 | /** |
||
74 | * Function to initialize Http Client. |
||
75 | * |
||
76 | * @return HttpClient |
||
77 | */ |
||
78 | protected function setClient() |
||
86 | |||
87 | /** |
||
88 | * Set PayPal API Credentials. |
||
89 | * |
||
90 | * @param array $credentials |
||
91 | * @param string $mode |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function setApiCredentials($credentials, $mode = '') |
||
141 | |||
142 | /** |
||
143 | * Setup request data to be sent to PayPal. |
||
144 | * |
||
145 | * @param array $data |
||
146 | * |
||
147 | * @return \Illuminate\Support\Collection |
||
148 | */ |
||
149 | protected function setRequestData(array $data = []) |
||
159 | |||
160 | /** |
||
161 | * Set other/override PayPal API parameters. |
||
162 | * |
||
163 | * @param array $options |
||
164 | * |
||
165 | * @return $this |
||
166 | */ |
||
167 | public function addOptions(array $options) |
||
173 | |||
174 | /** |
||
175 | * Function to set currency. |
||
176 | * |
||
177 | * @param string $currency |
||
178 | * |
||
179 | * @throws \Exception |
||
180 | * |
||
181 | * @return $this |
||
182 | */ |
||
183 | public function setCurrency($currency = 'USD') |
||
196 | |||
197 | /** |
||
198 | * Retrieve PayPal IPN Response. |
||
199 | * |
||
200 | * @param array $post |
||
201 | * |
||
202 | * @return array |
||
203 | */ |
||
204 | public function verifyIPN($post) |
||
210 | |||
211 | /** |
||
212 | * Refund PayPal Transaction. |
||
213 | * |
||
214 | * @param string $transaction |
||
215 | * |
||
216 | * @return array |
||
217 | */ |
||
218 | public function refundTransaction($transaction) |
||
226 | |||
227 | /** |
||
228 | * Search Transactions On PayPal. |
||
229 | * |
||
230 | * @param array $post |
||
231 | * |
||
232 | * @return array |
||
233 | */ |
||
234 | public function searchTransactions($post) |
||
240 | |||
241 | /** |
||
242 | * Function To Perform PayPal API Request. |
||
243 | * |
||
244 | * @param string $method |
||
245 | * |
||
246 | * @throws \Exception |
||
247 | * |
||
248 | * @return array|\Psr\Http\Message\StreamInterface |
||
249 | */ |
||
250 | private function doPayPalRequest($method) |
||
312 | |||
313 | /** |
||
314 | * Parse PayPal NVP Response. |
||
315 | * |
||
316 | * @param string $request |
||
317 | * @param array $response |
||
318 | * |
||
319 | * @return array |
||
320 | */ |
||
321 | private function retrieveData($request, array $response = null) |
||
327 | } |
||
328 |
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.