From 48e3da5973bddf17e7fb614e10d48e3959168487 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Thu, 3 Nov 2016 17:27:32 +0530 Subject: [PATCH] CRM-19590: Failed CC Contributions Listed with Status of Pending (Incomplete Transaction) Instead of Failed --- CRM/Core/Payment/AuthorizeNet.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 19b4bcec9c..f264ae83fd 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -167,15 +167,19 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { curl_close($submit); $response_fields = $this->explode_csv($response); + + // fetch available contribution statuses + $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); + // check gateway MD5 response if (!$this->checkMD5($response_fields[37], $response_fields[6], $response_fields[9])) { + $params['payment_status_id'] = array_search('Failed', $contributionStatus); return self::error(9003, 'MD5 Verification failed'); } // check for application errors // TODO: // AVS, CVV2, CAVV, and other verification results - $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); switch ($response_fields[0]) { case self::AUTH_REVIEW : $params['payment_status_id'] = array_search('Pending', $contributionStatus); -- 2.25.1