-
Notifications
You must be signed in to change notification settings - Fork 16
/
Patch-Magento-Checkout-GuestPaymentInformationManagement-2.2.8-missing-orders.patch
54 lines (53 loc) · 2.28 KB
/
Patch-Magento-Checkout-GuestPaymentInformationManagement-2.2.8-missing-orders.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- Model/GuestPaymentInformationManagement.php
+++ Model/GuestPaymentInformationManagement.php
@@ -95,35 +95,25 @@ class GuestPaymentInformationManagement implements \Magento\Checkout\Api\GuestPa
\Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
\Magento\Quote\Api\Data\AddressInterface $billingAddress = null
) {
- $salesConnection = $this->connectionPull->getConnection('sales');
- $checkoutConnection = $this->connectionPull->getConnection('checkout');
- $salesConnection->beginTransaction();
- $checkoutConnection->beginTransaction();
-
+ $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress);
try {
- $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress);
- try {
- $orderId = $this->cartManagement->placeOrder($cartId);
- } catch (\Magento\Framework\Exception\LocalizedException $e) {
- throw new CouldNotSaveException(
- __($e->getMessage()),
- $e
- );
- } catch (\Exception $e) {
- $this->getLogger()->critical($e);
- throw new CouldNotSaveException(
- __('An error occurred on the server. Please try to place the order again.'),
- $e
- );
- }
- $salesConnection->commit();
- $checkoutConnection->commit();
+ $orderId = $this->cartManagement->placeOrder($cartId);
+ } catch (\Magento\Framework\Exception\LocalizedException $e) {
+ $this->getLogger()->critical(
+ 'Placing an order with quote_id ' . $cartId . ' is failed: ' . $e->getMessage()
+ );
+ throw new CouldNotSaveException(
+ __($e->getMessage()),
+ $e
+ );
} catch (\Exception $e) {
- $salesConnection->rollBack();
- $checkoutConnection->rollBack();
- throw $e;
+ $this->getLogger()->critical($e);
+ throw new CouldNotSaveException(
+ __('An error occurred on the server. Please try to place the order again.'),
+ $e
+ );
}
-
+
return $orderId;
}