Completed
Push — master ( a52065...6a2a6b )
by Dmitry
02:22
created

src/Message/CompletePurchaseResponse.php (3 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * FreeKassa driver for Omnipay PHP payment library
4
 *
5
 * @link      https://github.com/hiqdev/omnipay-freekassa
6
 * @package   omnipay-freekassa
7
 * @license   MIT
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace Omnipay\FreeKassa\Message;
12
13
use Omnipay\Common\Exception\InvalidResponseException;
14
use Omnipay\Common\Message\AbstractResponse;
15
use Omnipay\Common\Message\RequestInterface;
16
17
/**
18
 * FreeKassa Complete Purchase Response.
19
 */
20
class CompletePurchaseResponse extends AbstractResponse
21
{
22
    public function __construct(RequestInterface $request, $data)
23
    {
24
        $this->request = $request;
25
        $this->data    = $data;
26
27
        if ($this->getHash() !== $this->calculateHash()) {
0 ignored issues
show
The method getHash() does not seem to exist on object<Omnipay\FreeKassa...mpletePurchaseResponse>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
The method calculateHash() does not seem to exist on object<Omnipay\FreeKassa...mpletePurchaseResponse>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
            throw new InvalidResponseException('Invalid hash');
29
        }
30
31
        if ($this->request->getTestMode() !== $this->getTestMode()) {
0 ignored issues
show
The method getTestMode() does not seem to exist on object<Omnipay\FreeKassa...mpletePurchaseResponse>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
32
            throw new InvalidResponseException('Invalid test mode');
33
        }
34
    }
35
36
    public function isSuccessful()
37
    {
38
        return false;
39
    }
40
}
41