add services && controller && first configuration tree builder

This commit is contained in:
2019-07-16 11:58:38 +02:00
parent d89a7aba8d
commit e0dee9e9d8
9 changed files with 188 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<?php
namespace Bluesquare\BillingBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class BillingController extends AbstractController
{
/**
* @Route("/bluesquare/billing-bundle/webhook", name="bluesquare.billing_bundle.webhook")
*/
public function webhook()
{
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace Bluesquare\BillingBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
class BillingExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$loader = new YamlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);
$loader->load('services.yaml');
$this->addAnnotatedClassesToCompile([
'Bluesquare\\BillingBundle\\Controller\\'
]);
$config = $this->processConfiguration($configuration, $configs);
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace Acme\SocialBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('billing');
$treeBuilder->getRootNode()->children()
->arrayNode('stripe')->children()
->scalarNode('stripe_api_key_pub')->end()
->scalarNode('stripe_api_key')->end()
->scalarNode('stripe_webhook_key')->end()
->end()
->end();
return $treeBuilder;
}
}

View File

View File

@@ -0,0 +1,5 @@
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

View File

@@ -0,0 +1,8 @@
<?php
namespace Bluesquare\BillingBundle\Service;
class PaymentSrv
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Bluesquare\BillingBundle\Service;
class BillingSrv
{
public function createPurchase($arr)
{
}
}