Download the PHP package usebila/bila without Composer
On this page you can find all versions of the php package usebila/bila. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bila
Bila PHP API library
The Bila PHP library provides convenient access to the Bila REST API from any PHP 8.1.0+ application.
It is generated with Stainless.
Documentation
Installation
Usage
This library uses named parameters to specify optional arguments. Parameters with a default value must be set by name.
Examples
Runnable examples live in the examples directory. Each file demonstrates a specific area of the API:
| Example | Description |
|---|---|
| accounts.php | Retrieve accounts, list accounts, and check balances |
| banks.php | List supported banks and financial institutions |
| collections.php | Collect payments via mobile money |
| resolve.php | Verify bank account and mobile money details |
| transactions.php | Retrieve and list transaction history |
| transfer-recipients.php | Manage payout recipients |
| transfers.php | Send payouts via bank transfer and mobile money |
| webhooks.php | Configure webhooks and manage delivery history |
To run an example from this repository:
Replace accounts.php with any example from the table above. Set your API key via the BILA_API_KEY environment variable or in the example file before running.
Value Objects
It is recommended to use the static with constructor Dog::with(name: "Joey")
and named parameters to initialize value objects.
However, builders are also provided (new Dog)->withName("Joey").
Handling errors
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of Bila\Core\Exceptions\APIException will be thrown:
Error codes are as follows:
| Cause | Error Type |
|---|---|
| HTTP 400 | BadRequestException |
| HTTP 401 | AuthenticationException |
| HTTP 403 | PermissionDeniedException |
| HTTP 404 | NotFoundException |
| HTTP 409 | ConflictException |
| HTTP 422 | UnprocessableEntityException |
| HTTP 429 | RateLimitException |
| HTTP >= 500 | InternalServerException |
| Other HTTP error | APIStatusException |
| Timeout | APITimeoutException |
| Network error | APIConnectionException |
Retries
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.
You can use the maxRetries option to configure or disable this:
Advanced concepts
Making custom or undocumented requests
Undocumented properties
You can send undocumented parameters to any endpoint, and read undocumented response properties, like so:
Note: the extra* parameters of the same name overrides the documented parameters.
Undocumented request params
If you want to explicitly send an extra param, you can do so with the extra_query, extra_body, and extra_headers under the request_options: parameter when making a request, as seen in the examples above.
Undocumented endpoints
To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using client.request, like so:
Versioning
This package follows SemVer conventions. As the library is in initial development and has a major version of 0, APIs may change at any time.
This package considers improvements to the (non-runtime) PHPDoc type definitions to be non-breaking changes.
Requirements
PHP 8.1.0 or higher.
Contributing
All versions of bila with dependencies
php-http/discovery Version ^1
psr/http-client Version ^1
psr/http-client-implementation Version ^1
psr/http-factory-implementation Version ^1
psr/http-message Version ^1|^2