You've already forked symfony-billing
add services && controller && first configuration tree builder
This commit is contained in:
16
BillingBundle/Controller/BillingController.php
Normal file
16
BillingBundle/Controller/BillingController.php
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
26
BillingBundle/DependencyInjection/BillingExtension.php
Normal file
26
BillingBundle/DependencyInjection/BillingExtension.php
Normal 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);
|
||||
}
|
||||
}
|
||||
25
BillingBundle/DependencyInjection/Configuration.php
Normal file
25
BillingBundle/DependencyInjection/Configuration.php
Normal 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;
|
||||
}
|
||||
}
|
||||
0
BillingBundle/Resources/config.xml
Normal file
0
BillingBundle/Resources/config.xml
Normal file
5
BillingBundle/Resources/services.yaml
Normal file
5
BillingBundle/Resources/services.yaml
Normal 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.
|
||||
8
BillingBundle/Service.php
Normal file
8
BillingBundle/Service.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Bluesquare\BillingBundle\Service;
|
||||
|
||||
class PaymentSrv
|
||||
{
|
||||
|
||||
}
|
||||
11
BillingBundle/Service/BillingSrv.php
Normal file
11
BillingBundle/Service/BillingSrv.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Bluesquare\BillingBundle\Service;
|
||||
|
||||
class BillingSrv
|
||||
{
|
||||
public function createPurchase($arr)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user