CompletePurchaseRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 2
dl 0
loc 25
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 11 1
A createResponse() 0 4 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