Failed Conditions
Push — develop ( ea4858...c314dc )
by Reüel
07:27
created

src/XML/TransactionResponseMessage.php (2 issues)

1
<?php
2
3
namespace Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\XML;
4
5
use SimpleXMLElement;
6
7
/**
8
 * Title: iDEAL transaction response XML message
9
 * Description:
10
 * Copyright: 2005-2020 Pronamic
11
 * Company: Pronamic
12
 *
13
 * @author  Remco Tolsma
14
 * @version 2.0.0
15
 */
16
class TransactionResponseMessage extends ResponseMessage {
17
	/**
18
	 * The document element name
19
	 *
20
	 * @var string
21
	 */
22
	const NAME = 'AcquirerTrxRes';
23
24
	/**
25
	 * Constructs and initialize an directory response message
26
	 */
27
	public function __construct() {
28
		parent::__construct( self::NAME );
29
	}
30
31
	/**
32
	 * Parse the specified XML into an directory response message object
33
	 *
34
	 * @param SimpleXMLElement $xml
35
	 *
36
	 * @return ResponseMessage
37
	 */
38
	public static function parse( SimpleXMLElement $xml ) {
39
		$message = self::parse_create_date( $xml, new self() );
40
41
		$message->issuer      = IssuerParser::parse( $xml->Issuer );
0 ignored issues
show
Bug Best Practice introduced by
The property issuer does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
42
		$message->transaction = TransactionParser::parse( $xml->Transaction );
0 ignored issues
show
Bug Best Practice introduced by
The property transaction does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
43
44
		return $message;
45
	}
46
}
47