feature/cierres (#25)
Varios cambios Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl> Reviewed-on: #25
This commit is contained in:
8
app/setup/settings/time.php
Normal file
8
app/setup/settings/time.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
DateTimeZone::class => function(ContainerInterface $container) {
|
||||
return new DateTimeZone($container->get('TZ') ?? 'America/Santiago');
|
||||
}
|
||||
];
|
@ -1,8 +1,10 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
'urls' => function() {
|
||||
'urls' => function(ContainerInterface $container) {
|
||||
$urls = [
|
||||
'base' => $_ENV['APP_URL'] ?? '',
|
||||
'base' => $container->get('APP_URL') ?? '',
|
||||
];
|
||||
$urls['api'] = implode('/', [
|
||||
$urls['base'],
|
||||
@ -18,13 +20,35 @@ return [
|
||||
]);
|
||||
return (object) $urls;
|
||||
},
|
||||
'permittedPaths' => [
|
||||
'/api',
|
||||
'/api/',
|
||||
],
|
||||
'simplePaths' => [
|
||||
'/api/login',
|
||||
'/api/login/',
|
||||
'/api/logout'
|
||||
],
|
||||
'apiUrls' => function(ContainerInterface $container) {
|
||||
$permittedPaths = [
|
||||
'/api'
|
||||
];
|
||||
$simplePaths = [
|
||||
'/api/login',
|
||||
'/api/logout'
|
||||
];
|
||||
function addTrailingSlash(array &$paths): array {
|
||||
foreach ($paths as $path) {
|
||||
if (!in_array(rtrim($path, '/') . '/', $paths)) {
|
||||
$paths[] = rtrim($path, '/') . '/';
|
||||
}
|
||||
}
|
||||
return $paths;
|
||||
}
|
||||
addTrailingSlash($permittedPaths);
|
||||
addTrailingSlash($simplePaths);
|
||||
return [
|
||||
'permittedPaths' => $permittedPaths,
|
||||
'simplePaths' => $simplePaths,
|
||||
'externalPaths' => [
|
||||
'/api/external' => [
|
||||
'/toku/success' => [
|
||||
'validator' => $container->get(Incoviba\Service\Venta\MediosPago\Toku::class),
|
||||
'token' => $container->get('TOKU_TOKEN'),
|
||||
]
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
];
|
||||
|
Reference in New Issue
Block a user