tomaj / invoice-client
Invoice client
dev-master
2018-02-21 20:24 UTC
Requires
- php: >= 5.5.0
- guzzlehttp/guzzle: ^6.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: >4.2
- squizlabs/php_codesniffer: ~2.0
This package is not auto-updated.
Last update: 2024-10-26 18:06:33 UTC
README
In development mode.
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"; }