for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Alcalyn\PayplugBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Alcalyn\PayplugBundle\Model\IPN;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
* {@inheritDoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('alcalyn_payplug');
$rootNode
->children()
// Payplug account parameters
->arrayNode('account')
->scalarNode('url')->end()
->scalarNode('amount_min')->end()
->scalarNode('amount_max')->end()
->arrayNode('currencies')
->prototype('scalar')->end()
->end()
->scalarNode('payplugPublicKey')->end()
->scalarNode('yourPrivateKey')->end()
// Sandbox parameters
->arrayNode('sandbox')
->addDefaultsIfNotSet()
->booleanNode('enabled')
->defaultFalse()
->scalarNode('url')->defaultNull()->end()
->scalarNode('yourPrivateKey')->defaultNull()->end()
// Entities classes to use
->arrayNode('class')
->scalarNode('ipn')->defaultValue(IPN::getClassName())->end()
;
return $treeBuilder;
}