Skip to content

Commit 35db2a1

Browse files
committed
AC-9605: Place order with disabled Payment method working
1 parent e596c60 commit 35db2a1

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

app/code/Magento/QuoteGraphQl/Plugin/Quote/ValidatePaymentOnPlaceOrder.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,32 @@
1515

1616
class ValidatePaymentOnPlaceOrder
1717
{
18+
/**
19+
* @param CartRepositoryInterface $cartRepository
20+
* @param PaymentHelper $paymentHelper
21+
*/
1822
public function __construct(
1923
private CartRepositoryInterface $cartRepository,
2024
private PaymentHelper $paymentHelper
21-
) {}
25+
) {
26+
}
2227

2328
/**
29+
* Validate payment method
30+
*
2431
* @param QuoteManagement $subject
25-
* @param $cartId
32+
* @param int $cartId
2633
* @param PaymentInterface|null $paymentMethod
2734
* @return array
2835
* @throws LocalizedException
2936
* @throws \Magento\Framework\Exception\NoSuchEntityException
37+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3038
*/
31-
public function beforePlaceOrder(QuoteManagement $subject, $cartId, PaymentInterface $paymentMethod = null): array
32-
{
39+
public function beforePlaceOrder(
40+
QuoteManagement $subject,
41+
$cartId,
42+
?PaymentInterface $paymentMethod = null
43+
): array {
3344
$quote = $this->cartRepository->getActive((int)$cartId);
3445

3546
$payment = $quote->getPayment();

0 commit comments

Comments
 (0)