1 | <?php |
||
13 | class Charge |
||
14 | { |
||
15 | /** |
||
16 | * @var Money |
||
17 | */ |
||
18 | private $money; |
||
19 | |||
20 | /** |
||
21 | * @var Payment[] |
||
22 | */ |
||
23 | private $payments; |
||
24 | |||
25 | /** |
||
26 | * Charge constructor. |
||
27 | * |
||
28 | * @param Money $money |
||
29 | * @param array|null $payments |
||
30 | */ |
||
31 | 4 | public function __construct(Money $money, array $payments = null) |
|
36 | |||
37 | /** |
||
38 | * @param Payment $payment |
||
39 | * @return Charge |
||
40 | */ |
||
41 | 1 | public function addPayment(Payment $payment) |
|
46 | |||
47 | /** |
||
48 | * Create an array structure that represents the charge. |
||
49 | * |
||
50 | * @return array |
||
51 | */ |
||
52 | 2 | public function toArray() |
|
62 | } |
||
63 |