1 | <?php |
||
2 | /** |
||
3 | * Created By: Henry Ejemuta |
||
4 | * Project: laravel-monnify |
||
5 | * Class Name: MonnifyTransaction.php |
||
6 | * Date Created: 7/15/20 |
||
7 | * Time Created: 7:13 AM |
||
8 | */ |
||
9 | |||
10 | namespace HenryEjemuta\LaravelMonnify\Classes; |
||
11 | |||
12 | |||
13 | class MonnifyTransaction |
||
14 | { |
||
15 | /** |
||
16 | * @var float |
||
17 | */ |
||
18 | private $amount; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $reference; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $narration; |
||
29 | |||
30 | /** |
||
31 | * @var MonnifyBankAccount |
||
32 | */ |
||
33 | private $bankAccount; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $currencyCode; |
||
39 | |||
40 | /** |
||
41 | * MonnifyReservedAccountSplit constructor. |
||
42 | * @param float $amount The amount to be disbursed to the beneficiary |
||
43 | * @param string $reference The unique reference for a transaction. Also to be specified for each transaction in a bulk transaction request. |
||
44 | * @param string $narration The Narration for the transactions being processed |
||
45 | * @param MonnifyBankAccount $bankAccount The MonnifyBankAccount object holds and do slight validation on account number and bank code, pass empty string for account name here |
||
46 | * @param string $currencyCode The currency of the transaction being initialized. You can use the preset by call with config(' |
||
47 | */ |
||
48 | public function __construct(float $amount, string $reference, string $narration, MonnifyBankAccount $bankAccount, string $currencyCode) |
||
49 | { |
||
50 | $this->amount = $amount; |
||
51 | $this->reference = trim($reference); |
||
52 | $this->narration = trim($narration); |
||
53 | $this->bankAccount = $bankAccount; |
||
54 | $this->currencyCode = $currencyCode; |
||
55 | } |
||
56 | |||
57 | public function getBankAccount() : MonnifyBankAccount{ |
||
58 | return $this->bankAccount; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return float |
||
63 | */ |
||
64 | public function getAmount(): float |
||
65 | { |
||
66 | return $this->amount; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getReference(): string |
||
73 | { |
||
74 | return $this->reference; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getNarration(): string |
||
81 | { |
||
82 | return $this->narration; |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getCurrencyCode(): string |
||
89 | { |
||
90 | return $this->currencyCode; |
||
91 | } |
||
92 | |||
93 | public function toArray(): array |
||
94 | { |
||
95 | return [ |
||
96 | "subAccountCode" => $this->subAccountCode, |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
97 | "feePercentage" => $this->feePercentage, |
||
0 ignored issues
–
show
|
|||
98 | "splitPercentage" => $this->splitPercentage, |
||
0 ignored issues
–
show
|
|||
99 | "feeBearer" => $this->feeBearer |
||
0 ignored issues
–
show
|
|||
100 | ]; |
||
101 | } |
||
102 | } |
||
103 |