From f207f3fb23844376922b32d91ded2ab2ce5d61cc Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:23:59 +0200 Subject: [PATCH] Added get/set shipping/tax amount methods to the Checkout Interface --- Changelog.md | 7 ++++++- src/Checkout/Changelog.md | 7 ++++++- src/Checkout/Contracts/Checkout.php | 9 +++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index a4fbee13b..217cd6204 100644 --- a/Changelog.md +++ b/Changelog.md @@ -46,7 +46,12 @@ - BC: Added the `?CheckoutSubject` return type to the `getCart()` method of the `Checkout` interface - BC: Changed `Checkout::getShippingAddress()` return type to be nullable - BC: Added the void return type to `Checkout::setShippingAddress()` -- BC: Added the `removeShippingAddress()` method to the Checkout interface +- BC: Added the following methods to the Checkout interface: + - `removeShippingAddress()` + - `getShippingAmount()` + - `setShippingAmount()` + - `getTaxesAmount()` + - `setTaxesAmount()` - BC: The unused `$config` parameter has been removed from the `RequestStore` checkout driver constructor - BC: Added the `deleteByType()` and `clear()` methods to the `AdjustmentCollection` interface - Fixed possible null return type on Billpayer::getName() when is_organization is true but the company name is null diff --git a/src/Checkout/Changelog.md b/src/Checkout/Changelog.md index 41317a5dc..396fd9fb9 100644 --- a/src/Checkout/Changelog.md +++ b/src/Checkout/Changelog.md @@ -13,7 +13,12 @@ - BC: The unused `$config` parameter has been removed from the `RequestStore` checkout driver constructor - BC: Changed `Checkout::getShippingAddress()` return type to be nullable - BC: Added the void return type to `Checkout::setShippingAddress()` -- BC: Added the `removeShippingAddress()` method to the Checkout interface +- BC: Added the following methods to the Checkout interface: + - `removeShippingAddress()` + - `getShippingAmount()` + - `setShippingAmount()` + - `getTaxesAmount()` + - `setTaxesAmount()` ## 3.x Series diff --git a/src/Checkout/Contracts/Checkout.php b/src/Checkout/Contracts/Checkout.php index 0449ef582..228419070 100644 --- a/src/Checkout/Contracts/Checkout.php +++ b/src/Checkout/Contracts/Checkout.php @@ -17,6 +17,7 @@ use Vanilo\Contracts\Address; use Vanilo\Contracts\Billpayer; use Vanilo\Contracts\CheckoutSubject; +use Vanilo\Contracts\DetailedAmount; interface Checkout { @@ -71,6 +72,14 @@ public function putCustomAttributes(array $data): void; public function getCustomAttributes(): array; + public function getShippingAmount(): DetailedAmount; + + public function setShippingAmount(float|DetailedAmount $amount): void; + + public function getTaxesAmount(): DetailedAmount; + + public function setTaxesAmount(float|DetailedAmount $amount): void; + /** * Update checkout data with an array of attributes *