From 9d0f10b7f4bddc52c7e2f669926e5e9ae0eb974d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 27 Jan 2015 13:34:49 +1300 Subject: [PATCH] allow dummy to take mulitple trxn_ids --- CRM/Core/Payment/Dummy.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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\\_%'"; -- 2.25.1