Payment   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 9
c 2
b 1
f 1
dl 0
loc 33
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create_PaymentId() 0 6 2
A __construct() 0 8 1
1
<?php
2
3
/**
4
 *      Class for response to Payment request
5
 *
6
 *      @package php_EasyPay
7
 *      @version 1.1
8
 *      @author Dmitry Shovchko <[email protected]>
9
 *
10
 */
11
12
namespace EasyPay\Provider31\Response;
13
14
use \EasyPay\Provider31\Response as Response;
15
16
final class Payment extends Response
17
{
18
    /**
19
     *      @var \DOMElement
20
     */
21
    protected $PaymentId;
22
23
	/**
24
     *      Payment constructor
25
     *
26
     *      @param string $paymentid
27
     */
28
    public function __construct($paymentid)
29
    {
30
		parent::__construct();
31
32
		$this->setElementValue('StatusCode', 0);
33
		$this->setElementValue('StatusDetail', 'checked');
34
35
		$this->create_PaymentId($paymentid);
36
	}
37
38
	/**
39
     *      Create PaymentId node
40
     *
41
     *      @param string $paymentid
42
     */
43
	public function create_PaymentId($paymentid)
44
	{
45
		if (isset($this->PaymentId)) return;
46
47
		$this->PaymentId = $this->createElement('PaymentId', $paymentid);
48
		$this->Response->appendChild($this->PaymentId);
49
	}
50
}
51