Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function validate(array $validationSubject) |
||
23 | { |
||
24 | if (!isset($validationSubject['response']) || !is_array($validationSubject['response'])) { |
||
25 | throw new \InvalidArgumentException('Response does not exist'); |
||
26 | } |
||
27 | |||
28 | $response = $validationSubject['response']; |
||
29 | |||
30 | if ($this->isSuccessfulTransaction($response)) { |
||
31 | return $this->createResult( |
||
32 | true, |
||
33 | [] |
||
34 | ); |
||
35 | } else { |
||
36 | return $this->createResult( |
||
37 | false, |
||
38 | [__('Gateway rejected the transaction.')] |
||
39 | ); |
||
53 |