Receipt::getDriver()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Shetabit\Multipay\Abstracts;
4
5
use Carbon\Carbon;
6
use Shetabit\Multipay\Contracts\ReceiptInterface;
7
8
abstract class Receipt implements ReceiptInterface
9
{
10
    /**
11
     * A unique ID which is given to the customer whenever the payment is done successfully.
12
     * This ID can be used for financial follow up.
13
     *
14
     * @var string
15
     */
16
    protected $referenceId;
17
18
    /**
19
     * payment driver's name.
20
     *
21
     * @var string
22
     */
23
    protected $driver;
24
25
    /**
26
     * payment date
27
     *
28
     * @var Carbon
29
     */
30
    protected $date;
31
32
    /**
33
     * Receipt constructor.
34
     *
35
     * @param $driver
36
     * @param $referenceId
37
     */
38
    public function __construct($driver, $referenceId)
39
    {
40
        $this->driver = $driver;
41
        $this->referenceId = $referenceId;
42
        $this->date = Carbon::now();
43
    }
44
45
    /**
46
     * Retrieve driver's name
47
     *
48
     * @return string
49
     */
50
    public function getDriver() : string
51
    {
52
        return $this->driver;
53
    }
54
55
    /**
56
     * Retrieve payment reference code.
57
     *
58
     * @return string
59
     */
60
    public function getReferenceId() : string
61
    {
62
        return (string) $this->referenceId;
63
    }
64
65
    /**
66
     * Retrieve payment date
67
     *
68
     * @return Carbon
69
     */
70
    public function getDate() : Carbon
71
    {
72
        return $this->date;
73
    }
74
}
75