| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
$attributes['name'], TRUE
);
- $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Financial_DAO_PaymentProcessor', $this->_id));
+ $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
+ 'CRM_Financial_DAO_PaymentProcessor',
+ $this->_id,
+ ));
$this->add('text', 'description', ts('Description'),
$attributes['description']
$errors = array();
if (!(self::checkSection($fields, $errors) ||
- self::checkSection($fields, $errors, 'test')
- )) {
+ self::checkSection($fields, $errors, 'test')
+ )
+ ) {
$errors['_qf_default'] = ts('You must have at least the test or live section filled');
}
$domainID = CRM_Core_Config::domainID();
$dao = new CRM_Financial_DAO_PaymentProcessor();
- $dao->id = $this->_id;
+ $dao->id = $this->_id;
$dao->domain_id = $domainID;
if (!$dao->find(TRUE)) {
return $defaults;
// now get testID
$testDAO = new CRM_Financial_DAO_PaymentProcessor();
- $testDAO->name = $dao->name;
- $testDAO->is_test = 1;
+ $testDAO->name = $dao->name;
+ $testDAO->is_test = 1;
$testDAO->domain_id = $domainID;
if ($testDAO->find(TRUE)) {
$this->_testID = $testDAO->id;
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Financial_BAO_PaymentProcessor::del($this->_id);
CRM_Core_Session::setStatus("", ts('Payment Processor Deleted.'), "success");
- return;
+ return NULL;
}
$values = $this->controller->exportValues($this->_name);
* @param int $domainID
* @param $test
*
- * @return Void
+ * @return void
*/
public function updatePaymentProcessor(&$values, $domainID, $test) {
$dao = new CRM_Financial_DAO_PaymentProcessor();
- $dao->id = $test ? $this->_testID : $this->_id;
- $dao->domain_id = $domainID;
- $dao->is_test = $test;
+ $dao->id = $test ? $this->_testID : $this->_id;
+ $dao->domain_id = $domainID;
+ $dao->is_test = $test;
$dao->is_default = CRM_Utils_Array::value('is_default', $values, 0);
$dao->is_active = CRM_Utils_Array::value('is_active', $values, 0);
}
// also copy meta fields from the info DAO
- $dao->is_recur = $this->_ppDAO->is_recur;
+ $dao->is_recur = $this->_ppDAO->is_recur;
$dao->billing_mode = $this->_ppDAO->billing_mode;
- $dao->class_name = $this->_ppDAO->class_name;
+ $dao->class_name = $this->_ppDAO->class_name;
$dao->payment_type = $this->_ppDAO->payment_type;
$dao->save();
);
CRM_Financial_BAO_FinancialTypeAccount::add($params);
}
+
}