Completed
Push — master ( 067925...6361e3 )
by Dmitry
02:41
created
src/Provider31/Request/Check.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,37 +16,37 @@  discard block
 block discarded – undo
16 16
 
17 17
 class Check extends General
18 18
 {
19
-    /**
20
-     *      @var string 'Account' node
21
-     */
22
-    protected $Account;
19
+        /**
20
+         *      @var string 'Account' node
21
+         */
22
+        protected $Account;
23 23
 
24
-    /**
25
-     *      Check constructor
26
-     *
27
-     *      @param string $raw Raw request data
28
-     */
29
-    public function __construct($raw)
30
-    {
24
+        /**
25
+         *      Check constructor
26
+         *
27
+         *      @param string $raw Raw request data
28
+         */
29
+        public function __construct($raw)
30
+        {
31 31
         parent::__construct($raw);
32
-    }
32
+        }
33 33
 
34
-    /**
35
-     *      Get Account
36
-     *
37
-     *      @return string
38
-     */
39
-    public function Account()
40
-    {
34
+        /**
35
+         *      Get Account
36
+         *
37
+         *      @return string
38
+         */
39
+        public function Account()
40
+        {
41 41
         return $this->Account;
42
-    }
42
+        }
43 43
 
44
-    /**
45
-     *      Parse xml-request, which was previously "extracted" from the body of the http request
46
-     *
47
-     */
48
-    protected function parse_request_data()
49
-    {
44
+        /**
45
+         *      Parse xml-request, which was previously "extracted" from the body of the http request
46
+         *
47
+         */
48
+        protected function parse_request_data()
49
+        {
50 50
         parent::parse_request_data();
51 51
 
52 52
         $doc = new \DOMDocument();
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
 
56 56
         foreach ($r[0]->childNodes as $child)
57 57
         {
58
-            $this->check_and_parse_request_node($child, 'Account');
58
+                $this->check_and_parse_request_node($child, 'Account');
59
+        }
59 60
         }
60
-    }
61 61
 
62
-    /**
63
-     *      validate Check request
64
-     *
65
-     *      @param array $options
66
-     *      @throws Exception\Structure
67
-     */
68
-    public function validate_request($options)
69
-    {
62
+        /**
63
+         *      validate Check request
64
+         *
65
+         *      @param array $options
66
+         *      @throws Exception\Structure
67
+         */
68
+        public function validate_request($options)
69
+        {
70 70
         parent::validate_request($options);
71 71
 
72 72
         $this->validate_element('Account');
73
-    }
73
+        }
74 74
 }
Please login to merge, or discard this patch.
src/Provider31/Request/General.php 2 patches
Indentation   +202 added lines, -202 removed lines patch added patch discarded remove patch
@@ -18,108 +18,108 @@  discard block
 block discarded – undo
18 18
 
19 19
 class General
20 20
 {
21
-    /**
22
-     *      @var string raw request
23
-     */
24
-    protected $raw_request;
25
-
26
-    /**
27
-     *      @var string 'DateTime' node
28
-     */
29
-    protected $DateTime;
30
-
31
-    /**
32
-     *      @var string 'Sign' node
33
-     */
34
-    protected $Sign;
35
-
36
-    /**
37
-     *      @var string 'Operation' type
38
-     */
39
-    protected $Operation;
40
-
41
-    /**
42
-     *      @var string 'ServiceId' node
43
-     */
44
-    protected $ServiceId;
45
-
46
-    /**
47
-     *      @var array list of possible operations
48
-     */
49
-    protected $operations = array('Check','Payment','Confirm','Cancel');
50
-
51
-    /**
52
-     *      General constructor
53
-     *
54
-     *      @param string $raw Raw request data
55
-     */
56
-    public function __construct($raw)
57
-    {
21
+        /**
22
+         *      @var string raw request
23
+         */
24
+        protected $raw_request;
25
+
26
+        /**
27
+         *      @var string 'DateTime' node
28
+         */
29
+        protected $DateTime;
30
+
31
+        /**
32
+         *      @var string 'Sign' node
33
+         */
34
+        protected $Sign;
35
+
36
+        /**
37
+         *      @var string 'Operation' type
38
+         */
39
+        protected $Operation;
40
+
41
+        /**
42
+         *      @var string 'ServiceId' node
43
+         */
44
+        protected $ServiceId;
45
+
46
+        /**
47
+         *      @var array list of possible operations
48
+         */
49
+        protected $operations = array('Check','Payment','Confirm','Cancel');
50
+
51
+        /**
52
+         *      General constructor
53
+         *
54
+         *      @param string $raw Raw request data
55
+         */
56
+        public function __construct($raw)
57
+        {
58 58
         $this->raw_request = strval($raw);
59 59
 
60 60
         $this->parse_request_data();
61
-    }
62
-
63
-    /**
64
-     *      Get DateTime
65
-     *
66
-     *      @return string
67
-     */
68
-    public function DateTime()
69
-    {
61
+        }
62
+
63
+        /**
64
+         *      Get DateTime
65
+         *
66
+         *      @return string
67
+         */
68
+        public function DateTime()
69
+        {
70 70
         return $this->DateTime;
71
-    }
72
-
73
-    /**
74
-     *      Get Sign
75
-     *
76
-     *      @return string
77
-     */
78
-    public function Sign()
79
-    {
71
+        }
72
+
73
+        /**
74
+         *      Get Sign
75
+         *
76
+         *      @return string
77
+         */
78
+        public function Sign()
79
+        {
80 80
         return $this->Sign;
81
-    }
82
-
83
-    /**
84
-     *      Get Operation type
85
-     *
86
-     *      @return string
87
-     */
88
-    public function Operation()
89
-    {
81
+        }
82
+
83
+        /**
84
+         *      Get Operation type
85
+         *
86
+         *      @return string
87
+         */
88
+        public function Operation()
89
+        {
90 90
         return $this->Operation;
91
-    }
92
-
93
-    /**
94
-     *      Get ServiceId
95
-     *
96
-     *      @return string
97
-     */
98
-    public function ServiceId()
99
-    {
91
+        }
92
+
93
+        /**
94
+         *      Get ServiceId
95
+         *
96
+         *      @return string
97
+         */
98
+        public function ServiceId()
99
+        {
100 100
         return $this->ServiceId;
101
-    }
102
-
103
-    /**
104
-     *      Parse xml-request, which was previously "extracted" from the body of the http request
105
-     *
106
-     *      @throws Exception\Structure
107
-     */
108
-    protected function parse_request_data()
109
-    {
101
+        }
102
+
103
+        /**
104
+         *      Parse xml-request, which was previously "extracted" from the body of the http request
105
+         *
106
+         *      @throws Exception\Structure
107
+         */
108
+        protected function parse_request_data()
109
+        {
110 110
         if (empty($this->raw_request))
111 111
         {
112
-            throw new Exception\Structure('An empty xml request', -50);
112
+                throw new Exception\Structure('An empty xml request', -50);
113 113
         }
114 114
 
115 115
         libxml_use_internal_errors(true);
116 116
         $doc = new \DOMDocument();
117 117
         if ( ! $doc->loadXML($this->raw_request))
118 118
         {
119
-            foreach(libxml_get_errors() as $e){
119
+                foreach(libxml_get_errors() as $e){
120 120
                 Log::instance()->error($e->message);
121
-            }
122
-            throw new Exception\Structure('The wrong XML is received', -51);
121
+                }
122
+                throw new Exception\Structure('The wrong XML is received', -51);
123 123
         }
124 124
 
125 125
         // process <Request> group
@@ -127,30 +127,30 @@  discard block
 block discarded – undo
127 127
 
128 128
         if (count($r) < 1)
129 129
         {
130
-            throw new Exception\Structure('The xml-query does not contain any element Request!', -52);
130
+                throw new Exception\Structure('The xml-query does not contain any element Request!', -52);
131 131
         }
132 132
 
133 133
         foreach ($r[0]->childNodes as $child)
134 134
         {
135
-            $this->check_and_parse_request_node($child, 'DateTime');
136
-            $this->check_and_parse_request_node($child, 'Sign');
135
+                $this->check_and_parse_request_node($child, 'DateTime');
136
+                $this->check_and_parse_request_node($child, 'Sign');
137 137
 
138
-            if (in_array($child->nodeName, $this->operations))
139
-            {
138
+                if (in_array($child->nodeName, $this->operations))
139
+                {
140 140
                 if ( ! isset($this->Operation))
141 141
                 {
142
-                    $this->Operation = $child->nodeName;
142
+                        $this->Operation = $child->nodeName;
143 143
                 }
144 144
                 else
145 145
                 {
146
-                    throw new Exception\Structure('There is more than one Operation type element in the xml-query!', -53);
146
+                        throw new Exception\Structure('There is more than one Operation type element in the xml-query!', -53);
147
+                }
147 148
                 }
148
-            }
149 149
         }
150 150
 
151 151
         if ( ! isset($this->Operation))
152 152
         {
153
-            throw new Exception\Structure('There is no Operation type element in the xml request!', -55);
153
+                throw new Exception\Structure('There is no Operation type element in the xml request!', -55);
154 154
         }
155 155
 
156 156
         // process <Operation> group
@@ -158,53 +158,53 @@  discard block
 block discarded – undo
158 158
 
159 159
         foreach ($r[0]->childNodes as $child)
160 160
         {
161
-            $this->check_and_parse_request_node($child, 'ServiceId');
161
+                $this->check_and_parse_request_node($child, 'ServiceId');
162 162
         }
163
-    }
164
-
165
-    /**
166
-     *      Check if present node of request and then parse it
167
-     *
168
-     *      @param \DOMNode $n
169
-     *      @param string $name
170
-     */
171
-    protected function check_and_parse_request_node($n, $name)
172
-    {
163
+        }
164
+
165
+        /**
166
+         *      Check if present node of request and then parse it
167
+         *
168
+         *      @param \DOMNode $n
169
+         *      @param string $name
170
+         */
171
+        protected function check_and_parse_request_node($n, $name)
172
+        {
173 173
         if ($n->nodeName == $name)
174 174
         {
175
-            $this->parse_request_node($n, $name);
175
+                $this->parse_request_node($n, $name);
176 176
         }
177
-    }
178
-
179
-    /**
180
-     *      Parse node of request
181
-     *
182
-     *      @param \DOMNode $n
183
-     *      @param string $name
184
-     *
185
-     *      @throws Exception\Structure
186
-     */
187
-    protected function parse_request_node($n, $name)
188
-    {
177
+        }
178
+
179
+        /**
180
+         *      Parse node of request
181
+         *
182
+         *      @param \DOMNode $n
183
+         *      @param string $name
184
+         *
185
+         *      @throws Exception\Structure
186
+         */
187
+        protected function parse_request_node($n, $name)
188
+        {
189 189
         if ( ! isset($this->$name))
190 190
         {
191
-            $this->$name = $n->nodeValue;
191
+                $this->$name = $n->nodeValue;
192 192
         }
193 193
         else
194 194
         {
195
-            throw new Exception\Structure('There is more than one '.$name.' element in the xml-query!', -56);
195
+                throw new Exception\Structure('There is more than one '.$name.' element in the xml-query!', -56);
196 196
         }
197
-    }
198
-
199
-    /**
200
-     *      "Rough" validation of the received xml request
201
-     *
202
-     *      @param array $options
203
-     *      @throws Exception\Data
204
-     *      @throws Exception\Structure
205
-     */
206
-    public function validate_request($options)
207
-    {
197
+        }
198
+
199
+        /**
200
+         *      "Rough" validation of the received xml request
201
+         *
202
+         *      @param array $options
203
+         *      @throws Exception\Data
204
+         *      @throws Exception\Structure
205
+         */
206
+        public function validate_request($options)
207
+        {
208 208
         $this->validate_element('DateTime');
209 209
         $this->validate_element('Sign');
210 210
         $this->validate_element('ServiceId');
@@ -212,104 +212,104 @@  discard block
 block discarded – undo
212 212
         // compare received value ServiceId with option ServiceId
213 213
         if (intval($options['ServiceId']) != intval($this->ServiceId))
214 214
         {
215
-            throw new Exception\Data('This request is not for our ServiceId!', -58);
215
+                throw new Exception\Data('This request is not for our ServiceId!', -58);
216 216
         }
217
-    }
218
-
219
-    /**
220
-     *      Validation of xml-element
221
-     *
222
-     *      @param string $name
223
-     */
224
-    public function validate_element($name)
225
-    {
217
+        }
218
+
219
+        /**
220
+         *      Validation of xml-element
221
+         *
222
+         *      @param string $name
223
+         */
224
+        public function validate_element($name)
225
+        {
226 226
         if ( ! isset($this->$name))
227 227
         {
228
-            throw new Exception\Structure('There is no '.$name.' element in the xml request!', -57);
228
+                throw new Exception\Structure('There is no '.$name.' element in the xml request!', -57);
229 229
         }
230
-    }
231
-
232
-    /**
233
-     *      Verify signature of request
234
-     *
235
-     *      @param array $options
236
-     */
237
-    public function verify_sign($options)
238
-    {
230
+        }
231
+
232
+        /**
233
+         *      Verify signature of request
234
+         *
235
+         *      @param array $options
236
+         */
237
+        public function verify_sign($options)
238
+        {
239 239
         if (isset($options['UseSign']) && ($options['UseSign'] === true))
240 240
         {
241
-            $this->check_verify_sign_result(
241
+                $this->check_verify_sign_result(
242 242
                 $result = (new OpenSSL())->verify(
243
-                    str_replace($this->Sign, '', $this->raw_request),
244
-                    pack("H*", $this->Sign),
245
-                    (new OpenSSL())->get_pub_key($this->get_pub_key($options))
243
+                        str_replace($this->Sign, '', $this->raw_request),
244
+                        pack("H*", $this->Sign),
245
+                        (new OpenSSL())->get_pub_key($this->get_pub_key($options))
246 246
                 )
247
-            );
247
+                );
248 248
         }
249
-    }
250
-
251
-    /**
252
-     *      load file with easysoft public key
253
-     *
254
-     *      @param array $options
255
-     *      @throws Exception\Runtime
256
-     *      @return string
257
-     */
258
-    protected function get_pub_key($options)
259
-    {
249
+        }
250
+
251
+        /**
252
+         *      load file with easysoft public key
253
+         *
254
+         *      @param array $options
255
+         *      @throws Exception\Runtime
256
+         *      @return string
257
+         */
258
+        protected function get_pub_key($options)
259
+        {
260 260
         if ( ! isset($options['EasySoftPKey']))
261 261
         {
262
-            throw new Exception\Runtime('The parameter EasySoftPKey is not set!', -94);
262
+                throw new Exception\Runtime('The parameter EasySoftPKey is not set!', -94);
263 263
         }
264 264
 
265 265
         return (new Key())->get($options['EasySoftPKey'], 'public');
266
-    }
267
-
268
-    /**
269
-     *      check result of openssl verify signature
270
-     *
271
-     *      @param integer $result
272
-     *      @throws Exception\Sign
273
-     */
274
-    protected function check_verify_sign_result($result)
275
-    {
266
+        }
267
+
268
+        /**
269
+         *      check result of openssl verify signature
270
+         *
271
+         *      @param integer $result
272
+         *      @throws Exception\Sign
273
+         */
274
+        protected function check_verify_sign_result($result)
275
+        {
276 276
         if ($result == -1)
277 277
         {
278
-            throw new Exception\Sign('Error verify signature of request!', -96);
278
+                throw new Exception\Sign('Error verify signature of request!', -96);
279 279
         }
280 280
         elseif ($result == 0)
281 281
         {
282
-            throw new Exception\Sign('Signature of request is incorrect!', -95);
282
+                throw new Exception\Sign('Signature of request is incorrect!', -95);
283 283
         }
284
-    }
285
-
286
-    /**
287
-     *      Selects nodes by name
288
-     *
289
-     *      @param \DOMDocument $dom
290
-     *      @param string $name
291
-     *      @param array $ret
292
-     *
293
-     *      @return array nodes with the name
294
-     */
295
-    protected function getNodes($dom, $name, $ret=array())
296
-    {
284
+        }
285
+
286
+        /**
287
+         *      Selects nodes by name
288
+         *
289
+         *      @param \DOMDocument $dom
290
+         *      @param string $name
291
+         *      @param array $ret
292
+         *
293
+         *      @return array nodes with the name
294
+         */
295
+        protected function getNodes($dom, $name, $ret=array())
296
+        {
297 297
         foreach($dom->childNodes as $child)
298 298
         {
299
-            if ($child->nodeName == $name)
300
-            {
299
+                if ($child->nodeName == $name)
300
+                {
301 301
                 array_push($ret, $child);
302
-            }
303
-            else
304
-            {
302
+                }
303
+                else
304
+                {
305 305
                 if (count($child->childNodes) > 0)
306 306
                 {
307
-                    $ret = $this->getNodes($child, $name, $ret);
307
+                        $ret = $this->getNodes($child, $name, $ret);
308
+                }
308 309
                 }
309
-            }
310 310
         }
311 311
 
312 312
         return $ret;
313
-    }
313
+        }
314 314
 
315 315
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -140,8 +140,7 @@  discard block
 block discarded – undo
140 140
                 if ( ! isset($this->Operation))
141 141
                 {
142 142
                     $this->Operation = $child->nodeName;
143
-                }
144
-                else
143
+                } else
145 144
                 {
146 145
                     throw new Exception\Structure('There is more than one Operation type element in the xml-query!', -53);
147 146
                 }
@@ -189,8 +188,7 @@  discard block
 block discarded – undo
189 188
         if ( ! isset($this->$name))
190 189
         {
191 190
             $this->$name = $n->nodeValue;
192
-        }
193
-        else
191
+        } else
194 192
         {
195 193
             throw new Exception\Structure('There is more than one '.$name.' element in the xml-query!', -56);
196 194
         }
@@ -276,8 +274,7 @@  discard block
 block discarded – undo
276 274
         if ($result == -1)
277 275
         {
278 276
             throw new Exception\Sign('Error verify signature of request!', -96);
279
-        }
280
-        elseif ($result == 0)
277
+        } elseif ($result == 0)
281 278
         {
282 279
             throw new Exception\Sign('Signature of request is incorrect!', -95);
283 280
         }
@@ -299,8 +296,7 @@  discard block
 block discarded – undo
299 296
             if ($child->nodeName == $name)
300 297
             {
301 298
                 array_push($ret, $child);
302
-            }
303
-            else
299
+            } else
304 300
             {
305 301
                 if (count($child->childNodes) > 0)
306 302
                 {
Please login to merge, or discard this patch.
src/Provider31/Request/Payment.php 1 patch
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -16,67 +16,67 @@  discard block
 block discarded – undo
16 16
 
17 17
 class Payment extends General
18 18
 {
19
-    /**
20
-     *      @var string 'Account' node
21
-     */
22
-    protected $Account;
19
+        /**
20
+         *      @var string 'Account' node
21
+         */
22
+        protected $Account;
23 23
 
24
-    /**
25
-     *      @var string 'OrderId' node
26
-     */
27
-    protected $OrderId;
24
+        /**
25
+         *      @var string 'OrderId' node
26
+         */
27
+        protected $OrderId;
28 28
 
29
-    /**
30
-     *      @var string 'Amount' node
31
-     */
32
-    protected $Amount;
29
+        /**
30
+         *      @var string 'Amount' node
31
+         */
32
+        protected $Amount;
33 33
 
34
-    /**
35
-     *      Payment constructor
36
-     *
37
-     *      @param string $raw Raw request data
38
-     */
39
-    public function __construct($raw)
40
-    {
34
+        /**
35
+         *      Payment constructor
36
+         *
37
+         *      @param string $raw Raw request data
38
+         */
39
+        public function __construct($raw)
40
+        {
41 41
         parent::__construct($raw);
42
-    }
42
+        }
43 43
 
44
-    /**
45
-     *      Get Account
46
-     *
47
-     *      @return string
48
-     */
49
-    public function Account()
50
-    {
44
+        /**
45
+         *      Get Account
46
+         *
47
+         *      @return string
48
+         */
49
+        public function Account()
50
+        {
51 51
         return $this->Account;
52
-    }
52
+        }
53 53
 
54
-    /**
55
-     *      Get OrderId
56
-     *
57
-     *      @return string
58
-     */
59
-    public function OrderId()
60
-    {
54
+        /**
55
+         *      Get OrderId
56
+         *
57
+         *      @return string
58
+         */
59
+        public function OrderId()
60
+        {
61 61
         return $this->OrderId;
62
-    }
62
+        }
63 63
 
64
-    /**
65
-     *      Get Amount
66
-     *
67
-     *      @return string
68
-     */
69
-    public function Amount()
70
-    {
64
+        /**
65
+         *      Get Amount
66
+         *
67
+         *      @return string
68
+         */
69
+        public function Amount()
70
+        {
71 71
         return $this->Amount;
72
-    }
72
+        }
73 73
 
74
-    /**
75
-     *      Parse xml-request, which was previously "extracted" from the body of the http request
76
-     *
77
-     */
78
-    protected function parse_request_data()
79
-    {
74
+        /**
75
+         *      Parse xml-request, which was previously "extracted" from the body of the http request
76
+         *
77
+         */
78
+        protected function parse_request_data()
79
+        {
80 80
         parent::parse_request_data();
81 81
 
82 82
         $doc = new \DOMDocument();
@@ -85,24 +85,24 @@  discard block
 block discarded – undo
85 85
 
86 86
         foreach ($r[0]->childNodes as $child)
87 87
         {
88
-            $this->check_and_parse_request_node($child, 'Account');
89
-            $this->check_and_parse_request_node($child, 'OrderId');
90
-            $this->check_and_parse_request_node($child, 'Amount');
88
+                $this->check_and_parse_request_node($child, 'Account');
89
+                $this->check_and_parse_request_node($child, 'OrderId');
90
+                $this->check_and_parse_request_node($child, 'Amount');
91
+        }
91 92
         }
92
-    }
93 93
 
94
-    /**
95
-     *      validate Payment request
96
-     *
97
-     *      @param array $options
98
-     *      @throws Exception\Structure
99
-     */
100
-    public function validate_request($options)
101
-    {
94
+        /**
95
+         *      validate Payment request
96
+         *
97
+         *      @param array $options
98
+         *      @throws Exception\Structure
99
+         */
100
+        public function validate_request($options)
101
+        {
102 102
         parent::validate_request($options);
103 103
 
104 104
         $this->validate_element('Account');
105 105
         $this->validate_element('OrderId');
106 106
         $this->validate_element('Amount');
107
-    }
107
+        }
108 108
 }
Please login to merge, or discard this patch.
src/Provider31/Request/Cancel.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,37 +16,37 @@  discard block
 block discarded – undo
16 16
 
17 17
 class Cancel extends General
18 18
 {
19
-    /**
20
-     *      @var string 'PaymentId' node
21
-     */
22
-    protected $PaymentId;
19
+        /**
20
+         *      @var string 'PaymentId' node
21
+         */
22
+        protected $PaymentId;
23 23
 
24
-    /**
25
-     *      Check constructor
26
-     *
27
-     *      @param string $raw Raw request data
28
-     */
29
-    public function __construct($raw)
30
-    {
24
+        /**
25
+         *      Check constructor
26
+         *
27
+         *      @param string $raw Raw request data
28
+         */
29
+        public function __construct($raw)
30
+        {
31 31
         parent::__construct($raw);
32
-    }
32
+        }
33 33
 
34
-    /**
35
-     *      Get PaymentId
36
-     *
37
-     *      @return string
38
-     */
39
-    public function PaymentId()
40
-    {
34
+        /**
35
+         *      Get PaymentId
36
+         *
37
+         *      @return string
38
+         */
39
+        public function PaymentId()
40
+        {
41 41
         return $this->PaymentId;
42
-    }
42
+        }
43 43
 
44
-    /**
45
-     *      Parse xml-request, which was previously "extracted" from the body of the http request
46
-     *
47
-     */
48
-    protected function parse_request_data()
49
-    {
44
+        /**
45
+         *      Parse xml-request, which was previously "extracted" from the body of the http request
46
+         *
47
+         */
48
+        protected function parse_request_data()
49
+        {
50 50
         parent::parse_request_data();
51 51
 
52 52
         $doc = new \DOMDocument();
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
 
56 56
         foreach ($r[0]->childNodes as $child)
57 57
         {
58
-            $this->check_and_parse_request_node($child, 'PaymentId');
58
+                $this->check_and_parse_request_node($child, 'PaymentId');
59
+        }
59 60
         }
60
-    }
61 61
 
62
-    /**
63
-     *      validate Cancel request
64
-     *
65
-     *      @param array $options
66
-     *      @throws Exception\Structure
67
-     */
68
-    public function validate_request($options)
69
-    {
62
+        /**
63
+         *      validate Cancel request
64
+         *
65
+         *      @param array $options
66
+         *      @throws Exception\Structure
67
+         */
68
+        public function validate_request($options)
69
+        {
70 70
         parent::validate_request($options);
71 71
 
72 72
         $this->validate_element('PaymentId');
73
-    }
73
+        }
74 74
 }
Please login to merge, or discard this patch.
src/Provider31/Request/Confirm.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,37 +16,37 @@  discard block
 block discarded – undo
16 16
 
17 17
 class Confirm extends General
18 18
 {
19
-    /**
20
-     *      @var string 'PaymentId' node
21
-     */
22
-    protected $PaymentId;
19
+        /**
20
+         *      @var string 'PaymentId' node
21
+         */
22
+        protected $PaymentId;
23 23
 
24
-    /**
25
-     *      Check constructor
26
-     *
27
-     *      @param string $raw Raw request data
28
-     */
29
-    public function __construct($raw)
30
-    {
24
+        /**
25
+         *      Check constructor
26
+         *
27
+         *      @param string $raw Raw request data
28
+         */
29
+        public function __construct($raw)
30
+        {
31 31
         parent::__construct($raw);
32
-    }
32
+        }
33 33
 
34
-    /**
35
-     *      Get PaymentId
36
-     *
37
-     *      @return string
38
-     */
39
-    public function PaymentId()
40
-    {
34
+        /**
35
+         *      Get PaymentId
36
+         *
37
+         *      @return string
38
+         */
39
+        public function PaymentId()
40
+        {
41 41
         return $this->PaymentId;
42
-    }
42
+        }
43 43
 
44
-    /**
45
-     *      Parse xml-request, which was previously "extracted" from the body of the http request
46
-     *
47
-     */
48
-    protected function parse_request_data()
49
-    {
44
+        /**
45
+         *      Parse xml-request, which was previously "extracted" from the body of the http request
46
+         *
47
+         */
48
+        protected function parse_request_data()
49
+        {
50 50
         parent::parse_request_data();
51 51
 
52 52
         $doc = new \DOMDocument();
@@ -55,20 +55,20 @@  discard block
 block discarded – undo
55 55
 
56 56
         foreach ($r[0]->childNodes as $child)
57 57
         {
58
-            $this->check_and_parse_request_node($child, 'PaymentId');
58
+                $this->check_and_parse_request_node($child, 'PaymentId');
59
+        }
59 60
         }
60
-    }
61 61
 
62
-    /**
63
-     *      validate Confirm request
64
-     *
65
-     *      @param array $options
66
-     *      @throws Exception\Structure
67
-     */
68
-    public function validate_request($options)
69
-    {
62
+        /**
63
+         *      validate Confirm request
64
+         *
65
+         *      @param array $options
66
+         *      @throws Exception\Structure
67
+         */
68
+        public function validate_request($options)
69
+        {
70 70
         parent::validate_request($options);
71 71
 
72 72
         $this->validate_element('PaymentId');
73
-    }
73
+        }
74 74
 }
Please login to merge, or discard this patch.