Skip to content

Commit 95679df

Browse files
AC-10042::/V1/transactions REST API returns error when parent_txn_id = txn_id
1 parent 48bdda9 commit 95679df

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/code/Magento/Sales/Model/ResourceModel/Order/Payment/Transaction.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
/**
1212
* Sales transaction resource model
1313
*
14-
* @author Magento Core Team <core@magentocommerce.com>
1514
*/
1615
class Transaction extends EntityAbstract implements TransactionResourceInterface
1716
{
@@ -34,6 +33,7 @@ protected function _construct()
3433

3534
/**
3635
* Update transactions in database using provided transaction as parent for them
36+
*
3737
* have to repeat the business logic to avoid accidental injection of wrong transactions
3838
*
3939
* @param \Magento\Sales\Model\Order\Payment\Transaction $transaction
@@ -149,7 +149,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $transacti
149149
$parentId = (int)$this->_lookupByTxnId($orderId, $paymentId, $parentTxnId, $idFieldName);
150150
if ($parentId && $txnType == 'authorization') {
151151
$transaction->setData('parent_id', $parentId);
152-
$transaction->setData('txn_type',\Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE);
152+
$transaction->setData('txn_type', \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE);
153153
}
154154
} else {
155155
$result = $this->getParentId($orderId);
@@ -176,7 +176,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $transacti
176176
* @param int $orderId
177177
* @param int $paymentId
178178
* @param string $txnId
179-
* @param mixed (array|string|object) $columns
179+
* @param mixed $columns (array|string|object) $columns
180180
* @param bool $isRow
181181
* @param string $txnType
182182
* @return array|string
@@ -234,7 +234,7 @@ protected function getParentId(int $orderId): array
234234
)->where(
235235
'order_id = ?',
236236
$orderId
237-
)->order('transaction_id','ASC')->limit(1);
237+
)->order('transaction_id', 'ASC')->limit(1);
238238
return $connection->fetchAll($select);
239239
}
240240
}

0 commit comments

Comments
 (0)