Total Complexity | 8 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class CreateRefund extends AbstractRequest implements IRequest |
||
13 | { |
||
14 | /** |
||
15 | * @var |
||
16 | */ |
||
17 | protected $amount; |
||
18 | |||
19 | /** |
||
20 | * @var |
||
21 | */ |
||
22 | protected $description; |
||
23 | |||
24 | /** |
||
25 | * @var |
||
26 | */ |
||
27 | protected $control; |
||
28 | |||
29 | /** |
||
30 | * @var |
||
31 | */ |
||
32 | protected $operation_number; |
||
33 | |||
34 | /** |
||
35 | * CreateRefund constructor. |
||
36 | * @param $operation_number |
||
37 | * @param $data |
||
38 | * @throws RequestIntegrityException |
||
39 | */ |
||
40 | public function __construct($operation_number, $data) |
||
41 | { |
||
42 | if(!$operation_number){ |
||
43 | throw new RequestIntegrityException("Operation number is not set"); |
||
44 | } |
||
45 | |||
46 | $this->operation_number = $operation_number; |
||
47 | |||
48 | foreach ($data as $key => $value) { |
||
49 | if(!$value || is_numeric($value) && $value <= 0){ |
||
50 | throw new RequestIntegrityException(); |
||
51 | } |
||
52 | $this->$key = $value; |
||
53 | } |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function method() |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | */ |
||
67 | public function path() |
||
70 | } |
||
71 | } |
||
72 |