From c2fd1d7d4fc5a0627c808b90e66d80f7ed9a9197 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Mon, 20 Mar 2017 15:36:48 -0400 Subject: [PATCH] Fixed issue with max_failure calculation --- trustcommerceIPN.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trustcommerceIPN.php b/trustcommerceIPN.php index 4f92bc6..639a3a7 100644 --- a/trustcommerceIPN.php +++ b/trustcommerceIPN.php @@ -183,6 +183,7 @@ class CRM_Core_Payment_trustcommerce_IPN extends CRM_Core_Payment_BaseIPN { return $id; } protected function processRecur($input, $ids, $objects, $first) { + $lastfailures = $this->getLastFailures($ids['contributionRecur']); $recur = &$objects['contributionRecur']; $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -285,7 +286,7 @@ class CRM_Core_Payment_trustcommerce_IPN extends CRM_Core_Payment_BaseIPN { $input['skipComponentSync'] = 1; /* Action for repeated failures */ - if(MAX_FAILURES <= $this->getLastFailures($ids['contributionRecur'])) { + if(MAX_FAILURES <= $lastfailures) { //$this->disableAutoRenew(($ids['contributionRecur'])); $this->disableAutorenew($ids['processor_id']); } -- 2.25.1