1 | <?php |
||
30 | class OrderTaxesApplicator implements OrderTaxesApplicatorInterface |
||
31 | { |
||
32 | /** |
||
33 | * @var CalculatorInterface |
||
34 | */ |
||
35 | protected $taxCalculator; |
||
36 | |||
37 | /** |
||
38 | * @var DefaultTaxZoneProviderInterface |
||
39 | */ |
||
40 | protected $defaultTaxZoneProvider; |
||
41 | |||
42 | /** |
||
43 | * @var FactoryInterface |
||
44 | */ |
||
45 | protected $adjustmentFactory; |
||
46 | |||
47 | /** |
||
48 | * @var IntegerDistributorInterface |
||
49 | */ |
||
50 | protected $integerDistributor; |
||
51 | |||
52 | /** |
||
53 | * @var TaxRateResolverInterface |
||
54 | */ |
||
55 | protected $taxRateResolver; |
||
56 | |||
57 | /** |
||
58 | * @var ZoneMatcherInterface |
||
59 | */ |
||
60 | protected $zoneMatcher; |
||
61 | |||
62 | /** |
||
63 | * @param CalculatorInterface $taxCalculator |
||
64 | * @param DefaultTaxZoneProviderInterface $defaultTaxZoneProvider |
||
65 | * @param FactoryInterface $adjustmentFactory |
||
66 | * @param IntegerDistributorInterface $integerDistributor |
||
67 | * @param TaxRateResolverInterface $taxRateResolver |
||
68 | * @param ZoneMatcherInterface $zoneMatcher |
||
69 | */ |
||
70 | public function __construct( |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function apply(OrderInterface $order) |
||
104 | |||
105 | /** |
||
106 | * @param OrderInterface $order |
||
107 | * @param ZoneInterface $zone |
||
108 | */ |
||
109 | protected function processTaxes(OrderInterface $order, ZoneInterface $zone) |
||
133 | |||
134 | /** |
||
135 | * @param OrderItemUnitInterface $unit |
||
136 | * @param int $amount |
||
137 | * @param string $label |
||
138 | * @param bool $included |
||
139 | */ |
||
140 | protected function addAdjustment(OrderItemUnitInterface $unit, $amount, $label, $included) |
||
150 | |||
151 | /** |
||
152 | * @param AddressInterface|null $shippingAddress |
||
153 | * |
||
154 | * @return ZoneInterface|null |
||
155 | */ |
||
156 | private function getTaxZone(AddressInterface $shippingAddress = null) |
||
165 | |||
166 | /** |
||
167 | * @param OrderInterface $order |
||
168 | */ |
||
169 | private function clearTaxes(OrderInterface $order) |
||
176 | } |
||
177 |