CouponManagementInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Quote\Api;
  8. /**
  9. * Coupon management service interface.
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface CouponManagementInterface
  14. {
  15. /**
  16. * Returns information for a coupon in a specified cart.
  17. *
  18. * @param int $cartId The cart ID.
  19. * @return string The coupon code data.
  20. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
  21. */
  22. public function get($cartId);
  23. /**
  24. * Adds a coupon by code to a specified cart.
  25. *
  26. * @param int $cartId The cart ID.
  27. * @param string $couponCode The coupon code data.
  28. * @return bool
  29. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
  30. * @throws \Magento\Framework\Exception\CouldNotSaveException The specified coupon could not be added.
  31. */
  32. public function set($cartId, $couponCode);
  33. /**
  34. * Deletes a coupon from a specified cart.
  35. *
  36. * @param int $cartId The cart ID.
  37. * @return bool
  38. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
  39. * @throws \Magento\Framework\Exception\CouldNotDeleteException The specified coupon could not be deleted.
  40. */
  41. public function remove($cartId);
  42. }