Symfony Bundle for RevolutPHP - https://github.com/sverraest/revolut-php
This bundle is for Symfony3 and higher.
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require sverraest/revolut-php-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Sverraest\RevolutPHPBundle\SverraestRevolutPHPBundle(),
);
// ...
}
// ...
}
You must specify the following configuration
sverraest_revolut_php:
api_key: 'foo'
mode: 'production' # options are production or sandbox
You can get an instance of the public RevolutPHP Service or autowire it.
// src/AppBundle/Controller/AcmeController.php
...
$revolut = $this->get('revolut_php.client');
print_r($revolut->accounts->all())
...
Or via autowiring:
// src/AppBundle/Service/AcmeService.php
...
public function __construct(RevolutPHP\Client $client)
{
$this->client = $client;
}
...
Read the documentation for this bundle