From 239b092895b883ed96598c02bacfddd9f406a6e5 Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Tue, 17 Mar 2015 13:09:11 +0530 Subject: [PATCH] CRM-16126 - Ignoring "test" mode flag while retrieving payment processor https://issues.civicrm.org/jira/browse/CRM-16126 --- CRM/Contribute/Form/AbstractEditPayment.php | 2 +- CRM/Member/Form/Membership.php | 3 ++- CRM/Member/Form/MembershipRenewal.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 4630d49a28..1cfbd87a17 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -423,7 +423,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co $this->_processors[$id] = ts($processor['name']); } //get the valid recurring processors. - $test = $this->_mode == strtolower('test') ? TRUE : FALSE; + $test = strtolower($this->_mode) == 'test' ? TRUE : FALSE; $recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, $test, 'is_recur = 1'); $this->_recurPaymentProcessors = array_intersect_assoc($this->_processors, $recurring); } diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 4b3de6666c..03d074fae9 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -549,7 +549,8 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { if ($this->_mode) { //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); $autoRenew = array(); if (!empty($recurProcessor)) { diff --git a/CRM/Member/Form/MembershipRenewal.php b/CRM/Member/Form/MembershipRenewal.php index 9e13609322..8a29e112da 100644 --- a/CRM/Member/Form/MembershipRenewal.php +++ b/CRM/Member/Form/MembershipRenewal.php @@ -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(); -- 2.25.1