1313 */
1414class CompletePurchaseRequest extends FetchTransactionRequest
1515{
16-
1716 private $ trustedIps = array (
1817 '213.129.76.104 ' , '213.129.76.105 ' ,
1918 '217.21.162.163 ' , '217.21.162.164 ' ,
@@ -28,7 +27,6 @@ class CompletePurchaseRequest extends FetchTransactionRequest
2827 */
2928 public function getData ()
3029 {
31-
3230 $ this ->validate (
3331 'merchantId ' ,
3432 'merchantPassword '
@@ -58,7 +56,6 @@ public function getData()
5856 throw new InvalidRequestException ('Missing XML ' );
5957
6058 }
61-
6259 }
6360
6461 /**
@@ -69,7 +66,6 @@ public function getData()
6966 */
7067 public function sendData ($ data )
7168 {
72-
7369 if (isset ($ data ->StatusReport )) {
7470
7571 if (in_array ($ data ->StatusReport ->Status , array (1 , 2 , 3 ))) {
@@ -87,7 +83,6 @@ public function sendData($data)
8783 } else {
8884 return new CompletePurchaseResponse ($ this , $ data );
8985 }
90-
9186 }
9287
9388 /**
@@ -106,7 +101,6 @@ public function sendData($data)
106101 */
107102 public function createResponse ($ status , $ errorCode , $ errorDescription )
108103 {
109-
110104 $ document = new \DOMDocument ('1.0 ' , 'utf-8 ' );
111105 $ document ->formatOutput = false ;
112106
@@ -141,7 +135,6 @@ public function createResponse($status, $errorCode, $errorDescription)
141135 $ checksum ->nodeValue = $ this ->calculateXmlChecksum ($ document ->saveXML ());
142136
143137 return $ document ->saveXML ();
144-
145138 }
146139
147140 /**
@@ -152,13 +145,10 @@ public function createResponse($status, $errorCode, $errorDescription)
152145 */
153146 public function validateChecksum ($ string )
154147 {
155-
156148 $ xml = new \SimpleXMLElement ($ string );
157149 $ checksum = (string ) $ xml ->Authentication ->Checksum ;
158150 $ original = str_replace ($ checksum , $ this ->getMerchantPassword (), $ string );
159151
160152 return md5 ($ original ) == $ checksum ;
161-
162153 }
163-
164154}
0 commit comments