Skip to content

tomaj/invoice-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invoice client

In development mode.

Build Status Code Climate Test Coverage Dependency Status

Latest Stable Version

Basic usage

use Invoice\InvoiceApi;
use Invoice\Invoice;
use Invoice\InvoiceItem;

$invoiceApi = new InvoiceApi('*APIKEY*');

$invoiceItem = new InvoiceItem();
$invoiceItem
    ->setQuantity(10)
    ->setPrice(2.4)
    ->setVat(20);

$invoice = new Invoice();
$invoice
    ->setName('Invoice 12323')
    ->setDescription('invoice description...')
    ->addItem($invoiceItem);
    // there are other method to set invoice properties... 

$result = $invoiceApi->createInvoice($invoice);

if ($result->isOK()) {
    echo "Download pdf: " . $result->getDownloadUrl() . "\n";
    echo "Online HTML version:" . $result->getHtmlUrl() . "\n";
} else {
    echo "Error: " . $result->getErrorMessage() . "\n";
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published