1 | <?php |
||
10 | trait PayPalRequest |
||
11 | { |
||
12 | /** |
||
13 | * @var HttpClient |
||
14 | */ |
||
15 | private $client; |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $post; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $config; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $currency; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $options; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $paymentAction; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $locale; |
||
46 | |||
47 | /** |
||
48 | * Function To Set PayPal API Configuration. |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | private function setConfig() |
||
64 | |||
65 | /** |
||
66 | * Function to initialize Http Client. |
||
67 | * |
||
68 | * @return HttpClient |
||
69 | */ |
||
70 | protected function setClient() |
||
78 | |||
79 | /** |
||
80 | * Set PayPal API Credentials. |
||
81 | * |
||
82 | * @param array $credentials |
||
83 | * @param string $mode |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | public function setApiCredentials($credentials, $mode = '') |
||
130 | |||
131 | /** |
||
132 | * Set other/override PayPal API parameters. |
||
133 | * |
||
134 | * @param array $options |
||
135 | * |
||
136 | * @return $this |
||
137 | */ |
||
138 | public function addOptions(array $options) |
||
144 | |||
145 | /** |
||
146 | * Set ExpressCheckout API endpoints & options. |
||
147 | * |
||
148 | * @param array $credentials |
||
149 | * @param string $mode |
||
150 | * |
||
151 | * @return void |
||
152 | */ |
||
153 | protected function setExpressCheckoutOptions($credentials, $mode) |
||
173 | |||
174 | /** |
||
175 | * Set AdaptivePayments API endpoints & options. |
||
176 | * |
||
177 | * @param string $mode |
||
178 | * |
||
179 | * @return void |
||
180 | */ |
||
181 | protected function setAdaptivePaymentsOptions($mode) |
||
191 | |||
192 | /** |
||
193 | * Function to set currency. |
||
194 | * |
||
195 | * @param string $currency |
||
196 | * |
||
197 | * @throws \Exception |
||
198 | * |
||
199 | * @return string |
||
200 | */ |
||
201 | public function setCurrency($currency = 'USD') |
||
214 | |||
215 | /** |
||
216 | * Retrieve PayPal IPN Response. |
||
217 | * |
||
218 | * @param array $post |
||
219 | * |
||
220 | * @return array |
||
221 | */ |
||
222 | public function verifyIPN($post) |
||
228 | |||
229 | /** |
||
230 | * Refund PayPal Transaction. |
||
231 | * |
||
232 | * @param string $transaction |
||
233 | * |
||
234 | * @return array |
||
235 | */ |
||
236 | public function refundTransaction($transaction) |
||
244 | |||
245 | /** |
||
246 | * Search Transactions On PayPal. |
||
247 | * |
||
248 | * @param array $post |
||
249 | * |
||
250 | * @return array |
||
251 | */ |
||
252 | public function searchTransactions($post) |
||
258 | |||
259 | /** |
||
260 | * Function To Perform PayPal API Request. |
||
261 | * |
||
262 | * @param string $method |
||
263 | * |
||
264 | * @throws \Exception |
||
265 | * |
||
266 | * @return array|\Psr\Http\Message\StreamInterface |
||
267 | */ |
||
268 | private function doPayPalRequest($method) |
||
330 | |||
331 | /** |
||
332 | * Parse PayPal NVP Response. |
||
333 | * |
||
334 | * @param string $request |
||
335 | * @param array $response |
||
336 | * |
||
337 | * @return array |
||
338 | */ |
||
339 | private function retrieveData($request, array $response = null) |
||
345 | } |
||
346 |
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.