PurchaseRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 31
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendData() 0 4 1
A getData() 0 21 2
1
<?php
2
namespace Omnipay\Gtpay\Message;
3
4
class PurchaseRequest extends AbstractRequest
5
{
6
7 1
    public function getData()
8
    {
9
10
        $data = [
11 1
            "gtpay_cust_id"=>$this->getCustomerId(),
12 1
            "gtpay_cust_name"=>$this->getCustomerName(),
13 1
            "gtpay_mert_id"=>$this->getMerchantId(),
14 1
            "gtpay_hash" => $this->getTransactionHash(),
15 1
            "gtpay_tranx_id" =>$this->getTransactionId(),
16 1
            "gtpay_tranx_noti_url" => $this->getNotifyUrl(),
17 1
            "gtpay_tranx_amt" => $this->getAmountInteger(),
18 1
            "gtpay_tranx_curr" => $this->getCurrencyNumeric(),
19
20
        ];
21
22 1
        if ($this->getGatewayName()) {
23 1
            $data["gtpay_gway_name"] = $this->getGatewayName();
24
        }
25
26 1
        return $data;
27
    }
28
29
30 1
    public function sendData($data)
31
    {
32 1
        return new PurchaseResponse($this, $data);
33
    }
34
}
35