Example #1
0
 /**
  * Process the form submission.
  *
  *
  * @return Void
  */
 public function postProcess()
 {
     CRM_Utils_System::flushCache('CRM_Financial_DAO_PaymentProcessor');
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_Financial_BAO_PaymentProcessor::del($this->_id);
         CRM_Core_Session::setStatus("", ts('Payment Processor Deleted.'), "success");
         return NULL;
     }
     $values = $this->controller->exportValues($this->_name);
     $domainID = CRM_Core_Config::domainID();
     if (!empty($values['is_default'])) {
         $query = "UPDATE civicrm_payment_processor SET is_default = 0 WHERE domain_id = {$domainID}";
         CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
     }
     $this->updatePaymentProcessor($values, $domainID, FALSE);
     $this->updatePaymentProcessor($values, $domainID, TRUE);
     CRM_Core_Session::setStatus(ts('Payment processor %1 has been saved.', array(1 => "<em>{$values['name']}</em>")), ts('Saved'), 'success');
 }