Test Failed
Push — splits-transaction-status-to-c... ( 6a53f6 )
by Kiet
02:00
created

CompleteAuthoriseAndCaptureRequest::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
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