From dc7793a0c218ca4d303570641632a731ab0653af Mon Sep 17 00:00:00 2001 From: Allen Shaw Date: Mon, 6 Dec 2021 15:18:06 -0600 Subject: [PATCH] Fix for #198: Double Receipts & Payment Details from Cybersource Payments --- CRM/Core/Payment/OmnipayMultiProcessor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Payment/OmnipayMultiProcessor.php b/CRM/Core/Payment/OmnipayMultiProcessor.php index 3642d7dda..1f97f67e6 100644 --- a/CRM/Core/Payment/OmnipayMultiProcessor.php +++ b/CRM/Core/Payment/OmnipayMultiProcessor.php @@ -816,9 +816,11 @@ public function processPaymentNotification($params) { if ($response->isSuccessful()) { try { //cope with CRM14950 not being implemented - $this->loadContribution(); - if ($this->getLock() && $this->contribution['contribution_status_id:name'] !== 'Completed') { + $lock = Civi::lockManager()->acquire('data.contribute.contribution.' . $this->transaction_id, 5); + + $this->loadContribution(); + if ($this->contribution['contribution_status_id:name'] !== 'Completed') { $this->gatewayConfirmContribution($response); $trxnReference = $response->getTransactionReference(); civicrm_api3('contribution', 'completetransaction', [