Confirm   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 54
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A parse_request_data() 0 9 2
A validate_request() 0 5 1
A __construct() 0 3 1
A PaymentId() 0 3 1
1
<?php
2
3
/**
4
 *      Class for Confirm request
5
 *
6
 *      @package php_EasyPay
7
 *      @version 1.1
8
 *      @author Dmitry Shovchko <[email protected]>
9
 *
10
 */
11
12
namespace EasyPay\Provider31\Request;
13
14
use EasyPay\Log as Log;
15
use EasyPay\Exception;
16
17
class Confirm extends General
18
{
19
    /**
20
     *      @var string 'PaymentId' node
21
     */
22
    protected $PaymentId;
23
24
    /**
25
     *      Check constructor
26
     *
27
     *      @param \EasyPay\Provider31\Request\RAW $raw Raw request data
28
     */
29
    public function __construct($raw)
30
    {
31
        parent::__construct($raw);
32
    }
33
34
    /**
35
     *      Get PaymentId
36
     *
37
     *      @return string
38
     */
39
    public function PaymentId()
40
    {
41
        return $this->PaymentId;
42
    }
43
44
    /**
45
     *      Parse xml-request, which was previously "extracted" from the body of the http request
46
     *
47
     */
48
    protected function parse_request_data()
49
    {
50
        parent::parse_request_data();
51
52
        $r = $this->raw_request->get_nodes_from_request('Confirm');
53
54
        foreach ($r[0]->childNodes as $child)
55
        {
56
            $this->check_and_parse_request_node($child, 'PaymentId');
57
        }
58
    }
59
60
    /**
61
     *      validate Confirm request
62
     *
63
     *      @param array $options
64
     *      @throws Exception\Structure
65
     */
66
    public function validate_request($options)
67
    {
68
        parent::validate_request($options);
69
70
        $this->validate_element('PaymentId');
71
    }
72
}
73