Skip to content

Commit

Permalink
XOL-3425 Collect Stripe level 3 data to decrease IC rates - Introduci…
Browse files Browse the repository at this point in the history
…ng tax and discount fields for Item class
  • Loading branch information
srishaharidas committed Apr 24, 2017
1 parent b1440bd commit accc2aa
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Omnipay/Common/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
10 changes: 10 additions & 0 deletions src/Omnipay/Common/ItemInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 12 additions & 0 deletions tests/Omnipay/Common/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit accc2aa

Please sign in to comment.