diff --git a/CHANGELOG.md b/CHANGELOG.md index 47af18af..53eab49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changes - Removed relationship links from responses by default +- Changed price taxation config to `lunar.pricing.stored_inclusive_of_tax` from `lunar-api.general.taxation.prices_with_default_tax` ### ⚠️ Breaking changes diff --git a/config/general.php b/config/general.php index 539f8be1..aa195571 100644 --- a/config/general.php +++ b/config/general.php @@ -23,11 +23,6 @@ 'max_size' => 48, ], - // Tax defaults - 'taxation' => [ - 'prices_with_default_tax' => true, - ], - // Purchasable 'purchasable' => [ 'non_eloquent_types' => [ diff --git a/src/Domain/Prices/Actions/GetPrice.php b/src/Domain/Prices/Actions/GetPrice.php index e828b84a..8923c4df 100644 --- a/src/Domain/Prices/Actions/GetPrice.php +++ b/src/Domain/Prices/Actions/GetPrice.php @@ -14,7 +14,7 @@ class GetPrice public function __construct() { - $this->withTax = Config::get('lunar-api.general.taxation.prices_with_default_tax'); + $this->withTax = Config::get('lunar.pricing.stored_inclusive_of_tax'); $this->getPriceWithDefaultTax = new GetPriceWithDefaultTax; } @@ -24,10 +24,11 @@ public function __construct() */ public function __invoke(Price $price, Purchasable $purchasable): Price { + // NOTE: If prices are stored inclusive of tax, we can return the price as is if ($this->withTax) { - return ($this->getPriceWithDefaultTax)($price, $purchasable); + return $price; } - return $price; + return ($this->getPriceWithDefaultTax)($price, $purchasable); } }