AuthorizeRequest::getTypeId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Omnipay\Heidelpay\Message;
3
4
/**
5
 * Authorize Request
6
 *
7
 * @method Response send()
8
 */
9
class AuthorizeRequest extends PaymentRequest
10
{
11
    public function getData()
12
    {
13
        $this->validate('amount', 'currency', 'typeId');
14
15
        $data = [];
16
        $data['amount'] = $this->getAmount();
17
        $data['currency'] = $this->getCurrency();
18
        $data['resources'] = [
19
            'typeId' => $this->getTypeId()
20
        ];
21
22
        return $data;
23
    }
24
25
26
    public function getTypeId()
27
    {
28
        return $this->getParameter('typeId');
29
    }
30
31
    public function setTypeId($value)
32
    {
33
        return $this->setParameter('typeId', $value);
34
    }
35
36
    public function getEndpoint()
37
    {
38
        return parent::getEndpoint() . 'authorize';
39
    }
40
}
41