Test Failed
Push — splits-transaction-status-to-c... ( e5df75...74bed4 )
by Kiet
01:35
created

CompleteAuthoriseAndCaptureRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 42
ccs 16
cts 16
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 7 1
A getHttpRequest() 0 3 1
A sendData() 0 14 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
        return new CompleteAuthoriseAndCaptureResponse(
40 1
            $this,
41 1
            $this->getResponseBody()
42
        );
43
    }
44
45
    /**
46
     * Get the HttpRequest.
47
     *
48
     * @return Request
49
     */
50 2
    public function getHttpRequest(): Request
51
    {
52 2
        return $this->httpRequest;
53
    }
54
}
55