Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $transacti
$transaction->setData('parent_id', $parentId);
}
} else {
$result = $this->getParentId($orderId);
$result = $this->getParentId($orderId, (string)$transaction->getTransactionId());
if ($result) {
$transaction->setData('parent_id', $result[0]['transaction_id']);
$transaction->setData('parent_txn_id', $result[0]['parent_txn_id']);
Expand Down Expand Up @@ -224,9 +224,10 @@ private function _getLoadByUniqueKeySelect($orderId, $paymentId, $txnId, $column
* Retrieve transaction by the unique key of order_id
*
* @param int $orderId
* @param string $currentTransactionId
* @return array
*/
protected function getParentId(int $orderId): array
protected function getParentId(int $orderId, string $currentTransactionId): array
{
$connection = $this->getConnection();
$select = $connection->select()->from(
Expand All @@ -235,6 +236,9 @@ protected function getParentId(int $orderId): array
)->where(
'order_id = ?',
$orderId
)->where(
'transaction_id <> ?',
$currentTransactionId
)->order('transaction_id', 'ASC')->limit(1);
return $connection->fetchAll($select);
}
Expand Down