From: Eileen McNaughton Date: Tue, 27 Jan 2015 00:34:49 +0000 (+1300) Subject: allow dummy to take mulitple trxn_ids X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9d0f10b7f4bddc52c7e2f669926e5e9ae0eb974d;p=civicrm-core.git allow dummy to take mulitple trxn_ids --- diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index bb0d697341..ab9be9614b 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -33,6 +33,12 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { */ public function setDoDirectPaymentResult($doDirectPaymentResult) { $this->_doDirectPaymentResult = $doDirectPaymentResult; + if (empty($this->_doDirectPaymentResult['trxn_id'])) { + $this->_doDirectPaymentResult['trxn_id'] = (array) uniqid(); + } + else { + $this->_doDirectPaymentResult['trxn_id'] = (array) $doDirectPaymentResult['trxn_id']; + } } /** @@ -83,7 +89,9 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { ); //end of hook invocation if (!empty($this->_doDirectPaymentResult)) { - return $this->_doDirectPaymentResult; + $result = $this->_doDirectPaymentResult; + $result['trxn_id'] = array_shift($this->_doDirectPaymentResult['trxn_id']); + return $result; } if ($this->_mode == 'test') { $query = "SELECT MAX(trxn_id) FROM civicrm_contribution WHERE trxn_id LIKE 'test\\_%'";