|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Created By: Henry Ejemuta |
|
4
|
|
|
* Project: laravel-monnify |
|
5
|
|
|
* Class Name: MonnifyReservedAccountSplit.php |
|
6
|
|
|
* Date Created: 7/14/20 |
|
7
|
|
|
* Time Created: 7:33 PM |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace HenryEjemuta\LaravelMonnify\Classes; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* Class MonnifyReservedAccountSplit |
|
14
|
|
|
* @package HenryEjemuta\LaravelMonnify\Classes |
|
15
|
|
|
* |
|
16
|
|
|
* Object containing specifications on how payments to this reserve account should be split. |
|
17
|
|
|
*/ |
|
18
|
|
|
class MonnifyReservedAccountSplit |
|
19
|
|
|
{ |
|
20
|
|
|
|
|
21
|
|
|
private $subAccountCode; |
|
22
|
|
|
private $feePercentage; |
|
23
|
|
|
private $splitPercentage; |
|
24
|
|
|
private $feeBearer; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* MonnifyReservedAccountSplit constructor. |
|
28
|
|
|
* @param string $subAccountCode The unique reference for the sub account that should receive the split. |
|
29
|
|
|
* @param float $feePercentage Boolean to determine if the sub account should bear transaction fees or not |
|
30
|
|
|
* @param bool $feeBearer The percentage of the transaction fee to be borne by the sub account |
|
31
|
|
|
* @param float $splitPercentage The percentage of the amount paid to be split into the sub account. |
|
32
|
|
|
*/ |
|
33
|
|
|
public function __construct(string $subAccountCode, float $feePercentage, bool $feeBearer, float $splitPercentage) |
|
34
|
|
|
{ |
|
35
|
|
|
$this->subAccountCode = trim($subAccountCode); |
|
36
|
|
|
$this->feePercentage = $feePercentage; |
|
37
|
|
|
$this->feeBearer = $feeBearer; |
|
38
|
|
|
$this->splitPercentage = $splitPercentage; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function toArray(): array |
|
42
|
|
|
{ |
|
43
|
|
|
return [ |
|
44
|
|
|
"subAccountCode" => $this->subAccountCode, |
|
45
|
|
|
"feePercentage" => $this->feePercentage, |
|
46
|
|
|
"splitPercentage" => $this->splitPercentage, |
|
47
|
|
|
"feeBearer" => $this->feeBearer |
|
48
|
|
|
]; |
|
49
|
|
|
} |
|
50
|
|
|
} |
|
51
|
|
|
|