Completed
Pull Request — master (#12)
by Sullivan
02:09
created

DebitRequest::getRequestId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Nexy\PayboxDirect\Request;
4
5
/**
6
 * @author Sullivan Senechal <[email protected]>
7
 */
8
final class DebitRequest extends AbstractReferencedTransactionRequest
9
{
10
    /**
11
     * @var int
12
     */
13
    private $transactionNumber;
14
15
    /**
16
     * @var int
17
     */
18
    private $callNumber;
19
20
    /**
21
     * @param int $reference
22
     * @param int $amount
23
     * @param int $transactionNumber
24
     * @param int $callNumber
25
     */
26
    public function __construct($reference, $amount, $transactionNumber, $callNumber)
27
    {
28
        parent::__construct($reference, $amount);
29
30
        $this->transactionNumber = $transactionNumber;
31
        $this->callNumber = $callNumber;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getRequestId()
38
    {
39
        return RequestInterface::DEBIT;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getParameters()
46
    {
47
        $parameters = [
48
            'NUMTRANS' => $this->transactionNumber,
49
            'NUMAPPEL' => $this->callNumber,
50
        ];
51
52
        return array_merge(parent::getParameters(), $parameters);
53
    }
54
}
55