ruudk/moneybird-bundle

A Symfony2 bundle for working with Moneybird

Installs: 125

Dependents: 0

Stars: 3

Watchers: 2

Forks: 2

Language: PHP

0.1.8 2015-08-04 07:32 UTC

README

A Symfony2 bundle for working with Moneybird

This bundle uses the official Moneybird PHP API created by Sjors van der Pluijm.

Installation

Step1: Require the package with Composer

php composer.phar require ruudk/moneybird-bundle

Step2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...

        new Ruudk\MoneybirdBundle\RuudkMoneybirdBundle(),
    );
}

Step3: Configure

Finally, add the following to your config.yml

# app/config/config_prod.yml

ruudk_moneybird:
    subdomain: # Subdomain
    username: # Username
    password: # Password

Congratulations! You're ready.

Use the API

$moneybird = $this->container->get('moneybird.api');

$contactService = $moneybird->getService('Contact');

$contacts = $contactService->getAll();
foreach($contacts AS $contact) {
    echo $contact->name . "<br>";
}

For full usage of the Moneybird API see the documentation.

Commands

If you want to reset your Moneybird account and delete all invoices and contacts you can run:

php app/console moneybird:reset