/**
* @param array $processor
- * @throws \Civi\Payment\CRM_Core_Exception
+ * @throws \CRM_Core_Exception
*/
public function getByProcessor($processor) {
$id = $processor['id'];
else {
$paymentClass = 'CRM_Core_' . $processor['class_name'];
if (empty($paymentClass)) {
- throw new CRM_Core_Exception('no class provided');
+ throw new \CRM_Core_Exception('no class provided');
}
require_once str_replace('_', DIRECTORY_SEPARATOR, $paymentClass) . '.php';
}
}
/**
- * @param integer $id
+ * @param int $id
* @throws \CiviCRM_API3_Exception
*/
public function getById($id) {
$processor = civicrm_api3('payment_processor', 'get_single', array('name' => $name, 'is_test' => $is_test));
return self::getByProcessor($processor);
}
+
+ /**
+ * Flush processors from static cache.
+ *
+ * This is particularly used for tests.
+ *
+ */
+ public function flushProcessors() {
+ $this->cache = array();
+ }
+
}