CanUseCheckout.php 696 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Model\Checks;
  7. use Magento\Payment\Model\MethodInterface;
  8. use Magento\Quote\Model\Quote;
  9. /**
  10. * Checks possibility of payment method to be used in storefront
  11. *
  12. * @api
  13. * @since 100.0.2
  14. */
  15. class CanUseCheckout implements SpecificationInterface
  16. {
  17. /**
  18. * Check whether payment method is applicable to quote
  19. *
  20. * @param MethodInterface $paymentMethod
  21. * @param Quote $quote
  22. * @return bool
  23. */
  24. public function isApplicable(MethodInterface $paymentMethod, Quote $quote)
  25. {
  26. return $paymentMethod->canUseCheckout();
  27. }
  28. }