diff --git a/src/Omnipay/Common/Item.php b/src/Omnipay/Common/Item.php index 02d0652d..23eec848 100644 --- a/src/Omnipay/Common/Item.php +++ b/src/Omnipay/Common/Item.php @@ -126,4 +126,36 @@ public function setPrice($value) { return $this->setParameter('price', $value); } + + /** + * {@inheritDoc} + */ + public function getTaxes() + { + return $this->getParameter('taxes'); + } + + /** + * Set the item tax amount + */ + public function setTaxes($value) + { + return $this->setParameter('taxes', $value); + } + + /** + * {@inheritDoc} + */ + public function getDiscount() + { + return $this->getParameter('discount'); + } + + /** + * Set the item discount + */ + public function setDiscount($value) + { + return $this->setParameter('discount', $value); + } } diff --git a/src/Omnipay/Common/ItemInterface.php b/src/Omnipay/Common/ItemInterface.php index 9380e65c..14446a34 100644 --- a/src/Omnipay/Common/ItemInterface.php +++ b/src/Omnipay/Common/ItemInterface.php @@ -32,4 +32,14 @@ public function getQuantity(); * Price of the item */ public function getPrice(); + + /** + * Discount for the item + */ + public function getDiscount(); + + /** + * Taxes for the item + */ + public function getTaxes(); } diff --git a/tests/Omnipay/Common/ItemTest.php b/tests/Omnipay/Common/ItemTest.php index 8c008b51..614bb354 100644 --- a/tests/Omnipay/Common/ItemTest.php +++ b/tests/Omnipay/Common/ItemTest.php @@ -52,4 +52,16 @@ public function testPrice() $this->item->setPrice('10.01'); $this->assertSame('10.01', $this->item->getPrice()); } + + public function testTaxes() + { + $this->item->setTaxes('50.55'); + $this->assertSame('50.55', $this->item->getTaxes()); + } + + public function testDiscount() + { + $this->item->setDiscount('10.57'); + $this->assertSame('10.57', $this->item->getDiscount()); + } }