Completed
Push — master ( a6c5ed...9fedb9 )
by
unknown
02:28
created

CreditCard   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypes() 0 8 1
A getCvcLength() 0 8 1
1
<?php
2
/**
3
 *
4
 * NOTICE OF LICENSE
5
 *
6
 * This source file is subject to the GNU General Public License (GPL 3)
7
 * that is bundled with this package in the file LICENSE.txt
8
 *
9
 * DISCLAIMER
10
 *
11
 * Do not edit or add to this file if you wish to upgrade Payone to newer
12
 * versions in the future. If you wish to customize Payone for your
13
 * needs please refer to http://www.payone.de for more information.
14
 *
15
 * @category        Payone
16
 * @package         Payone_Settings
17
 * @subpackage      Configuration
18
 * @copyright       Copyright (c) 2012 <[email protected]> - www.noovias.com
19
 * @author          Matthias Walter <[email protected]>
20
 * @license         <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
21
 * @link            http://www.noovias.com
22
 */
23
24
/**
25
 *
26
 * @category        Payone
27
 * @package         Payone_Settings
28
 * @subpackage      Configuration
29
 * @copyright       Copyright (c) 2012 <[email protected]> - www.noovias.com
30
 * @license         <http://www.gnu.org/licenses/> GNU General Public License (GPL 3)
31
 * @link            http://www.noovias.com
32
 */
33
class Payone_Settings_Configuration_PaymentMethod_CreditCard
34
    extends Payone_Settings_Configuration_Abstract
35
{
36
    /**
37
     * @return array
38
     */
39
    public function getTypes()
40
    {
41
        $constants = $this->getClassConstants('Payone_Api_Enum_CreditcardType');
42
43
        $constants = array_flip($constants);
44
45
        return $constants;
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public function getCvcLength()
52
    {
53
        return array(
54
            Payone_Api_Enum_CreditcardType::VISA => 3,
55
            Payone_Api_Enum_CreditcardType::AMEX => 4,
56
            Payone_Api_Enum_CreditcardType::MASTERCARD => 3
57
        );
58
    }
59
60
}
61