invoiced / invoiced
Invoiced PHP Library
2.4.2
2023-02-21 16:30 UTC
Requires
- php: >=5.4
- ext-json: *
- ext-mbstring: *
- firebase/php-jwt: ~5.0|~6.0
- guzzlehttp/guzzle: ^6.0|^7.0
Requires (Dev)
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^4.0|^5.0|^6.0|^7.0|^8.0|^9.0
- yoast/phpunit-polyfills: ^1.0
README
This repository contains the PHP client library for the Invoiced API.
Installing
The Invoiced package can be installed with composer:
composer require invoiced/invoiced
Requirements
- PHP 5.5+, PHP 7+, or PHP 8+
- Composer
Usage
First, you must instantiate a new client
$invoiced = new Invoiced\Client('{API_KEY}');
Then, API calls can be made like this:
// retrieve invoice $invoice = $invoiced->Invoice->retrieve('{INVOICE_ID}'); // mark as paid $payment = $invoiced->Payment->create([ 'amount' => $invoice->balance, 'method' => 'check', 'applied_to' => [ [ 'type' => 'invoice', 'invoice' => $invoice->id, 'amount' => $invoice->balance, ], ] ]);
If you want to use the sandbox API instead then you must set the second argument on the client to true
like this:
$invoiced = new Invoiced\Client("{SANDBOX_API_KEY}", true);
Developing
The test suite can be ran with phpunit
Deploying
In order to deploy a new version to Packagist, a new release must be created in GitHub.