From eced33375ad3d2b5bb6b963f095cc9eaddccab26 Mon Sep 17 00:00:00 2001 From: Lisa Marie Maginnis Date: Tue, 2 Aug 2016 11:25:18 -0400 Subject: [PATCH] Added flow for removing autorenew --- trustcommerceIPN.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/trustcommerceIPN.php b/trustcommerceIPN.php index 0f12f4b..532c70a 100644 --- a/trustcommerceIPN.php +++ b/trustcommerceIPN.php @@ -243,6 +243,11 @@ class CRM_Core_Payment_trustcommerce_IPN extends CRM_Core_Payment_BaseIPN { $msg = 'TrustCommerceIPN: Created contribution: '.$ids['contribution'].' for contact: '.$ids['contact'].' amount: $'.$input['amount'].' trxn_id: '.$input['trxn_id'].' status: Failed'."\n"; echo $msg; CRM_Core_Error::debug_log_message($msg); + + /* Action for repeated failures */ + if(MAX_FAILURES <= $this->getLastFailures($ids['contributionRecur'])) { + $this->disableAutoRenew(($ids['contributionRecur'])); + } return $this->failed($objects, $transaction); } -- 2.25.1