GuestCartManagementInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Api;
  7. use Magento\Quote\Api\Data\PaymentInterface;
  8. /**
  9. * Cart Management interface for guest carts.
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface GuestCartManagementInterface
  14. {
  15. /**
  16. * Enable an customer or guest user to create an empty cart and quote for an anonymous customer.
  17. *
  18. * @return string Cart ID.
  19. * @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
  20. */
  21. public function createEmptyCart();
  22. /**
  23. * Assign a specified customer to a specified shopping cart.
  24. *
  25. * @param string $cartId The cart ID.
  26. * @param int $customerId The customer ID.
  27. * @param int $storeId
  28. * @return boolean
  29. */
  30. public function assignCustomer($cartId, $customerId, $storeId);
  31. /**
  32. * Place an order for a specified cart.
  33. *
  34. * @param string $cartId The cart ID.
  35. * @param PaymentInterface|null $paymentMethod
  36. * @throws \Magento\Framework\Exception\CouldNotSaveException
  37. * @return int Order ID.
  38. */
  39. public function placeOrder($cartId, PaymentInterface $paymentMethod = null);
  40. }