Completed
Push — master ( 3ee5ff...5084e8 )
by Joachim
12:38
created

PaymentNatureService::getSupportsRelease()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Loevgaard\AltaPay\Response\Partial\Transaction;
3
4
use Loevgaard\AltaPay\Response\Partial\PartialResponse;
5
6
class PaymentNatureService extends PartialResponse
7
{
8
    /**
9
     * @var string
10
     */
11
    private $name;
12
13
    /**
14
     * @var boolean
15
     */
16
    private $supportsRefunds;
17
18
    /**
19
     * @var boolean
20
     */
21
    private $supportsRelease;
22
23
    /**
24
     * @var boolean
25
     */
26
    private $supportsMultipleCaptures;
27
28
    /**
29
     * @var boolean
30
     */
31
    private $supportsMultipleRefunds;
32
33
    /**
34
     * @return string
35
     */
36
    public function getName() : string
37
    {
38
        return $this->name;
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function getSupportsRefunds() : bool
45
    {
46
        return $this->supportsRefunds;
47
    }
48
49
    /**
50
     * @return bool
51
     */
52
    public function getSupportsRelease() : bool
53
    {
54
        return $this->supportsRelease;
55
    }
56
57
    /**
58
     * @return bool
59
     */
60
    public function getSupportsMultipleCaptures() : bool
61
    {
62
        return $this->supportsMultipleCaptures;
63
    }
64
65
    /**
66
     * @return bool
67
     */
68
    public function getSupportsMultipleRefunds() : bool
69
    {
70
        return $this->supportsMultipleRefunds;
71
    }
72
73
    protected function init()
74
    {
75
        $this->name = (string)$this->xmlDoc['name'];
76
        $this->supportsRefunds = (string)$this->xmlDoc->SupportsRefunds === 'true';
77
        $this->supportsRelease = (string)$this->xmlDoc->SupportsRelease === 'true';
78
        $this->supportsMultipleCaptures = (string)$this->xmlDoc->SupportsMultipleCaptures === 'true';
79
        $this->supportsMultipleRefunds = (string)$this->xmlDoc->SupportsMultipleRefunds === 'true';
80
    }
81
}
82