Download the PHP package phobetor/billomat-bundle without Composer
On this page you can find all versions of the php package phobetor/billomat-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package billomat-bundle
Billomat API Client Bundle for Symfony 2
A Symfony 2 bundle for the Billomat API client.
Installation
Add bundle via command line
or manually to composer.json
file
Fetch the needed files:
This will install the bundle and the client to your project’s vendor
directory.
Add the bundle to your project’s AppKernel
:
Configuration
Add your credentials to app/config/config.yml
:
Using the Billomat API with a registered app is highly recommended due to higher rate limits.
Usage
Get client from Symfony’s DI container:
Automatic rate limit handling
If this client is used in asynchronous processes or CLI commands you can activate automatic waiting for rate limit reset.
In that mode all method calls that would otherwise throw a \Phobetor\Billomat\Exception\TooManyRequestsException
will wait for the rate limit reset and retry automatically.
You SHOULD NOT use this in synchronous request (e. g. a website request) because all method calls in that mode can last very long and most likely longer than your server’s gateway timeout.
There are two ways to do this.
In configuration:
After fetching from container:
Multiple configurations
You can add multiple configurations to your app/config/config.yml
. This allows you to configure multiple users, apps or combinations.
This example configures the default client without an app (which grants requests up to the standard user rate limit of 300 requests) and without automatic rate limit handling.
In addition another cli
client is configured with an app (which grants requests up to the standard app rate limit of 1000 requests) and with automatic rate limit handling.
In that way you can use a client with automatic rate limit handling in you asynchronous (and most likely long running) cli commands:
In parallel, you can use a client without a configured app (which gives you a lower, but separate rate limit) to use in your application’s requests: