@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * Constructs and initialize an directory response message |
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | - parent::__construct( self::NAME ); |
|
28 | + parent::__construct(self::NAME); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @return ResponseMessage |
37 | 37 | */ |
38 | - public static function parse( SimpleXMLElement $xml ) { |
|
39 | - $message = self::parse_create_date( $xml, new self() ); |
|
38 | + public static function parse(SimpleXMLElement $xml) { |
|
39 | + $message = self::parse_create_date($xml, new self()); |
|
40 | 40 | |
41 | - $message->issuer = IssuerParser::parse( $xml->Issuer ); |
|
42 | - $message->transaction = TransactionParser::parse( $xml->Transaction ); |
|
41 | + $message->issuer = IssuerParser::parse($xml->Issuer); |
|
42 | + $message->transaction = TransactionParser::parse($xml->Transaction); |
|
43 | 43 | |
44 | 44 | return $message; |
45 | 45 | } |
@@ -23,15 +23,15 @@ |
||
23 | 23 | * |
24 | 24 | * @return Country |
25 | 25 | */ |
26 | - public static function parse( SimpleXMLElement $xml ) { |
|
26 | + public static function parse(SimpleXMLElement $xml) { |
|
27 | 27 | $country = new Country(); |
28 | 28 | |
29 | - $country->set_name( Security::filter( $xml->countryNames ) ); |
|
29 | + $country->set_name(Security::filter($xml->countryNames)); |
|
30 | 30 | |
31 | - foreach ( $xml->Issuer as $element ) { |
|
32 | - $issuer = IssuerParser::parse( $element ); |
|
31 | + foreach ($xml->Issuer as $element) { |
|
32 | + $issuer = IssuerParser::parse($element); |
|
33 | 33 | |
34 | - $country->add_issuer( $issuer ); |
|
34 | + $country->add_issuer($issuer); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return $country; |
@@ -23,17 +23,17 @@ |
||
23 | 23 | * |
24 | 24 | * @return IDeal_Error|null |
25 | 25 | */ |
26 | - public function parse( SimpleXMLElement $xml ) { |
|
26 | + public function parse(SimpleXMLElement $xml) { |
|
27 | 27 | $error = null; |
28 | 28 | |
29 | - if ( 'Error' === $xml->getName() ) { |
|
29 | + if ('Error' === $xml->getName()) { |
|
30 | 30 | $error = new Error(); |
31 | 31 | |
32 | - $error->set_code( Security::filter( $xml->errorCode ) ); |
|
33 | - $error->set_message( Security::filter( $xml->errorMessage ) ); |
|
34 | - $error->set_detail( Security::filter( $xml->errorDetail ) ); |
|
35 | - $error->set_suggested_action( Security::filter( $xml->suggestedAction ) ); |
|
36 | - $error->set_consumer_message( Security::filter( $xml->consumerMessage ) ); |
|
32 | + $error->set_code(Security::filter($xml->errorCode)); |
|
33 | + $error->set_message(Security::filter($xml->errorMessage)); |
|
34 | + $error->set_detail(Security::filter($xml->errorDetail)); |
|
35 | + $error->set_suggested_action(Security::filter($xml->suggestedAction)); |
|
36 | + $error->set_consumer_message(Security::filter($xml->consumerMessage)); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return $error; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * Constructs and initialize an directory response message |
34 | 34 | */ |
35 | 35 | public function __construct() { |
36 | - parent::__construct( self::NAME ); |
|
36 | + parent::__construct(self::NAME); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return ResponseMessage |
54 | 54 | */ |
55 | - public static function parse( SimpleXMLElement $xml ) { |
|
56 | - $message = self::parse_create_date( $xml, new self() ); |
|
55 | + public static function parse(SimpleXMLElement $xml) { |
|
56 | + $message = self::parse_create_date($xml, new self()); |
|
57 | 57 | |
58 | - $message->directory = DirectoryParser::parse( $xml->Directory ); |
|
58 | + $message->directory = DirectoryParser::parse($xml->Directory); |
|
59 | 59 | |
60 | 60 | return $message; |
61 | 61 | } |
@@ -24,21 +24,21 @@ |
||
24 | 24 | * |
25 | 25 | * @return Issuer |
26 | 26 | */ |
27 | - public static function parse( SimpleXMLElement $xml, $issuer = null ) { |
|
28 | - if ( ! $issuer instanceof Issuer ) { |
|
27 | + public static function parse(SimpleXMLElement $xml, $issuer = null) { |
|
28 | + if ( ! $issuer instanceof Issuer) { |
|
29 | 29 | $issuer = new Issuer(); |
30 | 30 | } |
31 | 31 | |
32 | - if ( $xml->issuerID ) { |
|
33 | - $issuer->set_id( Security::filter( $xml->issuerID ) ); |
|
32 | + if ($xml->issuerID) { |
|
33 | + $issuer->set_id(Security::filter($xml->issuerID)); |
|
34 | 34 | } |
35 | 35 | |
36 | - if ( $xml->issuerName ) { |
|
37 | - $issuer->set_name( Security::filter( $xml->issuerName ) ); |
|
36 | + if ($xml->issuerName) { |
|
37 | + $issuer->set_name(Security::filter($xml->issuerName)); |
|
38 | 38 | } |
39 | 39 | |
40 | - if ( $xml->issuerAuthenticationURL ) { |
|
41 | - $issuer->set_authentication_url( Security::filter( $xml->issuerAuthenticationURL ) ); |
|
40 | + if ($xml->issuerAuthenticationURL) { |
|
41 | + $issuer->set_authentication_url(Security::filter($xml->issuerAuthenticationURL)); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | return $issuer; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * Constructs and initialize an status response message |
34 | 34 | */ |
35 | 35 | public function __construct() { |
36 | - parent::__construct( self::NAME ); |
|
36 | + parent::__construct(self::NAME); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return ResponseMessage |
45 | 45 | */ |
46 | - public static function parse( SimpleXMLElement $xml ) { |
|
47 | - $message = self::parse_create_date( $xml, new self() ); |
|
46 | + public static function parse(SimpleXMLElement $xml) { |
|
47 | + $message = self::parse_create_date($xml, new self()); |
|
48 | 48 | |
49 | - $message->transaction = TransactionParser::parse( $xml->Transaction ); |
|
49 | + $message->transaction = TransactionParser::parse($xml->Transaction); |
|
50 | 50 | |
51 | 51 | return $message; |
52 | 52 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * Constructs and initialize an error response message |
34 | 34 | */ |
35 | 35 | public function __construct() { |
36 | - parent::__construct( self::NAME ); |
|
36 | + parent::__construct(self::NAME); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return ResponseMessage |
45 | 45 | */ |
46 | - public static function parse( SimpleXMLElement $xml ) { |
|
47 | - $message = self::parse_create_date( $xml, new self() ); |
|
46 | + public static function parse(SimpleXMLElement $xml) { |
|
47 | + $message = self::parse_create_date($xml, new self()); |
|
48 | 48 | |
49 | 49 | $parser = new ErrorParser(); |
50 | 50 | |
51 | - $message->error = $parser->parse( $xml->Error ); |
|
51 | + $message->error = $parser->parse($xml->Error); |
|
52 | 52 | |
53 | 53 | return $message; |
54 | 54 | } |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | /** |
65 | 65 | * Constructs and initialize an message |
66 | 66 | */ |
67 | - public function __construct( $name ) { |
|
67 | + public function __construct($name) { |
|
68 | 68 | $this->name = $name; |
69 | - $this->create_date = new DateTime( null, new DateTimeZone( Plugin::TIMEZONE ) ); |
|
69 | + $this->create_date = new DateTime(null, new DateTimeZone(Plugin::TIMEZONE)); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @return DateTime |
94 | 94 | */ |
95 | - public function set_create_date( DateTime $create_date ) { |
|
95 | + public function set_create_date(DateTime $create_date) { |
|
96 | 96 | $this->create_date = $create_date; |
97 | 97 | } |
98 | 98 | |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @return \DOMElement |
108 | 108 | */ |
109 | - public static function add_element( DOMDocument $document, DOMNode $parent, $name, $value = null ) { |
|
110 | - $element = $document->createElement( $name ); |
|
109 | + public static function add_element(DOMDocument $document, DOMNode $parent, $name, $value = null) { |
|
110 | + $element = $document->createElement($name); |
|
111 | 111 | |
112 | - if ( null !== $value ) { |
|
113 | - $element->appendChild( new DOMText( $value ) ); |
|
112 | + if (null !== $value) { |
|
113 | + $element->appendChild(new DOMText($value)); |
|
114 | 114 | } |
115 | 115 | |
116 | - $parent->appendChild( $element ); |
|
116 | + $parent->appendChild($element); |
|
117 | 117 | |
118 | 118 | return $element; |
119 | 119 | } |
@@ -125,15 +125,15 @@ discard block |
||
125 | 125 | * @param DOMNode $parent |
126 | 126 | * @param array $elements |
127 | 127 | */ |
128 | - public static function add_elements( DOMDocument $document, DOMNode $parent, array $elements = array() ) { |
|
129 | - foreach ( $elements as $name => $value ) { |
|
130 | - $element = $document->createElement( $name ); |
|
128 | + public static function add_elements(DOMDocument $document, DOMNode $parent, array $elements = array()) { |
|
129 | + foreach ($elements as $name => $value) { |
|
130 | + $element = $document->createElement($name); |
|
131 | 131 | |
132 | - if ( null !== $value ) { |
|
133 | - $element->appendChild( new DOMText( $value ) ); |
|
132 | + if (null !== $value) { |
|
133 | + $element->appendChild(new DOMText($value)); |
|
134 | 134 | } |
135 | 135 | |
136 | - $parent->appendChild( $element ); |
|
136 | + $parent->appendChild($element); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * Constructs and initialize a directory request message |
24 | 24 | */ |
25 | 25 | public function __construct() { |
26 | - parent::__construct( self::NAME ); |
|
26 | + parent::__construct(self::NAME); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | // Merchant |
38 | 38 | $merchant = $this->get_merchant(); |
39 | 39 | |
40 | - $element = self::add_element( $document, $document->documentElement, 'Merchant' ); |
|
41 | - self::add_elements( $document, $element, array( |
|
40 | + $element = self::add_element($document, $document->documentElement, 'Merchant'); |
|
41 | + self::add_elements($document, $element, array( |
|
42 | 42 | 'merchantID' => $merchant->get_id(), |
43 | 43 | 'subID' => $merchant->get_sub_id(), |
44 | - ) ); |
|
44 | + )); |
|
45 | 45 | |
46 | 46 | // Return |
47 | 47 | return $document; |