1. Go to this page and download the library: Download composite/invoice-wrapper 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/ */
composite / invoice-wrapper example snippets
use Composite\InvoiceWrapper\Facades\InvoiceWrapper;
use Carbon\Carbon;
$invoicePayload = [
// Your invoice payload here
];
// Issue the invoice using the selected provider
$invoice = InvoiceWrapper::issueInvoice($invoicePayload);
use Composite\InvoiceWrapper\InvoiceWrapper;
use Carbon\Carbon;
$config = [
'selected_provider' => env('INVOICING_PROVIDER'),
'providers' => [
'billingo' => [
'name' => 'Billingo',
'base_url' => env('BILLINGO_BASE_URL', 'https://api.billingo.hu/v3/'),
'api_key' => env('BILLINGO_API_KEY'),
'block_id' => env('BILLINGO_BLOCK_ID', 0),
'waybill_block_id' => env('BILLINGO_WAYBILL_BLOCK_ID', 0),
],
'szamlazzhu' => [
'name' => 'Szamlazz.hu',
'api_key' => env('SZAMLAZZHU_API_KEY'),
'proforma_prefix'=>env('SZAMLAZZHU_PROFORMA_PREFIX','ORDER'),
]
],
];
$invoicePayload = [
// Your invoice payload here
];
// Issue the invoice using the selected provider
$invoiceWrapper = new InvoiceWrapper(
\Composite\InvoiceWrapper\Factories\InvoiceGatewayFactory::create($config)
);
$invoiceWrapper->issueInvoice($invoicePayload);