Plemi/PlemiPayboxBundle — pull request #17 by pylebecq (2014-05-05 14:59:58+00:00)
Title: Multiple paybox support

Hi guys,

I recently worked on a project with literally 100 different paybox and we wanted to specify some default data for each paybox in the configuration so I managed to make the bundle able to manage the configurations of different "boxes".

In the configuration, you can specify a "datas" node and use the manager as usual:

``` yml
plemi_paybox:
datas:
xxxx: yyyy
```

``` php
$manager = $this->get('plemi_paybox.manager');
$request = $manager->createRequest();
```

Or you can use the new configuration syntax introduced for multiple boxes handling and use a new service which acts as a request factory.

``` yml
plemi_paybox:
boxes:
paybox1:
datas:
xxxx: yyyy
```

``` php
$requestFactory = $this->get('plemi_paybox.request_factory');
$request = $requestFactory->createRequest('paybox1');
```

Everything should be backward compatible as far as I know.

I know the PR is not complete, I think some phpdoc is not correct, and I should add something to the README to document this but I opened the PR anyway to know if you are interested to merge these changes and as a reminder that I still have some work to do :-).