From: Chris Burgess Date: Wed, 8 May 2013 02:42:41 +0000 (+1200) Subject: Fix CRM-12560 by matching test trxn_ids only which can be incremented. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c3e297c4daabeea9615e405b67ff8351388a6cc7;p=civicrm-core.git Fix CRM-12560 by matching test trxn_ids only which can be incremented. --- 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);