Completed
Push — master ( 3e6656...a43425 )
by Andrii
10s
created

CompletePurchaseResponse::isSuccessful()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * RoboKassa driver for the Omnipay PHP payment processing library
5
 *
6
 * @link      https://github.com/hiqdev/omnipay-epayservice
7
 * @package   omnipay-epayservice
8
 * @license   MIT
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace Omnipay\RoboKassa\Message;
13
14
use Omnipay\Common\Exception\InvalidResponseException;
15
use Omnipay\Common\Message\AbstractResponse;
16
use Omnipay\Common\Message\RequestInterface;
17
18
/**
19
 * RoboKassa Complete Purchase Response.
20
 */
21
class CompletePurchaseResponse extends AbstractResponse
22
{
23
    public function __construct(RequestInterface $request, $data)
24
    {
25
        $this->request = $request;
26
        $this->data    = $data;
27
28
        if ($this->getHash() !== $this->calculateHash()) {
0 ignored issues
show
Bug introduced by
The method getHash() does not seem to exist on object<Omnipay\RoboKassa...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...
Bug introduced by
The method calculateHash() does not seem to exist on object<Omnipay\RoboKassa...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...
29
            throw new InvalidResponseException('Invalid hash');
30
        }
31
32
        if ($this->request->getTestMode() !== $this->getTestMode()) {
0 ignored issues
show
Bug introduced by
The method getTestMode() does not seem to exist on object<Omnipay\RoboKassa...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...
33
            throw new InvalidResponseException('Invalid test mode');
34
        }
35
    }
36
37
    public function isSuccessful()
38
    {
39
        return false;
40
    }
41
}
42