diff --git a/vendor/magento/module-async-order-graph-ql/Model/Cart/PlaceOrderAsync.php b/vendor/magento/module-async-order-graph-ql/Model/Cart/PlaceOrderAsync.php index 743f68f665b4..5f4dab181865 100644 --- a/vendor/magento/module-async-order-graph-ql/Model/Cart/PlaceOrderAsync.php +++ b/vendor/magento/module-async-order-graph-ql/Model/Cart/PlaceOrderAsync.php @@ -1,7 +1,7 @@ paymentManagement = $paymentManagement; @@ -72,6 +80,7 @@ public function __construct( $this->submitQuoteValidator = $submitQuoteValidator; $this->customerPublisher = $customerPublisher; $this->guestPublisher = $guestPublisher; + $this->errorMapper = $errorMapper; } /** @@ -112,7 +121,11 @@ public function execute( $this->submitQuoteValidator->validateQuote($cart); if ($paymentMethod === null) { - throw new LocalizedException(__('Enter a valid payment method and try again.')); + throw new LocalizedException( + __('Enter a valid payment method and try again.'), + null, + $this->errorMapper->getErrorMessageId('Enter a valid payment method and try again') + ); } if ($userId === 0) {