Test Failed
Push — splits-transaction-status-to-c... ( 9fccda...66d580 )
by Kiet
01:36
created

CompleteAuthoriseAndCaptureRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 89.47%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 49
ccs 17
cts 19
cp 0.8947
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 7 1
A sendData() 0 21 1
A getHttpRequest() 0 3 1
1
<?php
2
3
namespace Omnipay\IcepayPayments\Message;
4
5
use Omnipay\Common\Message\ResponseInterface;
6
use Symfony\Component\HttpFoundation\Request;
7
8
/**
9
 * The request for completing the authorise and capture at Icepay.
10
 */
11
class CompleteAuthoriseAndCaptureRequest extends AbstractRequest
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 1
    public function getData(): array
17
    {
18 1
        $data = parent::getData();
19
20 1
        $data['ContractProfileId'] = $this->getContractProfileId();
21
22 1
        return $data;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function sendData($data): ResponseInterface
29
    {
30 1
        $this->sendRequest(
31 1
            Request::METHOD_POST,
32 1
            sprintf(
33 1
                '/transaction/%s',
34 1
                $this->getTransactionReference()
35
            ),
36 1
            $data
37
        );
38
39 1
        $response = array_merge(
40 1
            $this->getResponseBody(),
41
            [
42 1
                'statusCode' => $this->getResponse()->getStatusCode(),
0 ignored issues
show
Bug introduced by
The method getStatusCode() does not exist on Omnipay\Common\Message\ResponseInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

42
                'statusCode' => $this->getResponse()->/** @scrutinizer ignore-call */ getStatusCode(),

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...
43
            ]
44
        );
45
46 1
        return new CompleteAuthoriseAndCaptureResponse(
47 1
            $this,
48 1
            $response
49
        );
50
    }
51
52
    /**
53
     * Get the HttpRequest.
54
     *
55
     * @return Request
56
     */
57
    public function getHttpRequest(): Request
58
    {
59
        return $this->httpRequest;
60
    }
61
}
62