Simplify VFD is a PHP library to interact with the Simplify VFD API. This library provides a simple and easy-to-use interface to integrate VFD services into your PHP applications.
- User Authentication: Authenticate users and obtain access tokens.
- Invoice Management: Create, retrieve, and manage invoices.
- Environment Configuration: Switch between live and stage environments.
- HTTP Client Integration: Uses Guzzle HTTP client for making API requests.
- Custom GUID Generation: Utility function for generating unique identifiers.
You can install the package via Composer:
composer require alphaolomi/simplify-vfd
The SimplifyVfd
class requires a configuration array with the following keys:
environment
: The environment to use (live
orstage
).username
: Your Simplify VFD username.password
: Your Simplify VFD password.
use Alphaolomi\SimplifyVfd\SimplifyVfd;
$config = [
'environment' => 'stage', // or 'live'
'username' => 'your_username',
'password' => 'your_password',
];
$service = new SimplifyVfd($config, $client);
$data = [
'username' => 'your_username',
'password' => 'your_password'
];
$response = $service->userLogin($data);
print_r($response);
$data = [
'dateTime' => date('Y-m-d'),
'customer' => [
'identificationType' => 'ID',
'identificationNumber' => '1234567890',
'vatRegistrationNumber' => '123456789',
'name' => 'Customer Name',
'mobileNumber' => '255123456789',
'email' => '[email protected]',
],
'invoiceAmountType' => 'GROSS',
'items' => [
[
'itemName' => 'Product 1',
'quantity' => 1,
'price' => 100.00
]
],
'payments' => [
[
'paymentType' => 'CASH',
'amount' => 100.00
]
],
'partnerInvoiceId' => 'unique-invoice-id'
];
$response = $service->createIssuedInvoice($data);
print_r($response);
$partnerInvoiceId = 'unique-invoice-id';
$response = $service->getInvoiceByPartnerInvoiceId($partnerInvoiceId);
print_r($response);
Using PestPHP for testing, Code coverage is generated by PHPUnit. Codecov is used to generate code coverage reports and badges.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
- Alpha Olomi
- Ernest Malcolm
- All Contributors
The MIT License (MIT). Please see License File for more information.