1 | <?php |
||
2 | /** |
||
3 | * Directebank Issuers. |
||
4 | * |
||
5 | * @author Pronamic <[email protected]> |
||
6 | * @copyright 2005-2019 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::PHYSICAL; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
55 | |||
56 | case PaymentLineType::DIGITAL: |
||
57 | case PaymentLineType::DISCOUNT: |
||
58 | case PaymentLineType::SHIPPING: |
||
59 | default: |
||
60 | return self::DIGITAL; |
||
61 | } |
||
62 | } |
||
63 | } |
||
64 |