ShippingMethodInterface.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Api\Data;
  7. /**
  8. * Interface ShippingMethodInterface
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface ShippingMethodInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. /**
  15. * Shipping carrier code.
  16. */
  17. const KEY_CARRIER_CODE = 'carrier_code';
  18. /**
  19. * Shipping method code.
  20. */
  21. const KEY_METHOD_CODE = 'method_code';
  22. /**
  23. * Shipping carrier title.
  24. */
  25. const KEY_CARRIER_TITLE = 'carrier_title';
  26. /**
  27. * Shipping method title.
  28. */
  29. const KEY_METHOD_TITLE = 'method_title';
  30. /**
  31. * Shipping amount in store currency.
  32. */
  33. const KEY_SHIPPING_AMOUNT = 'amount';
  34. /**
  35. * Shipping amount in base currency.
  36. */
  37. const KEY_BASE_SHIPPING_AMOUNT = 'base_amount';
  38. /**
  39. * Available.
  40. */
  41. const KEY_AVAILABLE = 'available';
  42. /**
  43. * Shipping error message.
  44. */
  45. const KEY_ERROR_MESSAGE = 'error_message';
  46. /**
  47. * Shipping error message.
  48. */
  49. const KEY_PRICE_EXCL_TAX = 'price_excl_tax';
  50. /**
  51. * Shipping error message.
  52. */
  53. const KEY_PRICE_INCL_TAX = 'price_incl_tax';
  54. /**
  55. * Returns the shipping carrier code.
  56. *
  57. * @return string Shipping carrier code.
  58. */
  59. public function getCarrierCode();
  60. /**
  61. * Sets the shipping carrier code.
  62. *
  63. * @param string $carrierCode
  64. * @return $this
  65. */
  66. public function setCarrierCode($carrierCode);
  67. /**
  68. * Returns the shipping method code.
  69. *
  70. * @return string Shipping method code.
  71. */
  72. public function getMethodCode();
  73. /**
  74. * Sets the shipping method code.
  75. *
  76. * @param string $methodCode
  77. * @return $this
  78. */
  79. public function setMethodCode($methodCode);
  80. /**
  81. * Returns the shipping carrier title.
  82. *
  83. * @return string|null Shipping carrier title. Otherwise, null.
  84. */
  85. public function getCarrierTitle();
  86. /**
  87. * Sets the shipping carrier title.
  88. *
  89. * @param string $carrierTitle
  90. * @return $this
  91. */
  92. public function setCarrierTitle($carrierTitle);
  93. /**
  94. * Returns the shipping method title.
  95. *
  96. * @return string|null Shipping method title. Otherwise, null.
  97. */
  98. public function getMethodTitle();
  99. /**
  100. * Sets the shipping method title.
  101. *
  102. * @param string $methodTitle
  103. * @return $this
  104. */
  105. public function setMethodTitle($methodTitle);
  106. /**
  107. * Returns the shipping amount in store currency.
  108. *
  109. * @return float Shipping amount in store currency.
  110. */
  111. public function getAmount();
  112. /**
  113. * Sets the shipping amount in store currency.
  114. *
  115. * @param float $amount
  116. * @return $this
  117. */
  118. public function setAmount($amount);
  119. /**
  120. * Returns the shipping amount in base currency.
  121. *
  122. * @return float Shipping amount in base currency.
  123. */
  124. public function getBaseAmount();
  125. /**
  126. * Sets the shipping amount in base currency.
  127. *
  128. * @param float $baseAmount
  129. * @return $this
  130. */
  131. public function setBaseAmount($baseAmount);
  132. /**
  133. * Returns the value of the availability flag for the current shipping method.
  134. *
  135. * @return bool
  136. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  137. */
  138. public function getAvailable();
  139. /**
  140. * Sets the value of the availability flag for the current shipping method.
  141. *
  142. * @param bool $available
  143. * @return $this
  144. */
  145. public function setAvailable($available);
  146. /**
  147. * Retrieve existing extension attributes object or create a new one.
  148. *
  149. * @return \Magento\Quote\Api\Data\ShippingMethodExtensionInterface|null
  150. */
  151. public function getExtensionAttributes();
  152. /**
  153. * Set an extension attributes object.
  154. *
  155. * @param \Magento\Quote\Api\Data\ShippingMethodExtensionInterface $extensionAttributes
  156. * @return $this
  157. */
  158. public function setExtensionAttributes(
  159. \Magento\Quote\Api\Data\ShippingMethodExtensionInterface $extensionAttributes
  160. );
  161. /**
  162. * Returns an error message.
  163. *
  164. * @return string Shipping Error message.
  165. */
  166. public function getErrorMessage();
  167. /**
  168. * Set an error message.
  169. *
  170. * @param string $errorMessage
  171. * @return $this
  172. */
  173. public function setErrorMessage($errorMessage);
  174. /**
  175. * Returns shipping price excl tax.
  176. *
  177. * @return float
  178. */
  179. public function getPriceExclTax();
  180. /**
  181. * Set a shipping price excl tax.
  182. *
  183. * @param float $priceExclTax
  184. * @return $this
  185. */
  186. public function setPriceExclTax($priceExclTax);
  187. /**
  188. * Returns shipping price incl tax.
  189. *
  190. * @return float
  191. */
  192. public function getPriceInclTax();
  193. /**
  194. * Set a shipping price incl tax.
  195. *
  196. * @param float $priceInclTax
  197. * @return $this
  198. */
  199. public function setPriceInclTax($priceInclTax);
  200. }