-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.php
42 lines (33 loc) · 935 Bytes
/
start.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
use Laravel\Log;
use Laravel\IoC;
use Laravel\Autoloader;
use Laravel\Bundle;
Log::debug('== starting payments bundle ==');
Autoloader::directories(array(
Bundle::path('payments') . 'libraries',
));
Autoloader::namespaces(array(
'Payments' => Bundle::path('payments'),
));
/**
* Register IoC objects
*/
IoC::singleton('configs', function()
{
Log::debug('loading configurations into IoC');
return Configuration::build();
});
IoC::register('paguelofacil', function()
{
//TODO is there any way to load this according to configs and avoid manual registration of gateways
$configs = IoC::resolve('configs');
Log::debug('creating paguelofacil payment gateway');
return new PagueloFacilGateway($configs->paguelofacil);
});
IoC::singleton('paymentManager', function()
{
$configs = IoC::resolve('configs');
Log::debug('creating payment manager');
return new DefaultPaymentManager($configs->paymentServicesList);
});