ShippingMethodChooserInterface.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\InstantPurchase\Model\ShippingMethodChoose;
  7. use Magento\Customer\Model\Customer;
  8. use Magento\Customer\Model\Address;
  9. use Magento\Quote\Api\Data\ShippingMethodInterface;
  10. /**
  11. * Interface to choose shipping method for customer address if available.
  12. *
  13. * If chooser return existed shipping method it will be used to place order.
  14. *
  15. * Instant purchase supports deferred shipping method choose that allow select method after quote creation.
  16. * To implement deferred choose return ShippingMethodInterface instance with carrier code equals to
  17. * DeferredShippingMethodChooserInterface::CARRIER and shipping method code as a key to deferred chooser registered in
  18. * DeferredShippingMethodChooserPool.
  19. *
  20. * @api
  21. * @since 100.2.0
  22. */
  23. interface ShippingMethodChooserInterface
  24. {
  25. /**
  26. * @param Address $address
  27. * @return ShippingMethodInterface|null
  28. * @since 100.2.0
  29. */
  30. public function choose(Address $address);
  31. }