Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function verifyIpnMessage(Message $message) : ServiceResponse |
||
30 | { |
||
31 | $requestBody = array_merge( |
||
32 | ['cmd' => '_notify-validate'], |
||
33 | $message->getAll() |
||
34 | ); |
||
35 | |||
36 | try { |
||
37 | $response = $this->httpClient->post( |
||
38 | $this->serviceEndpoint, |
||
39 | ['form_params' => $requestBody] |
||
40 | ); |
||
41 | } catch (\Exception $e) { |
||
42 | throw new ServiceException($e->getMessage()); |
||
43 | } |
||
44 | |||
45 | return new ServiceResponse( |
||
46 | (string) $response->getBody() |
||
47 | ); |
||
48 | } |
||
49 | } |
||
50 |