1 | <?php |
||
4 | class Fee{ |
||
5 | const DEFAULT_PERCENTAGE = 0.015; |
||
6 | const DEFAULT_ADDITIONAL_CHARGE = 10000; |
||
7 | const DEFAULT_THRESHOLD = 250000; |
||
8 | const DEFAULT_CAP = 200000; |
||
9 | |||
10 | public static $default_percentage = Fee::DEFAULT_PERCENTAGE; |
||
11 | public static $default_additional_charge = Fee::DEFAULT_ADDITIONAL_CHARGE; |
||
12 | public static $default_threshold = Fee::DEFAULT_THRESHOLD; |
||
13 | public static $default_cap = Fee::DEFAULT_CAP; |
||
14 | |||
15 | private $percentage; |
||
16 | private $additional_charge; |
||
17 | private $threshold; |
||
18 | private $cap; |
||
19 | |||
20 | private $charge_divider; |
||
21 | private $crossover; |
||
22 | private $flatline_plus_charge; |
||
23 | private $flatline; |
||
24 | |||
25 | 4 | public function __construct(){ |
|
32 | |||
33 | 2 | public function withPercentage($percentage){ |
|
37 | |||
38 | 1 | public static function resetDefaults(){ |
|
44 | |||
45 | 2 | public function withAdditionalCharge($additional_charge){ |
|
49 | |||
50 | 2 | public function withThreshold($threshold){ |
|
54 | |||
55 | 2 | public function withCap($cap){ |
|
59 | |||
60 | 4 | private function __setup(){ |
|
66 | |||
67 | 4 | private function __charge_divider(){ |
|
70 | |||
71 | 4 | private function __crossover(){ |
|
74 | |||
75 | 4 | private function __flatline_plus_charge(){ |
|
78 | |||
79 | 4 | private function __flatline(){ |
|
82 | |||
83 | 3 | public function addFor($amountinkobo){ |
|
91 | |||
92 | 2 | public function calculateFor($amountinkobo){ |
|
102 | } |
||
103 |