Commit a5881a59 authored by mattwire's avatar mattwire

Add check to warn if nfp worldpay extension is installed as it breaks things!

parent f9d20747
<?php
/**
* https://civicrm.org/licensing
*/
use CRM_Stripe_ExtensionUtil as E;
/**
* Class CRM_Stripe_Check
*/
class CRM_Mjwshared_Check {
const MIN_VERSION_MJWSHARED = '0.6';
public static function checkRequirements(&$messages) {
$extensions = civicrm_api3('Extension', 'get', [
'full_name' => 'uk.co.nfpservice.onlineworldpay',
]);
if (empty($extensions['id']) || ($extensions['values'][$extensions['id']]['status'] === 'installed')) {
$messages[] = new CRM_Utils_Check_Message(
'mjwshared_incompatible',
E::ts('You have the uk.co.nfpservice.onlineworldpay extension installed.
There are multiple versions of this extension on various sites and the source code has not been released.
It is known to be cause issues with other payment processors and should be disabled'),
E::ts('Incompatible Extension: uk.co.nfpservice.onlineworldpay'),
\Psr\Log\LogLevel::WARNING,
'fa-money'
);
}
}
}
......@@ -148,3 +148,12 @@ function mjwshared_civicrm_buildForm($formName, &$form) {
]);
}
}
/**
* Implements hook_civicrm_check().
*
* @throws \CiviCRM_API3_Exception
*/
function mjwshared_civicrm_check(&$messages) {
CRM_Mjwshared_Check::checkRequirements($messages);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment