mollie / Magento

Mollie Payments for Magento 1.x
https://www.mollie.com/
BSD 2-Clause "Simplified" License
39 stars 30 forks source link

The Mollie outage disabled our store due to ungraceful failure #213

Closed loekvangool closed 2 years ago

loekvangool commented 2 years ago

The Mollie outage this morning lead to a fatal error in our cart, effectively closing our store:

Warning: array_column() expects parameter 1 to be array, bool given  in [...]/app/code/community/Mollie/Mpm/Helper/Data.php on line 731

Cause: https://github.com/mollie/Magento/blob/master/app/code/community/Mollie/Mpm/Helper/Data.php#L731

This can be made to fail gracefully. Something like:

$availableMethodsArray = json_decode(json_encode($availableMethods), true);
if (is_array($availableMethodsArray) === false) {
  return false;
}
$available = array_search($methodCode, array_column($availableMethodsArray, 'id'));
if ($available === false) {
  return false;
}

Maybe it would be a good idea to check the module for assumptions about other external calls as well, at least in the customer order flow.

Frank-Magmodules commented 2 years ago

HI @loekvangool ,

Quite a late response! But happy to share we've just released a new version with a fix for this issue.
Have a great day!