File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
app/code/Magento/Paypal/Controller/Express Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,25 @@ public function execute(): ResultInterface
168
168
return $ controllerResult ->setData ($ responseContent );
169
169
}
170
170
171
+ /**
172
+ * Prepare quote specified for checkout.
173
+ *
174
+ * @return \Magento\Quote\Api\Data\CartInterface
175
+ * @throws LocalizedException
176
+ */
177
+ private function prepareQuote ()
178
+ {
179
+ $ quoteId = $ this ->getRequest ()->getParam ('quote_id ' );
180
+ if ($ quoteId ) {
181
+ $ quote = $ this ->userContext ->getUserId ()
182
+ ? $ this ->cartRepository ->get ($ quoteId )
183
+ : $ this ->guestCartRepository ->get ($ quoteId );
184
+ if ((int )$ quote ->getCustomer ()->getId () === (int )$ this ->userContext ->getUserId ()) {
185
+ return $ quote ;
186
+ }
187
+ }
188
+ return $ this ->_getQuote ();
189
+ }
171
190
/**
172
191
* Get paypal token
173
192
*
@@ -176,7 +195,7 @@ public function execute(): ResultInterface
176
195
*/
177
196
private function getToken (): ?string
178
197
{
179
- $ quote = $ this ->_getQuote ();
198
+ $ quote = $ this ->prepareQuote ();
180
199
$ this ->_initCheckout ($ quote );
181
200
182
201
if ($ quote ->getIsMultiShipping ()) {
You can’t perform that action at this time.
0 commit comments