From c3e297c4daabeea9615e405b67ff8351388a6cc7 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Wed, 8 May 2013 14:42:41 +1200 Subject: [PATCH] Fix CRM-12560 by matching test trxn_ids only which can be incremented. --- CRM/Core/Payment/AuthorizeNet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 3b4047575d..558fe93a36 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -185,7 +185,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { // hence treat that also as test mode transaction // fix for CRM-2566 if (($this->_mode == 'test') || $response_fields[6] == 0) { - $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'test%'"; + $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id RLIKE 'test[0-9]+'"; $p = array(); $trxn_id = strval(CRM_Core_Dao::singleValueQuery($query, $p)); $trxn_id = str_replace('test', '', $trxn_id); -- 2.25.1