DirectebankIssuers   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 39
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 10 5
1
<?php
2
/**
3
 * Directebank Issuers.
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2021 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Icepay
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Icepay;
12
13
use Pronamic\WordPress\Pay\Payments\PaymentLineType;
14
15
/**
16
 * Product categories.
17
 *
18
 * @author  Reüel van der Steege
19
 * @version 2.0.5
20
 * @since   2.0.5
21
 */
22
class DirectebankIssuers {
23
	/**
24
	 * Issuer 'RETAIL'.
25
	 *
26
	 * @var string
27
	 */
28
	const RETAIL = 'RETAIL';
29
30
	/**
31
	 * Issuer 'DIGITAL'.
32
	 *
33
	 * @var string
34
	 */
35
	const DIGITAL = 'DIGITAL';
36
37
	/**
38
	 * Issuer 'ADULT'.
39
	 *
40
	 * @var string
41
	 */
42
	const ADULT = 'ADULT';
43
44
	/**
45
	 * Transform Pronamic payment line type to Icepay Directebank issuer.
46
	 *
47
	 * @param string $type Pronamic payment line type.
48
	 *
49
	 * @return string
50
	 */
51
	public static function transform( $type ) {
52
		switch ( $type ) {
53
			case PaymentLineType::PHYSICAL:
54
				return self::RETAIL;
55
56
			case PaymentLineType::DIGITAL:
57
			case PaymentLineType::DISCOUNT:
58
			case PaymentLineType::SHIPPING:
59
			default:
60
				return self::DIGITAL;
61
		}
62
	}
63
}
64