CompletePurchaseRequest::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 7
cts 7
cp 1
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Omnipay\AllPay\Message;
4
5
use Omnipay\Common\Exception\InvalidRequestException;
6
7
class CompletePurchaseRequest extends AbstractRequest
8
{
9
    protected $apiEndpoint = 'orderquery';
10
11
    /**
12
     * @return array|mixed
13
     * @throws InvalidRequestException
14
     */
15 6
    public function getData()
16
    {
17 6
        $this->validate('transactionReference', 'paymentMethod');
18
19 6
        $data = $this->getBaseData();
20 6
        $data['transType'] = 'INQY';
21 6
        $data['orderNum'] = $this->getTransactionReference();
22 6
        $data['paymentSchema'] = $this->getPaymentMethod();
23
24 6
        return $data;
25
    }
26
27 6
    protected function createResponse($data)
28
    {
29 6
        return $this->response = new CompletePurchaseResponse($this, $data);
30
    }
31
}
32