6 declare(strict_types=1);
56 $quote->setTotalsCollectedFlag(
false);
59 \
Magento\
Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_COUNTRY,
60 \
Magento\
Payment\Model\Method\AbstractMethod::CHECK_USE_FOR_CURRENCY,
61 \
Magento\
Payment\Model\Method\AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX,
69 if (
$address->getCountryId() ===
null) {
70 throw new InvalidTransitionException(
71 __(
'The shipping address is missing. Set the address and try again.')
74 $address->setCollectShippingRates(
true);
77 $paymentData =
$method->getData();
82 if (!$this->zeroTotalValidator->isApplicable(
$payment->getMethodInstance(),
$quote)) {
83 throw new InvalidTransitionException(
__(
'The requested Payment Method is not available.'));
87 return $quote->getPayment()->getId();
111 return $this->methodList->getAvailableMethods(
$quote);
__construct(\Magento\Quote\Api\CartRepositoryInterface $quoteRepository, \Magento\Payment\Model\Checks\ZeroTotal $zeroTotalValidator, \Magento\Payment\Model\MethodList $methodList)