Added Tax in Invoice Samples

- Improvement to Sample code demonstrating how to add tax to Invoice Item.
This commit is contained in:
Jay Patel
2015-02-24 12:17:54 -06:00
parent cfe4d728e8
commit f4378f6920
3 changed files with 205 additions and 41 deletions

View File

@@ -70,6 +70,13 @@ $items[0]
$items[0]->getUnitPrice()
->setCurrency("USD")
->setValue(5);
// #### Tax Item
// You could provide Tax information to each item.
$tax = new \PayPal\Api\Tax();
$tax->setPercent(1)->setName("Local Tax on Sutures");
$items[0]->setTax($tax);
// Second Item
$items[1] = new InvoiceItem();
$items[1]
@@ -80,6 +87,13 @@ $items[1]
$items[1]->getUnitPrice()
->setCurrency("USD")
->setValue(5);
// #### Tax Item
// You could provide Tax information to each item.
$tax2 = new \PayPal\Api\Tax();
$tax2->setPercent(3)->setName("Local Tax on Injection");
$items[1]->setTax($tax2);
$invoice->setItems($items);
$invoice->getPaymentTerm()