IDealIssuersRequestMessage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 15
c 1
b 0
f 0
dl 0
loc 48
ccs 14
cts 14
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_document() 0 17 1
A __construct() 0 4 1
1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\MultiSafepay\XML;
4
5
use Pronamic\WordPress\Pay\Core\XML\Util as XML_Util;
6
use Pronamic\WordPress\Pay\Gateways\MultiSafepay\Merchant;
7
8
/**
9
 * Title: MultiSafepay Connect XML iDEAL issuers request message
10
 * Description:
11
 * Copyright: 2005-2021 Pronamic
12
 * Company: Pronamic
13
 *
14
 * @author  Remco Tolsma
15
 * @version 2.0.2
16
 * @since   1.2.0
17
 */
18
class IDealIssuersRequestMessage extends RequestMessage {
19
	/**
20
	 * The document element name
21
	 *
22
	 * @var string
23
	 */
24
	const NAME = 'idealissuers';
25
26
	/**
27
	 * Merchant.
28
	 *
29
	 * @var Merchant
30
	 */
31
	public $merchant;
32
33
	/**
34
	 * Constructs and initialize an directory response message
35
	 *
36
	 * @param Merchant $merchant Merchant.
37
	 */
38 1
	public function __construct( Merchant $merchant ) {
39 1
		parent::__construct( self::NAME );
40
41 1
		$this->merchant = $merchant;
42 1
	}
43
44
	/**
45
	 * Get document
46
	 *
47
	 * @see Pronamic_Gateways_IDealAdvancedV3_XML_RequestMessage::get_document()
48
	 */
49 1
	public function get_document() {
50 1
		$document = parent::get_document();
51
52
		// Merchant.
53 1
		$merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' );
54
55 1
		XML_Util::add_elements(
56 1
			$document,
57 1
			$merchant,
58
			array(
59 1
				'account'          => $this->merchant->account,
60 1
				'site_id'          => $this->merchant->site_id,
61 1
				'site_secure_code' => $this->merchant->site_secure_code,
62
			)
63
		);
64
65 1
		return $document;
66
	}
67
}
68