Completed
Push — master ( eaf845...272b76 )
by Oleksandr
13s queued 10s
created

CrefoPayControllerProvider::defineControllers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 24
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 32
rs 9.536
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Yves\CrefoPay\Plugin\Provider;
9
10
use Silex\Application;
11
use SprykerShop\Yves\ShopApplication\Plugin\Provider\AbstractYvesControllerProvider;
12
13
class CrefoPayControllerProvider extends AbstractYvesControllerProvider
14
{
15
    protected const BUNDLE_NAME = 'CrefoPay';
16
    protected const CALLBACK_CONTROLLER_NAME = 'Callback';
17
    protected const NOTIFICATION_CONTROLLER_NAME = 'Notification';
18
    protected const CREFO_PAY_NOTIFICATION = 'crefo-pay-notification';
19
    protected const CREFO_PAY_CONFIRMATION = 'crefo-pay-confirmation';
20
    protected const CREFO_PAY_SUCCESS = 'crefo-pay-success';
21
    protected const CREFO_PAY_FAILURE = 'crefo-pay-failure';
22
23
    /**
24
     * @param \Silex\Application $app
25
     *
26
     * @return void
27
     */
28
    protected function defineControllers(Application $app)
29
    {
30
        $this->createController(
31
            '/crefo-pay/notification',
32
            static::CREFO_PAY_NOTIFICATION,
33
            static::BUNDLE_NAME,
34
            static::NOTIFICATION_CONTROLLER_NAME,
35
            'index'
36
        );
37
38
        $this->createController(
39
            '/crefo-pay/callback/confirmation',
40
            static::CREFO_PAY_CONFIRMATION,
41
            static::BUNDLE_NAME,
42
            static::CALLBACK_CONTROLLER_NAME,
43
            'confirmation'
44
        );
45
46
        $this->createController(
47
            '/crefo-pay/callback/success',
48
            static::CREFO_PAY_SUCCESS,
49
            static::BUNDLE_NAME,
50
            static::CALLBACK_CONTROLLER_NAME,
51
            'success'
52
        );
53
54
        $this->createController(
55
            '/crefo-pay/callback/failure',
56
            static::CREFO_PAY_FAILURE,
57
            static::BUNDLE_NAME,
58
            static::CALLBACK_CONTROLLER_NAME,
59
            'failure'
60
        );
61
    }
62
}
63