| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function verify(Message $message) : bool |
||
| 24 | { |
||
| 25 | $serviceResponse = $this->service->verifyIpnMessage($message); |
||
| 26 | $serviceResponseBody = $serviceResponse->getBody(); |
||
| 27 | |||
| 28 | $pattern = sprintf('/(%s|%s)/', self::STATUS_KEYWORD_VERIFIED, self::STATUS_KEYWORD_INVALID); |
||
| 29 | |||
| 30 | if (!preg_match($pattern, $serviceResponseBody)) { |
||
| 31 | throw new \UnexpectedValueException(sprintf('Unexpected verification status encountered: %s', $serviceResponseBody)); |
||
| 32 | } |
||
| 33 | |||
| 34 | return $serviceResponseBody === self::STATUS_KEYWORD_VERIFIED; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |