24
24
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25
25
* DAMAGE.
26
26
*
27
- * @category Mollie
28
- * @package Mollie_Ideal
29
- * @version v5.0.3
27
+ * @package Mollie
30
28
* @license Berkeley Software Distribution License (BSD-License 2) http://www.opensource.org/licenses/bsd-license.php
31
29
* @author Mollie B.V. <info@mollie.nl>
32
30
* @copyright Mollie B.V.
@@ -125,7 +123,7 @@ public function index()
125
123
$ this ->data ['entry_mstatus ' ] = $ this ->_checkModuleStatus ();
126
124
$ this ->data ['entry_cstatus ' ] = $ this ->_checkCommunicationStatus ();
127
125
$ this ->data ['entry_module ' ] = $ this ->language ->get ('entry_module ' );
128
- $ this ->data ['entry_version ' ] = $ this ->language ->get ('entry_version ' );
126
+ $ this ->data ['entry_version ' ] = $ this ->language ->get ('entry_version ' ) . " " . self :: PLUGIN_VERSION ;
129
127
130
128
$ this ->data ['button_save ' ] = $ this ->language ->get ('button_save ' );
131
129
$ this ->data ['button_cancel ' ] = $ this ->language ->get ('button_cancel ' );
@@ -257,7 +255,7 @@ private function validate()
257
255
258
256
if (!$ this ->request ->post ['mollie_api_key ' ])
259
257
{
260
- $ this ->error ['api_key ' ] = $ this ->language ->get ('mollie_api_key ' );
258
+ $ this ->error ['api_key ' ] = $ this ->language ->get ('error_api_key ' );
261
259
}
262
260
263
261
if (!$ this ->request ->post ['mollie_ideal_description ' ])
@@ -275,68 +273,74 @@ protected function _checkModuleStatus()
275
273
DIR_APPLICATION .'controller/payment/mollie_ideal.php ' ,
276
274
DIR_APPLICATION .'language/english/payment/mollie_ideal.php ' ,
277
275
DIR_TEMPLATE .'payment/mollie_ideal.tpl ' ,
276
+ DIR_CATALOG .'controller/payment/mollie-api-client/ ' ,
278
277
DIR_CATALOG .'controller/payment/mollie_ideal.php ' ,
279
278
DIR_CATALOG .'language/english/payment/mollie_ideal.php ' ,
280
279
DIR_CATALOG .'model/payment/mollie_ideal.php ' ,
281
- DIR_CATALOG .'view/theme/default/template/payment/mollie_ideal_banks.tpl ' ,
280
+ DIR_CATALOG .'view/javascript/mollie_methods.js ' ,
281
+ DIR_CATALOG .'view/theme/default/template/payment/mollie_checkout_form.tpl ' ,
282
282
DIR_CATALOG .'view/theme/default/template/payment/mollie_ideal_return.tpl ' ,
283
+ DIR_CATALOG .'view/theme/default/template/payment/mollie_payment_error.tpl ' ,
283
284
);
284
285
285
286
foreach ($ modFiles as $ file )
286
287
{
287
- if (!file_exists ($ file )) {
288
+ if (!file_exists ($ file ))
289
+ {
288
290
$ needFiles [] = '<span style="color:red"> ' .$ file .'</span> ' ;
289
291
}
290
292
}
291
293
292
- if (count ($ needFiles ) > 0 ) {
294
+ if (count ($ needFiles ) > 0 )
295
+ {
293
296
return $ needFiles ;
294
- } else {
295
- return '<span style="color:green">Ok!</span> ' ;
296
297
}
297
298
298
- return NULL ;
299
+ return ' <span style="color:green">OK</span> ' ;
299
300
}
300
301
301
302
/**
302
303
* Version of the plugin.
303
304
*/
304
- const PLUGIN_VERSION = "v5.0.3 " ;
305
+ const PLUGIN_VERSION = "5.1.0 " ;
305
306
306
307
/**
307
308
* @var Mollie_API_Client
308
309
*/
309
- private $ mollie_api_client ;
310
+ protected $ _mollie_api_client ;
310
311
311
312
/**
312
- * @codeCoverageIgnore
313
313
* @return Mollie_API_Client
314
314
*/
315
- protected function getApiClient ()
315
+ public function getApiClient ()
316
316
{
317
- if (empty ($ this ->mollie_api_client ))
317
+ if (empty ($ this ->_mollie_api_client ))
318
318
{
319
319
require_once dirname (DIR_APPLICATION ) . "/catalog/controller/payment/mollie-api-client/src/Mollie/API/Autoloader.php " ;
320
320
321
- $ this ->mollie_api_client = new Mollie_API_Client () ;
322
- $ this ->mollie_api_client ->setApiKey ($ this ->config ->get ('mollie_api_key ' ));
323
- $ this ->mollie_api_client ->addVersionString ("OpenCart/ " . VERSION );
324
- $ this ->mollie_api_client ->addVersionString ("MollieOpenCart/ " . self ::PLUGIN_VERSION );
321
+ $ this ->_mollie_api_client = new Mollie_API_Client ;
322
+ $ this ->_mollie_api_client ->setApiKey ($ this ->config ->get ('mollie_api_key ' ));
323
+ $ this ->_mollie_api_client ->addVersionString ("OpenCart/ " . VERSION );
324
+ $ this ->_mollie_api_client ->addVersionString ("MollieOpenCart/ " . self ::PLUGIN_VERSION );
325
325
}
326
326
327
- return $ this ->mollie_api_client ;
327
+ return $ this ->_mollie_api_client ;
328
328
}
329
329
330
- protected function _checkCommunicationStatus ()
330
+ /**
331
+ * @return string
332
+ */
333
+ protected function _checkCommunicationStatus ()
331
334
{
332
335
try
333
336
{
334
337
$ this ->getApiClient ()->methods ->all ();
335
- return '<span style="color: green;">Ok! </span> ' ;
338
+ return '<span style="color: green">OK </span> ' ;
336
339
}
337
340
catch (Mollie_API_Exception $ e )
338
341
{
339
- return '<span style="color: red;"> ' . htmlspecialchars ($ e ->getMessage ()). '</span> ' ;
342
+ $ message = htmlspecialchars ($ e ->getMessage ());
343
+ return "<span style='color:red'> $ message</span> " ;
340
344
}
341
345
}
342
346
}
0 commit comments