* @inheritDoc
*
* @param CRM_Extension_Info $info
+ * @throws CRM_Core_Exception
*/
public function onPreInstall(CRM_Extension_Info $info) {
$paymentProcessorTypes = $this->_getAllPaymentProcessorTypes('class_name');
if (array_key_exists($info->key, $paymentProcessorTypes)) {
- CRM_Core_Error::fatal(ts('This payment processor type is already installed.'));
+ throw new CRM_Core_Exception(ts('This payment processor type is already installed.'));
}
$ppByName = $this->_getAllPaymentProcessorTypes('name');
if (array_key_exists($info->name, $ppByName)) {
- CRM_Core_Error::fatal(ts('This payment processor type already exists.'));
+ throw new CRM_Core_Exception(ts('This payment processor type already exists.'));
}
$dao = new CRM_Financial_DAO_PaymentProcessorType();
break;
default:
- CRM_Core_Error::fatal(ts('Billing mode in info file has wrong value.'));
+ throw new CRM_Core_Exception(ts('Billing mode in info file has wrong value.'));
}
$dao->is_recur = trim($info->typeInfo['isRecur']);
public function onPreUninstall(CRM_Extension_Info $info) {
$paymentProcessorTypes = $this->_getAllPaymentProcessorTypes('class_name');
if (!array_key_exists($info->key, $paymentProcessorTypes)) {
- CRM_Core_Error::fatal(ts('This payment processor type is not registered.'));
+ throw new CRM_Core_Exception(ts('This payment processor type is not registered.'));
}
$dao = new CRM_Financial_DAO_PaymentProcessor();
}
if (empty($class_name)) {
- CRM_Core_Error::fatal("Unable to find payment processor in " . __CLASS__ . '::' . __METHOD__);
+ throw new CRM_Core_Exception('Unable to find payment processor in ' . __CLASS__ . '::' . __METHOD__);
}
// In the case of uninstall, check for instances of PP first.