AvailabilityChecker.php 941 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Braintree\Model\InstantPurchase\CreditCard;
  7. use Magento\Braintree\Gateway\Config\Config;
  8. use Magento\InstantPurchase\PaymentMethodIntegration\AvailabilityCheckerInterface;
  9. /**
  10. * Availability of Braintree vaults for instant purchase.
  11. */
  12. class AvailabilityChecker implements AvailabilityCheckerInterface
  13. {
  14. /**
  15. * @var Config
  16. */
  17. private $config;
  18. /**
  19. * AvailabilityChecker constructor.
  20. * @param Config $config
  21. */
  22. public function __construct(Config $config)
  23. {
  24. $this->config = $config;
  25. }
  26. /**
  27. * @inheritdoc
  28. */
  29. public function isAvailable(): bool
  30. {
  31. if ($this->config->isVerify3DSecure()) {
  32. // Support of 3D secure not implemented for instant purchase yet.
  33. return false;
  34. }
  35. return true;
  36. }
  37. }