forked from accesto/PayumPayU
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PayUPaymentFactory.php
55 lines (48 loc) · 1.51 KB
/
PayUPaymentFactory.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Accesto\Component\Payum\PayU;
use Payum\Bundle\PayumBundle\DependencyInjection\Factory\Gateway\AbstractGatewayFactory;
use Payum\Core\Action\CapturePaymentAction;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
/**
* Class PayUPaymentFactory
* @package Accesto\Component\Payum\PayU
*/
class PayUPaymentFactory extends AbstractGatewayFactory
{
/**
* @param ArrayNodeDefinition $builder
*/
public function addConfiguration(ArrayNodeDefinition $builder)
{
parent::addConfiguration($builder);
$builder
->children()
->scalarNode('environment')->isRequired()->defaultValue('secure')->end()
->scalarNode('pos_id')->isRequired()->cannotBeEmpty()->end()
->scalarNode('signature_key')->isRequired()->cannotBeEmpty()->end()
->scalarNode('oauth_client_id')->defaultNull()->end()
->scalarNode('oauth_secret')->defaultNull()->end()
->end()
;
}
/**
* {@inheritDoc}
*/
protected function getPayumGatewayFactoryClass()
{
return 'Accesto\Component\Payum\PayU\PayUGatewayFactory';
}
/**
* The payment name,
* For example paypal_express_checkout_nvp or authorize_net_aim
*
* @return string
*/
public function getName()
{
return 'payu';
}
}