File tree Expand file tree Collapse file tree 1 file changed +40
-2
lines changed
admin/controller/payment/mollie Expand file tree Collapse file tree 1 file changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -500,15 +500,53 @@ protected function checkModuleStatus ()
500
500
*/
501
501
protected function checkCommunicationStatus ()
502
502
{
503
+ /*
504
+ * Check API key
505
+ */
506
+ $ api_key = $ this ->config ->get ('mollie_api_key ' );
507
+
508
+ if (empty ($ api_key ))
509
+ {
510
+ return '<span style="color:red">No API key provided. Please insert your API key.</span> ' ;
511
+ }
512
+
513
+ $ client = NULL ;
514
+
515
+ /*
516
+ * Test compatibility + communication
517
+ */
503
518
try
504
519
{
505
- $ this ->getAPIClient ()->methods ->all ();
520
+ $ client = $ this ->getAPIClient ();
521
+
522
+ if (!$ client )
523
+ {
524
+ return '<span style="color:red">API client not found.</span> ' ;
525
+ }
526
+
527
+ $ client ->methods ->all ();
506
528
507
529
return '<span style="color: green">OK</span> ' ;
508
530
}
531
+ catch (Mollie_API_Exception_IncompatiblePlatform $ e )
532
+ {
533
+ return '<span style="color:red"> ' . $ e ->getMessage () . ' You can ask your hosting provider to help with this.</span> ' ;
534
+ }
509
535
catch (Mollie_API_Exception $ e )
510
536
{
511
- return '<span style="color:red"> ' . htmlspecialchars ($ e ->getMessage ()) . '</span> ' ;
537
+ return '<span style="color:red"> '
538
+ . '<strong>Communicating with Mollie failed:</strong><br/> '
539
+ . htmlspecialchars ($ e ->getMessage ())
540
+ . '</span><br/><br/> '
541
+
542
+ . 'Please check the following conditions. You can ask your hosting provider to help with this. '
543
+ . '<ul> '
544
+ . '<li>Make sure outside connections to ' . ($ client ? htmlspecialchars ($ client ->getApiEndpoint ()) : 'Mollie ' ) . ' are not blocked.</li> '
545
+ . '<li>Make sure SSL v3 is disabled on your server. Mollie does not support SSL v3.</li> '
546
+ . '<li>Make sure your server is up-to-date and the latest security patches have been installed.</li> '
547
+ . '</ul><br/> '
548
+
549
+ . 'Contact <a href="mailto:info@mollie.nl">info@mollie.nl</a> if this still does not fix your problem. ' ;
512
550
}
513
551
}
514
552
You can’t perform that action at this time.
0 commit comments