CRM-16126 - Ignoring "test" mode flag while retrieving payment processor
[civicrm-core.git] / CRM / Member / Form / MembershipRenewal.php
index 9e136093228bd4620c85117fe6191d3e67935e68..8a29e112da3733399be1d407c51c5aed24375bbe 100644 (file)
@@ -325,7 +325,8 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
     $recurProcessor = array();
     if ($this->_mode || ($this->_action & CRM_Core_Action::UPDATE)) {
       //get the valid recurring processors.
-      $recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, 'is_recur = 1');
+      $test = strtolower($this->_mode) == 'test' ? TRUE : FALSE;
+      $recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, $test, 'is_recur = 1');
       $recurProcessor = array_intersect_assoc($this->_processors, $recurring);
       if (!empty($recurProcessor)) {
         $autoRenew = array();