Skip to content

Commit 308f16c

Browse files
committed
Update communication status check. Check platform compatibility. Display possible fixes.
1 parent d9e40e7 commit 308f16c

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

admin/controller/payment/mollie/base.php

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,53 @@ protected function checkModuleStatus ()
500500
*/
501501
protected function checkCommunicationStatus ()
502502
{
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+
*/
503518
try
504519
{
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();
506528

507529
return '<span style="color: green">OK</span>';
508530
}
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+
}
509535
catch (Mollie_API_Exception $e)
510536
{
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.';
512550
}
513551
}
514552

0 commit comments

Comments
 (0)