You are here

interface TaxRateResolverInterface in Commerce Core 8.2

Defines the interface for tax rate resolvers.

Hierarchy

Expanded class hierarchy of TaxRateResolverInterface

All classes that implement TaxRateResolverInterface

1 file declares its use of TaxRateResolverInterface
TaxRateResolver.php in modules/tax/tests/modules/commerce_tax_test/src/Resolver/TaxRateResolver.php

File

modules/tax/src/Resolver/TaxRateResolverInterface.php, line 12

Namespace

Drupal\commerce_tax\Resolver
View source
interface TaxRateResolverInterface {

  // Stops resolving when there is no applicable tax rate (cause the
  // provided order item is exempt from sales tax, for example).
  const NO_APPLICABLE_TAX_RATE = 'no_applicable_tax_rate';

  /**
   * Resolves the tax rate for the given tax zone.
   *
   * @param \Drupal\commerce_tax\TaxZone $zone
   *   The tax zone.
   * @param \Drupal\commerce_order\Entity\OrderItemInterface $order_item
   *   The order item.
   * @param \Drupal\profile\Entity\ProfileInterface $customer_profile
   *   The customer profile. Contains the address and tax number.
   *
   * @return \Drupal\commerce_tax\TaxRate|string|null
   *   The tax rate, NO_APPLICABLE_TAX_RATE, or NULL.
   */
  public function resolve(TaxZone $zone, OrderItemInterface $order_item, ProfileInterface $customer_profile);

}

Members

Namesort descending Modifiers Type Description Overrides
TaxRateResolverInterface::NO_APPLICABLE_TAX_RATE constant
TaxRateResolverInterface::resolve public function Resolves the tax rate for the given tax zone. 3