ConfigProviderBase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 63
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 6 1
A __construct() 0 8 1
1
<?php
2
/**
3
 * Copyright © Getnet. All rights reserved.
4
 *
5
 * @author    Bruno Elisei <[email protected]>
6
 * See LICENSE for license details.
7
 */
8
9
namespace Getnet\PaymentMagento\Model\Ui;
10
11
use Getnet\PaymentMagento\Gateway\Config\Config;
12
use Magento\Checkout\Model\ConfigProviderInterface;
13
use Magento\Payment\Model\CcConfig;
14
use Magento\Quote\Api\Data\CartInterface;
15
16
/**
17
 * Class ConfigProviderBase - Defines properties of the payment form.
18
 */
19
class ConfigProviderBase implements ConfigProviderInterface
20
{
21
    /*
22
     * @const string
23
     */
24
    public const CODE = 'getnet_paymentmagento';
25
26
    /*
27
     * @var METHOD CODE CC
28
     */
29
    public const METHOD_CODE_CC = 'getnet_paymentmagento_cc';
30
31
    /*
32
     * @var METHOD CODE CC VAULT
33
     */
34
    public const METHOD_CODE_CC_VAULT = 'getnet_paymentmagento_cc_vault';
35
36
    /*
37
     * @var METHOD CODE BOLETO
38
     */
39
    public const METHOD_CODE_BOLETO = 'getnet_paymentmagento_boleto';
40
41
    /**
42
     * @var Config
43
     */
44
    private $config;
45
46
    /**
47
     * @var CartInterface
48
     */
49
    private $cart;
50
51
    /**
52
     * @var CcConfig
53
     */
54
    protected $ccConfig;
55
56
    /**
57
     * @param Config        $config
58
     * @param CartInterface $cart
59
     * @param CcConfig      $ccConfig
60
     */
61
    public function __construct(
62
        Config $config,
63
        CartInterface $cart,
64
        CcConfig $ccConfig
65
    ) {
66
        $this->config = $config;
67
        $this->cart = $cart;
68
        $this->ccConfig = $ccConfig;
69
    }
70
71
    /**
72
     * Retrieve assoc array of checkout configuration.
73
     *
74
     * @return array
75
     */
76
    public function getConfig()
77
    {
78
        return [
79
            'payment' => [
80
                Config::METHOD => [
81
                    'isActive' => false,
82
                ],
83
            ],
84
        ];
85
    }
86
}
87