Passed
Push — master ( ef0fdb...1d76f0 )
by
unknown
03:02
created

CrefoPayConfig   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
eloc 8
c 2
b 1
f 0
dl 0
loc 60
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCrefoPayUserIdMaxLength() 0 3 1
A getCrefoPayOrderIdLength() 0 3 1
A getCrefoPayBasketItemIdMaxLength() 0 3 1
A isBusinessToBusiness() 0 3 1
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\Service\CrefoPay;
9
10
use Spryker\Service\Kernel\AbstractBundleConfig;
11
use SprykerEco\Shared\CrefoPay\CrefoPayConstants;
12
13
class CrefoPayConfig extends AbstractBundleConfig
14
{
15
    /**
16
     * @var int
17
     */
18
    protected const CREFO_PAY_ORDER_ID_LENGTH = 30;
19
20
    /**
21
     * @var int
22
     */
23
    protected const CREFO_PAY_USER_ID_MAX_LENGTH = 50;
24
25
    /**
26
     * @var int
27
     */
28
    protected const CREFO_PAY_BASKET_ITEM_ID_MAX_LENGTH = 20;
29
30
    /**
31
     * @api
32
     *
33
     * @return int
34
     */
35
    public function getCrefoPayOrderIdLength(): int
36
    {
37
        return static::CREFO_PAY_ORDER_ID_LENGTH;
38
    }
39
40
    /**
41
     * @api
42
     *
43
     * @return int
44
     */
45
    public function getCrefoPayUserIdMaxLength(): int
46
    {
47
        return static::CREFO_PAY_USER_ID_MAX_LENGTH;
48
    }
49
50
    /**
51
     * @api
52
     *
53
     * @return int
54
     */
55
    public function getCrefoPayBasketItemIdMaxLength(): int
56
    {
57
        return static::CREFO_PAY_BASKET_ITEM_ID_MAX_LENGTH;
58
    }
59
60
    /**
61
     * Specification:
62
     * - Represents the integration model.
63
     * - Returns `true` in case of B2B.
64
     * - Returns `false` in case of B2C.
65
     *
66
     * @api
67
     *
68
     * @return bool
69
     */
70
    public function isBusinessToBusiness(): bool
71
    {
72
        return $this->get(CrefoPayConstants::IS_BUSINESS_TO_BUSINESS, false);
73
    }
74
}
75