WSConfPreAuthRequest::sendData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Omnipay\Komerci\Message;
4
5
/**
6
 * Komerci Authorize Request
7
 */
8
class WSConfPreAuthRequest extends WSAbstractRequest
9
{
10
11 4
    public function getData()
12
    {
13 4
        $this->validate('apikey', 'amount', 'transactionReference', 'numautor', 'username', 'password');
14
15
        $data = array(
16 4
            'Filiacao' => $this->getApiKey(),
17 4
            'Distribuidor' => '',
18 4
            'Total' => sprintf("%.2F", round($this->getAmount() * 100) / 100),
19 4
            'Parcelas' => $this->getFormattedInstallments(),
20 4
            'Data' => $this->getFormattedDate(),
21 4
            'NumAutor' => $this->getNumAutor(),
22 4
            'NumCv' => $this->getTransactionReference(),
23 4
            'Concentrador' => '',
24 4
            'Usr' => $this->getUsername(),
25 4
            'Pwd' => $this->getPassword()
26 4
        );
27
28 4
        return $data;
29
    }
30
31 3
    public function sendData($data)
32
    {
33 3
        $httpResponse = $this->prepareSendData($data, 'ConfPreAuthorization');
34 3
        return $this->response = new WSConfPreAuthResponse($this, $httpResponse->xml());
0 ignored issues
show
Bug introduced by
The method xml() does not seem to exist on object<Omnipay\Common\Message\RequestInterface>.

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...
35
    }
36
}
37