MoneyBird Bundle for Symfony 2 Applications. Bundle provides wrapper for moneybird-php-client
Based on KamiLabs work
TBD!!!
Prefered way to install this bundle is using composer
Download the bundle with composer:
$ php composer.phar require "thatside/that-moneybird-bundle"
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Thatside\MoneybirdBundle\ThatMoneybirdBundle(),
);
}
Add the following configuration to your config.yml.
# app/config/config.yml
that_moneybird:
redirect_url: localhost
client_id: test_client_id
client_secret: test_client_secret
debug: false # optional parameter for test mode activation
Only first three configuration values are required to use the bundle. Redirect URL is required to be non-localhost so use any tunneling service to test. (https://github.com/beameio/beame-insta-ssl recommended).
You need to set things up first to store auth code and access token somewhere.
- Redefine
that_moneybird.code_fetcher
service with your own class (useCodeFetcherInterface
for this). - Add an event subscriber listening to
moneybird.token_update
event (seeMoneybirdTokenEvent
). - Manually save authorization code after Moneybird authorization
Core component of this bundle is MoneyBird service.
It provides simple wrapper around Picqer Moneybird class - it is available by getMoneybird()
call.
Still thinking on using __call
here...
<?php
$this->get('that_moneybird');