Skip to content

Commit 1fc4a7a

Browse files
committed
[HIGH-132] Added Official patches for Magento 2.3.5.
1 parent 01e9fc2 commit 1fc4a7a

2 files changed

+165
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
diff --git a/vendor/amzn/amazon-pay-module/Model/OrderInformationManagement.php b/vendor/amzn/amazon-pay-module/Model/OrderInformationManagement.php
2+
index 540b357..c18ef91 100644
3+
--- a/vendor/amzn/amazon-pay-module/Model/OrderInformationManagement.php
4+
+++ b/vendor/amzn/amazon-pay-module/Model/OrderInformationManagement.php
5+
@@ -144,24 +144,11 @@ public function saveOrderInformation($amazonOrderReferenceId, $allowedConstraint
6+
];
7+
8+
$responseParser = $this->clientFactory->create($storeId)->setOrderReferenceDetails($data);
9+
- try {
10+
- $response = $this->amazonSetOrderDetailsResponseFactory->create(
11+
- [
12+
- 'response' => $responseParser
13+
- ]
14+
- );
15+
+ $response = $this->amazonSetOrderDetailsResponseFactory->create([
16+
+ 'response' => $responseParser
17+
+ ]);
18+
19+
- $this->validateConstraints($response, $allowedConstraints);
20+
- } catch (AmazonServiceUnavailableException $e) {
21+
- if($e->getApiErrorCode() == 'OrderReferenceNotModifiable') {
22+
- $this->logger->warning(
23+
- "Could not modify Amazon order details for $amazonOrderReferenceId: "
24+
- . $e->getApiErrorMessage()
25+
- );
26+
- } else {
27+
- throw $e;
28+
- }
29+
- }
30+
+ $this->validateConstraints($response, $allowedConstraints);
31+
} catch (LocalizedException $e) {
32+
throw $e;
33+
} catch (Exception $e) {
34+
diff --git a/vendor/amzn/amazon-pay-module/Plugin/ConfirmOrderReference.php b/vendor/amzn/amazon-pay-module/Plugin/ConfirmOrderReference.php
35+
index 6bad468..14b1264 100644
36+
--- a/vendor/amzn/amazon-pay-module/Plugin/ConfirmOrderReference.php
37+
+++ b/vendor/amzn/amazon-pay-module/Plugin/ConfirmOrderReference.php
38+
@@ -25,6 +25,7 @@
39+
use Amazon\Payment\Model\OrderInformationManagement;
40+
use Magento\Quote\Api\Data\PaymentInterface;
41+
use Magento\Quote\Api\Data\AddressInterface;
42+
+use Magento\Framework\Webapi\Rest\Request;
43+
use Magento\Framework\Exception\LocalizedException;
44+
use Amazon\Payment\Gateway\Config\Config as GatewayConfig;
45+
use Magento\Quote\Api\CartRepositoryInterface;
46+
@@ -41,6 +42,11 @@ class ConfirmOrderReference
47+
*/
48+
private $checkoutSession;
49+
50+
+ /**
51+
+ * @var Request
52+
+ */
53+
+ private $request;
54+
+
55+
/**
56+
* @var OrderInformationManagement
57+
*/
58+
@@ -54,19 +60,31 @@ class ConfirmOrderReference
59+
/**
60+
* ConfirmOrderReference constructor.
61+
* @param Session $checkoutSession
62+
+ * @param Request $request
63+
* @param OrderInformationManagement $orderInformationManagement
64+
* @param CartRepositoryInterface $quoteRepository
65+
*/
66+
public function __construct(
67+
Session $checkoutSession,
68+
+ Request $request,
69+
OrderInformationManagement $orderInformationManagement,
70+
CartRepositoryInterface $quoteRepository
71+
) {
72+
$this->checkoutSession = $checkoutSession;
73+
+ $this->request = $request;
74+
$this->orderInformationManagement = $orderInformationManagement;
75+
$this->quoteRepository = $quoteRepository;
76+
}
77+
78+
+ /**
79+
+ * @return boolean
80+
+ */
81+
+ protected function canConfirmOrderReference()
82+
+ {
83+
+ $data = $this->request->getRequestData();
84+
+ return !empty($data['confirmOrder']);
85+
+ }
86+
+
87+
/**
88+
* @param PaymentMethodManagementInterface $subject
89+
* @param $result
90+
@@ -94,10 +112,12 @@ public function afterSet(
91+
$this->orderInformationManagement->saveOrderInformation($amazonOrderReferenceId);
92+
}
93+
94+
- $this->orderInformationManagement->confirmOrderReference(
95+
- $amazonOrderReferenceId,
96+
- $quote->getStoreId()
97+
- );
98+
+ if ($this->canConfirmOrderReference()) {
99+
+ $this->orderInformationManagement->confirmOrderReference(
100+
+ $amazonOrderReferenceId,
101+
+ $quote->getStoreId()
102+
+ );
103+
+ }
104+
}
105+
}
106+
107+
diff --git a/vendor/amzn/amazon-pay-module/view/frontend/web/js/action/place-order.js b/vendor/amzn/amazon-pay-module/view/frontend/web/js/action/place-order.js
108+
index 63caadf..a254c3d 100644
109+
--- a/vendor/amzn/amazon-pay-module/view/frontend/web/js/action/place-order.js
110+
+++ b/vendor/amzn/amazon-pay-module/view/frontend/web/js/action/place-order.js
111+
@@ -40,6 +40,7 @@ define(
112+
quoteId: quote.getQuoteId()
113+
});
114+
payload = {
115+
+ confirmOrder: true,
116+
cartId: quote.getQuoteId(),
117+
email: quote.guestEmail,
118+
paymentMethod: paymentData,
119+
@@ -48,6 +49,7 @@ define(
120+
} else {
121+
serviceUrl = urlBuilder.createUrl('/carts/mine/set-payment-information', {});
122+
payload = {
123+
+ confirmOrder: true,
124+
cartId: quote.getQuoteId(),
125+
paymentMethod: paymentData,
126+
billingAddress: quote.billingAddress()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--- Controller/Account/LoginPost.php (revision 27f2363d53c441fc4377d61578a3651c0a504f3e)
2+
+++ Controller/Account/LoginPost.php (revision 7baa634062cbee1d64503dc23e0bef7676bd8617)
3+
@@ -67,6 +67,11 @@
4+
*/
5+
private $cookieMetadataManager;
6+
7+
+ /**
8+
+ * @var CustomerUrl
9+
+ */
10+
+ private $customerUrl;
11+
+
12+
/**
13+
* @param Context $context
14+
* @param Session $customerSession
15+
@@ -200,10 +205,11 @@
16+
}
17+
} catch (EmailNotConfirmedException $e) {
18+
$value = $this->customerUrl->getEmailConfirmationUrl($login['username']);
19+
- $message = __(
20+
+ $this->messageManager->addError(__(
21+
'This account is not confirmed. <a href="%1">Click here</a> to resend confirmation email.',
22+
$value
23+
- );
24+
+ ));
25+
+ $this->session->setUsername($login['username']);
26+
} catch (AuthenticationException $e) {
27+
$message = __(
28+
'The account sign-in was incorrect or your account is disabled temporarily. '
29+
--- Test/Unit/Controller/Account/LoginPostTest.php (revision 7baa634062cbee1d64503dc23e0bef7676bd8617)
30+
+++ Test/Unit/Controller/Account/LoginPostTest.php (revision b44f9ba21ca0cba017277c715fbc715a256fdc3b)
31+
@@ -557,7 +557,7 @@
32+
$url
33+
);
34+
$this->messageManager->expects($this->once())
35+
- ->method('addErrorMessage')
36+
+ ->method('addError')
37+
->with($message)
38+
->willReturnSelf();
39+

0 commit comments

Comments
 (0)