1 | <?php |
||
17 | class Stripe extends Module |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * The current order |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $data_order; |
||
25 | |||
26 | /** |
||
27 | * Stripe token |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $data_token; |
||
31 | |||
32 | /** |
||
33 | * Omnipay response instance |
||
34 | * @var object |
||
35 | */ |
||
36 | protected $response; |
||
37 | |||
38 | /** |
||
39 | * Frontend controller instance |
||
40 | * @var \gplcart\core\controllers\frontend\Controller $controller |
||
41 | */ |
||
42 | protected $controller; |
||
43 | |||
44 | /** |
||
45 | * Order model instance |
||
46 | * @var \gplcart\core\models\Order $order |
||
47 | */ |
||
48 | protected $order; |
||
49 | |||
50 | /** |
||
51 | * Constructor |
||
52 | */ |
||
53 | public function __construct() |
||
57 | |||
58 | /** |
||
59 | * Returns Stripe gateway object |
||
60 | * @return object |
||
61 | * @throws \InvalidArgumentException |
||
62 | */ |
||
63 | protected function getGatewayInstance() |
||
76 | |||
77 | /** |
||
78 | * Implements hook "module.enable.before" |
||
79 | * @param mixed $result |
||
80 | */ |
||
81 | public function hookModuleEnableBefore(&$result) |
||
89 | |||
90 | /** |
||
91 | * Implements hook "module.install.before" |
||
92 | * @param mixed $result |
||
93 | */ |
||
94 | public function hookModuleInstallBefore(&$result) |
||
102 | |||
103 | /** |
||
104 | * Implements hook "route.list" |
||
105 | * @param array $routes |
||
106 | */ |
||
107 | public function hookRouteList(array &$routes) |
||
116 | |||
117 | /** |
||
118 | * Implements hook "payment.methods" |
||
119 | * @param array $methods |
||
120 | */ |
||
121 | public function hookPaymentMethods(array &$methods) |
||
131 | |||
132 | /** |
||
133 | * Returns a module setting |
||
134 | * @param string $name |
||
135 | * @param mixed $default |
||
136 | * @return mixed |
||
137 | */ |
||
138 | protected function setting($name, $default = null) |
||
142 | |||
143 | /** |
||
144 | * Returns the current status of the payment method |
||
145 | */ |
||
146 | protected function getStatus() |
||
158 | |||
159 | /** |
||
160 | * Returns a public API key |
||
161 | * @return string |
||
162 | */ |
||
163 | protected function getPublicKey() |
||
168 | |||
169 | /** |
||
170 | * Returns a secret API key |
||
171 | * @return string |
||
172 | */ |
||
173 | protected function getSecretKey() |
||
178 | |||
179 | /** |
||
180 | * Implements hook "order.add.before" |
||
181 | * @param array $order |
||
182 | * @param \gplcart\core\models\Order $model |
||
183 | */ |
||
184 | public function hookOrderAddBefore(array &$order, $model) |
||
192 | |||
193 | /** |
||
194 | * Implements hook "order.checkout.complete" |
||
195 | * @param string $message |
||
196 | * @param array $order |
||
197 | */ |
||
198 | public function hookOrderCompleteMessage(&$message, $order) |
||
204 | |||
205 | /** |
||
206 | * Implements hook "order.complete.page" |
||
207 | * @param array $order |
||
208 | * @param \gplcart\core\models\Order $model |
||
209 | * @param \gplcart\core\controllers\frontend\Controller $controller |
||
210 | */ |
||
211 | public function hookOrderCompletePage(array $order, $model, $controller) |
||
226 | |||
227 | /** |
||
228 | * Handles submitted payment |
||
229 | */ |
||
230 | protected function submit() |
||
248 | |||
249 | /** |
||
250 | * Processes gateway response |
||
251 | */ |
||
252 | protected function processResponse() |
||
265 | |||
266 | /** |
||
267 | * Redirect on successful transaction |
||
268 | */ |
||
269 | protected function redirectSuccess() |
||
279 | |||
280 | /** |
||
281 | * Update order status after successful transaction |
||
282 | */ |
||
283 | protected function updateOrderStatus() |
||
289 | |||
290 | /** |
||
291 | * Adds a transaction |
||
292 | * @return integer |
||
293 | */ |
||
294 | protected function addTransaction() |
||
308 | |||
309 | } |
||
310 |
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.