Conditions | 4 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function validate(array $validationSubject) |
||
33 | { |
||
34 | if (!isset($validationSubject['response']) || !is_array($validationSubject['response'])) { |
||
35 | throw new InvalidArgumentException('Response does not exist'); |
||
36 | } |
||
37 | |||
38 | $response = $validationSubject['response']; |
||
39 | |||
40 | if ($this->isSuccessfulTransaction($response)) { |
||
41 | return $this->createResult( |
||
42 | true, |
||
43 | [] |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | return $this->createResult( |
||
48 | false, |
||
49 | [__('Gateway rejected the transaction.')] |
||
50 | ); |
||
65 |