1 | <?php |
||
20 | class Main |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * The current order |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $data_order; |
||
28 | |||
29 | /** |
||
30 | * Omnipay response instance |
||
31 | * @var object |
||
32 | */ |
||
33 | protected $response; |
||
34 | |||
35 | /** |
||
36 | * Frontend controller instance |
||
37 | * @var \gplcart\core\controllers\frontend\Controller $controller |
||
38 | */ |
||
39 | protected $controller; |
||
40 | |||
41 | /** |
||
42 | * Order model instance |
||
43 | * @var \gplcart\core\models\Order $order |
||
44 | */ |
||
45 | protected $order; |
||
46 | |||
47 | /** |
||
48 | * Module class instance |
||
49 | * @var \gplcart\core\Module |
||
50 | */ |
||
51 | protected $module; |
||
52 | |||
53 | /** |
||
54 | * @param Module $module |
||
55 | */ |
||
56 | public function __construct(Module $module) |
||
60 | |||
61 | /** |
||
62 | * Implements hook "route.list" |
||
63 | * @param array $routes |
||
64 | */ |
||
65 | public function hookRouteList(array &$routes) |
||
74 | |||
75 | /** |
||
76 | * Implements hook "module.enable.before" |
||
77 | * @param mixed $result |
||
78 | */ |
||
79 | public function hookModuleEnableBefore(&$result) |
||
87 | |||
88 | /** |
||
89 | * Implements hook "module.install.before" |
||
90 | * @param mixed $result |
||
91 | */ |
||
92 | public function hookModuleInstallBefore(&$result) |
||
100 | |||
101 | /** |
||
102 | * Implements hook "payment.methods" |
||
103 | * @param array $methods |
||
104 | */ |
||
105 | public function hookPaymentMethods(array &$methods) |
||
115 | |||
116 | /** |
||
117 | * Implements hook "order.add.before" |
||
118 | * @param array $order |
||
119 | * @param \gplcart\core\models\Order $order_model |
||
120 | */ |
||
121 | public function hookOrderAddBefore(array &$order, $order_model) |
||
129 | |||
130 | /** |
||
131 | * Implements hook "order.checkout.complete" |
||
132 | * @param string $message |
||
133 | * @param array $order |
||
134 | */ |
||
135 | public function hookOrderCompleteMessage(&$message, $order) |
||
141 | |||
142 | /** |
||
143 | * Implements hook "order.complete.page" |
||
144 | * @param array $order |
||
145 | * @param \gplcart\core\models\Order $order_model |
||
146 | * @param \gplcart\core\controllers\frontend\Controller $controller |
||
147 | */ |
||
148 | public function hookOrderCompletePage(array $order, $order_model, $controller) |
||
159 | |||
160 | /** |
||
161 | * Get gateway instance |
||
162 | * @return \Omnipay\AuthorizeNet\SIMGateway |
||
163 | * @throws UnexpectedValueException |
||
164 | */ |
||
165 | protected function getGateway() |
||
179 | |||
180 | /** |
||
181 | * Process payment |
||
182 | */ |
||
183 | protected function processPurchase() |
||
196 | |||
197 | /** |
||
198 | * Performs actions when a payment is canceled |
||
199 | */ |
||
200 | protected function cancelPurchase() |
||
208 | |||
209 | /** |
||
210 | * Handles submitted payment |
||
211 | */ |
||
212 | protected function submitPurchase() |
||
229 | |||
230 | /** |
||
231 | * Returns an array of purchase parameters |
||
232 | * @return array |
||
233 | */ |
||
234 | protected function getPurchaseParams() |
||
245 | |||
246 | /** |
||
247 | * Performs final actions on success payment |
||
248 | */ |
||
249 | protected function finishPurchase() |
||
261 | |||
262 | /** |
||
263 | * Redirect on error payment |
||
264 | */ |
||
265 | protected function redirectError() |
||
269 | |||
270 | /** |
||
271 | * Redirect on successful payment |
||
272 | */ |
||
273 | protected function redirectSuccess() |
||
283 | |||
284 | /** |
||
285 | * Update order status after successful transaction |
||
286 | */ |
||
287 | protected function updateOrderStatus() |
||
293 | |||
294 | /** |
||
295 | * Adds a transaction |
||
296 | */ |
||
297 | protected function addTransaction() |
||
312 | |||
313 | /** |
||
314 | * Returns the current status for the payment method |
||
315 | * @return bool |
||
316 | */ |
||
317 | protected function getStatus() |
||
324 | |||
325 | /** |
||
326 | * Returns a module setting |
||
327 | * @param string $name |
||
328 | * @param mixed $default |
||
329 | * @return mixed |
||
330 | */ |
||
331 | protected function getSetting($name, $default = null) |
||
335 | |||
336 | } |
||
337 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.