+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
/**
* @throws Exception
*/
public static function create($params) {
- // FIXME Reconcile with CRM_Admin_Form_PaymentProcessor::updatePaymentProcessor
$processor = new CRM_Financial_DAO_PaymentProcessor();
$processor->copyValues($params);
);
CRM_Financial_BAO_FinancialTypeAccount::add($values);
}
+
Civi\Payment\System::singleton()->flushProcessors();
return $processor;
}
parent::__construct();
}
+ /**
+ * Retieve array of allowed credit cards for this payment processor.
+ * @param interger|null $paymentProcessorID id of processor.
+ * @return array
+ */
+ public static function getCreditCards($paymentProcessorID = NULL) {
+ if (!empty($paymentProcessorID)) {
+ $processor = new CRM_Financial_DAO_PaymentProcessor();
+ $processor->id = $paymentProcessorID;
+ $processor->find(TRUE);
+ $cards = json_decode($processor->accepted_credit_cards, TRUE);
+ return $cards;
+ }
+ return array();
+ }
+
/**
* Retrieve DB object based on input parameters.
*