PurchaseRequest::getData()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 12
cts 12
cp 1
rs 9.3142
c 0
b 0
f 0
cc 2
eloc 13
nc 2
nop 0
crap 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