Total Complexity | 11 |
Total Lines | 142 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class Invoice |
||
9 | { |
||
10 | use HasDetail; |
||
11 | |||
12 | /** |
||
13 | * invoice's unique universal id (uuid) |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $uuid; |
||
18 | |||
19 | /** |
||
20 | * Amount |
||
21 | * |
||
22 | * @var int|float |
||
23 | */ |
||
24 | protected $amount = 0; |
||
25 | |||
26 | /** |
||
27 | * invoice's transaction id |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $transactionId; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $driver; |
||
37 | |||
38 | /** |
||
39 | * Invoice constructor. |
||
40 | * |
||
41 | * @throws \Exception |
||
42 | */ |
||
43 | public function __construct() |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Set invoice uuid |
||
50 | * |
||
51 | * @param $uuid|null |
||
52 | * |
||
53 | * @throws \Exception |
||
54 | */ |
||
55 | public function uuid($uuid = null) |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Get invoice uuid |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getUuid() |
||
71 | { |
||
72 | return $this->uuid; |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * Set the amount of invoice |
||
77 | * |
||
78 | * @param $amount |
||
79 | * |
||
80 | * @return $this |
||
81 | * |
||
82 | * @throws \Exception |
||
83 | */ |
||
84 | public function amount($amount) |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * Get the value of invoice |
||
96 | * |
||
97 | * @return int|float |
||
98 | */ |
||
99 | public function getAmount() |
||
100 | { |
||
101 | return $this->amount; |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * set transaction id |
||
106 | * |
||
107 | * @param $id |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | public function transactionId($id) |
||
112 | { |
||
113 | $this->transactionId = $id; |
||
114 | |||
115 | return $this; |
||
116 | } |
||
117 | |||
118 | /** |
||
119 | * Get the value of transaction's id |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getTransactionId() |
||
124 | { |
||
125 | return $this->transactionId; |
||
126 | } |
||
127 | |||
128 | /** |
||
129 | * Set the value of driver |
||
130 | * |
||
131 | * @param $driver |
||
132 | * |
||
133 | * @return $this |
||
134 | */ |
||
135 | public function via($driver) |
||
136 | { |
||
137 | $this->driver = $driver; |
||
138 | |||
139 | return $this; |
||
140 | } |
||
141 | |||
142 | /** |
||
143 | * Get the value of driver |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | public function getDriver() |
||
150 | } |
||
151 | } |
||
152 |