TaxCalculationInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Api;
  7. /**
  8. * Tax calculation interface.
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface TaxCalculationInterface
  13. {
  14. /**#@+
  15. * Type of calculation used
  16. */
  17. const CALC_UNIT_BASE = 'UNIT_BASE_CALCULATION';
  18. const CALC_ROW_BASE = 'ROW_BASE_CALCULATION';
  19. const CALC_TOTAL_BASE = 'TOTAL_BASE_CALCULATION';
  20. /**#@-*/
  21. /**
  22. * Calculate Tax
  23. *
  24. * @param \Magento\Tax\Api\Data\QuoteDetailsInterface $quoteDetails
  25. * @param null|int $storeId
  26. * @param bool $round
  27. * @return \Magento\Tax\Api\Data\TaxDetailsInterface
  28. */
  29. public function calculateTax(
  30. \Magento\Tax\Api\Data\QuoteDetailsInterface $quoteDetails,
  31. $storeId = null,
  32. $round = true
  33. );
  34. /**
  35. * Get default rate request
  36. *
  37. * @param int $productTaxClassID
  38. * @param int $customerId
  39. * @param string $storeId
  40. * @return float
  41. */
  42. public function getDefaultCalculatedRate($productTaxClassID, $customerId = null, $storeId = null);
  43. /**
  44. * Get rate request
  45. *
  46. * @param int $productTaxClassID
  47. * @param int $customerId
  48. * @param string $storeId
  49. * @return float
  50. */
  51. public function getCalculatedRate($productTaxClassID, $customerId = null, $storeId = null);
  52. }