Download the PHP package targito/targito-api-bundle without Composer
On this page you can find all versions of the php package targito/targito-api-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download targito/targito-api-bundle
More information about targito/targito-api-bundle
Files in targito/targito-api-bundle
Package targito-api-bundle
Short Description Targito API implementation for Symfony
License MIT
Informations about the package targito-api-bundle
Targito API Symfony Bundle for Symfony 4 & 5
To see description of the api methods, see the library description
Installation
composer require targito/targito-api-bundle
If you use Symfony Flex the bundle should be enabled automatically.
If you're not using it, add Targito\Bundle\Api\TargitoApiBundle
to your config/bundles.php
file:
If you want to change any of the default settings, create a file targito_api.yaml
in your config/packages
directory
with key targito_api
:
Note: You can let Symfony generate the default config for you like this:
./bin/console config:dump targito_api > config/packages/targito_api.yaml
Usage
Simply use the provided services (with autowiring support):
Targito\Api\TargitoApi
Targito\Api\Endpoint\TargitoContactEndpoint
Targito\Api\Endpoint\TargitoTransactEndpoint
Examples
Get the whole api service:
Get specific api module:
Configuring credentials
By default, the bundle takes the credentials from environment variables TARGITO_ACCOUNT_ID
and TARGITO_API_PASSWORD
.
If you want to provide the credentials other way, read on, otherwise you can skip this section.
There are two built-in options for specifying credentials: via environment variables or explicitly. You can also specify your own credentials service.
Explicit
When using explicit mode, the credentials must be also specified inside the config.
Environment variables
When using environment variables, you can optionally specify the environment variable names.
Custom service
You can specify your own service which implements the Targito\Api\Credentials\CredentialsInterface
interface.
Configuring http request service
By default, this bundle (and underlying library) choose automatically between curl and stream based implementations.
You can provide your own (or use the curl/stream library regardless of curl support on the PHP level).
The service must implement Targito\Api\Http\HttpRequestInterface
.
or
or
Full configuration reference (autogenerated)
All versions of targito-api-bundle with dependencies
symfony/framework-bundle Version ^4.4|^5.0
symfony/yaml Version ^4.4|^5.0
targito/targito-api Version ^1.3.0