* @param bool $is_active
* Value we want to set the is_active field.
*
- * @return CRM_Financial_DAO_PaymentProcessor|null
- * DAO object on success, null otherwise
- *
+ * @return bool
+ * true if we found and updated the object, else false
*/
public static function setIsActive($id, $is_active) {
return CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_PaymentProcessor', $id, 'is_active', $is_active);
*/
public static function getAllPaymentProcessors($mode = 'all', $reset = FALSE, $isCurrentDomainOnly = TRUE) {
- $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . $mode . '_' . CRM_Core_Config::domainID();
+ $cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . $mode . '_' . $isCurrentDomainOnly . '_' . CRM_Core_Config::domainID();
if (!$reset) {
$processors = CRM_Utils_Cache::singleton()->get($cacheKey);
if (!empty($processors)) {
public static function getPaymentProcessors($capabilities = array(), $ids = FALSE) {
$testProcessors = in_array('TestMode', $capabilities) ? self::getAllPaymentProcessors('test') : array();
if (is_array($ids)) {
- $processors = self::getAllPaymentProcessors('all', TRUE, FALSE);
+ $processors = self::getAllPaymentProcessors('all', FALSE, FALSE);
}
else {
- $processors = self::getAllPaymentProcessors('all', TRUE);
+ $processors = self::getAllPaymentProcessors('all');
}
if (in_array('TestMode', $capabilities) && is_array($ids)) {
* - supportsBackOffice
* - supportsLiveMode
* - supportsFutureRecurDate
+ * - supportsRecurring
* - supportsCancelRecurring
* - supportsRecurContributionsForPledges
*
}
}
+ /**
+ * Get the default financial account id for payment processor accounts.
+ *
+ * Note that there is only a 'name' field & no label field. If people customise
+ * name then this won't work. This is new best-effort functionality so that's non-regressive.
+ *
+ * The fix for that is to add a label value to the financial account table.
+ */
+ public static function getDefaultFinancialAccountID() {
+ return CRM_Core_PseudoConstant::getKey('CRM_Financial_DAO_EntityFinancialAccount', 'financial_account_id', 'Payment Processor Account');
+ }
+
}