Skip to content

Commit

Permalink
Added get/set shipping/tax amount methods to the Checkout Interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Feb 26, 2024
1 parent b25f10b commit f207f3f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/Checkout/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions src/Checkout/Contracts/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Vanilo\Contracts\Address;
use Vanilo\Contracts\Billpayer;
use Vanilo\Contracts\CheckoutSubject;
use Vanilo\Contracts\DetailedAmount;

interface Checkout
{
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit f207f3f

Please sign in to comment.