Skip to content

Commit 8105205

Browse files
committed
MAGETWO-69828: [GitHub] Concurrent checkouts can lead to negative stock #6363
1 parent a9c9fce commit 8105205

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa
5555
/**
5656
* @var ResourceConnection
5757
*/
58-
private $connectionPull;
58+
private $connectionPool;
5959

6060
/**
6161
* @param \Magento\Quote\Api\GuestBillingAddressManagementInterface $billingAddressManagement
@@ -74,15 +74,15 @@ public function __construct(
7474
\Magento\Checkout\Api\PaymentInformationManagementInterface $paymentInformationManagement,
7575
\Magento\Quote\Model\QuoteIdMaskFactory $quoteIdMaskFactory,
7676
CartRepositoryInterface $cartRepository,
77-
ResourceConnection $connectionPull = null
77+
ResourceConnection $connectionPool = null
7878
) {
7979
$this->billingAddressManagement = $billingAddressManagement;
8080
$this->paymentMethodManagement = $paymentMethodManagement;
8181
$this->cartManagement = $cartManagement;
8282
$this->paymentInformationManagement = $paymentInformationManagement;
8383
$this->quoteIdMaskFactory = $quoteIdMaskFactory;
8484
$this->cartRepository = $cartRepository;
85-
$this->connectionPull = $connectionPull ?: ObjectManager::getInstance()->get(ResourceConnection::class);
85+
$this->connectionPool = $connectionPool ?: ObjectManager::getInstance()->get(ResourceConnection::class);
8686
}
8787

8888
/**
@@ -94,8 +94,8 @@ public function savePaymentInformationAndPlaceOrder(
9494
\Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
9595
\Magento\Quote\Api\Data\AddressInterface $billingAddress = null
9696
) {
97-
$salesConnection = $this->connectionPull->getConnection('sales');
98-
$checkoutConnection = $this->connectionPull->getConnection('checkout');
97+
$salesConnection = $this->connectionPool->getConnection('sales');
98+
$checkoutConnection = $this->connectionPool->getConnection('checkout');
9999
$salesConnection->beginTransaction();
100100
$checkoutConnection->beginTransaction();
101101

app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function setUp()
8383
'cartManagement' => $this->cartManagementMock,
8484
'cartRepository' => $this->cartRepositoryMock,
8585
'quoteIdMaskFactory' => $this->quoteIdMaskFactoryMock,
86-
'connectionPull' => $this->resourceConnectionMock,
86+
'connectionPool' => $this->resourceConnectionMock,
8787
]
8888
);
8989
$objectManager->setBackwardCompatibleProperty($this->model, 'logger', $this->loggerMock);

0 commit comments

Comments
 (0)