add signature and minor optimisation
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 4 Mar 2016 06:12:31 +0000 (11:42 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 4 Mar 2016 06:12:31 +0000 (11:42 +0530)
CRM/Admin/Form/PaymentProcessor.php

index f687933d49c86b069b4f855e213000102e78c668..d392c4337f319964304d51853711b7e777792147 100644 (file)
@@ -378,10 +378,11 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
    * @param bool $test
    */
   public function updatePaymentProcessor(&$values, $domainID, $test) {
-    if ($test == TRUE) {
-      $values['user_name'] = $values['test_user_name'];
-      $values['password'] = $values['test_password'];
-    }  
+    if ($test) {
+      foreach (array('user_name', 'password', 'signature') as $field) {
+        $values[$field] = empty($values["test_{$field}"]) ? CRM_Utils_Array::value($field, $values) : $values["test_{$field}"];
+      }
+    }
     $params  = array_merge(array(
       'id' => $test ? $this->_testID : $this->_id,
       'domain_id' => $domainID,