WSPurchaseRequest::getData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Omnipay\Komerci\Message;
4
5
/**
6
 * Komerci Authorize Request
7
 */
8
class WSPurchaseRequest extends WSAuthorizeRequest
9
{
10
11 2
    public function getData()
12
    {
13 2
        $data = parent::getData();
14 2
        $data['Transacao'] = $this->getInstallments() > 1 ? '08' : '04'; // Note: 04 - à vista; 08 - parcelado estabelecimento; 06 - Parcelado emissor
15 2
        $data['Parcelas'] = $this->getFormattedInstallments();
16
17 2
        return $data;
18
    }
19
20 2
    public function sendData($data)
21
    {
22 2
        $httpResponse = $this->prepareSendData($data, 'GetAuthorized');
23 2
        return $this->response = new WSAuthorizeResponse($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...
24
    }
25
}
26