Skip to content

Commit 3811b84

Browse files
committed
Fixed complete payment using outdated transaction data
1 parent 05fd554 commit 3811b84

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fixed a PHP error that could occur when upgrading to Commerce 5. ([#4077](https://github.com/craftcms/commerce/issues/4077))
66
- Fixed a bug where shipping rules weren’t saving their customer conditions correctly. ([#4079](https://github.com/craftcms/commerce/issues/4079))
7+
- Fixed a bug where outdated transaction data could be used when completing a payment.
78

89
## 5.4.2 - 2025-07-16
910

src/services/Payments.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ public function completePayment(Transaction $transaction, ?string &$customError)
410410
throw new Exception('Unable to acquire a lock for transaction: ' . $transaction->hash);
411411
}
412412

413+
// Make sure we have the latest transaction data
414+
$transaction = Plugin::getInstance()->getTransactions()->getTransactionByHash($transaction->hash);
415+
413416
// If it's successful already, we're good.
414417
if (Plugin::getInstance()->getTransactions()->isTransactionSuccessful($transaction)) {
415418
$transaction->order->updateOrderPaidInformation();

0 commit comments

Comments
 (0)