PHP code example of honey-comb / invoices

1. Go to this page and download the library: Download honey-comb/invoices library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

honey-comb / invoices example snippets


protected $listen = [
    \HoneyComb\Payments\Events\HCPaymentCreated::class => [
        \App\Listeners\HCPaymentCreatedListener::class
    ],
];

$invoiceItemDto = (new HCInvoiceItemDTO())
        ->setLabel('Product')
        ->setQuantity(1)
        ->setVat(2)
        ->setAmount(10)
        ->setUnitPrice(10)
        ->setVatTotal(2)
        ->setAmountTotal(12);

$invoiceDto = (new HCInvoiceDTO())
    ->setAmount(10)
    ->setAmountTotal(12)
    ->setVat(2)
    ->setInvoiceDate('2016-04-13')
    ->setItems([
        $invoiceItemDto->toArray(),
    ]);

return $this->invoiceService->createAdvanceInvoice($invoiceDto->toArray());