1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ipag\Classes; |
4
|
|
|
|
5
|
|
|
use Ipag\Classes\Contracts\Emptiable; |
6
|
|
|
use Ipag\Classes\Traits\EmptiableTrait; |
7
|
|
|
|
8
|
|
|
final class SplitRule extends BaseResource implements Emptiable |
9
|
|
|
{ |
10
|
|
|
use EmptiableTrait; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @var string |
14
|
|
|
*/ |
15
|
|
|
private $sellerId; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var float |
19
|
|
|
*/ |
20
|
|
|
private $percentage; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var float |
24
|
|
|
*/ |
25
|
|
|
private $amount; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var int |
29
|
|
|
*/ |
30
|
|
|
private $liable; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var int |
34
|
|
|
*/ |
35
|
|
|
private $chargeProcessingFee; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var int |
39
|
|
|
*/ |
40
|
|
|
private $holdReceivables; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @return string |
44
|
|
|
*/ |
45
|
|
|
public function getSellerId() |
46
|
|
|
{ |
47
|
|
|
return $this->sellerId; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @param string $sellerId |
52
|
|
|
* |
53
|
|
|
* @return self |
54
|
|
|
*/ |
55
|
|
|
public function setSellerId($sellerId) |
56
|
|
|
{ |
57
|
|
|
$this->sellerId = $sellerId; |
58
|
|
|
|
59
|
|
|
return $this; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return float |
64
|
|
|
*/ |
65
|
|
|
public function getPercentage() |
66
|
|
|
{ |
67
|
|
|
return $this->percentage; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param float $percentage |
72
|
|
|
* |
73
|
|
|
* @return self |
74
|
|
|
*/ |
75
|
|
|
public function setPercentage($percentage) |
76
|
|
|
{ |
77
|
|
|
$this->percentage = $this->getNumberUtil()->convertToDouble($percentage); |
78
|
|
|
|
79
|
|
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return float |
84
|
|
|
*/ |
85
|
|
|
public function getAmount() |
86
|
|
|
{ |
87
|
|
|
return $this->amount; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @param float $amount |
92
|
|
|
* |
93
|
|
|
* @return self |
94
|
|
|
*/ |
95
|
|
|
public function setAmount($amount) |
96
|
|
|
{ |
97
|
|
|
$this->amount = $this->getNumberUtil()->convertToDouble($amount); |
98
|
|
|
|
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return int |
104
|
|
|
*/ |
105
|
|
|
public function getLiable() |
106
|
|
|
{ |
107
|
|
|
return $this->liable; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @param int $liable |
112
|
|
|
* |
113
|
|
|
* @return self |
114
|
|
|
*/ |
115
|
|
|
public function setLiable($liable = 1) |
116
|
|
|
{ |
117
|
|
|
$this->liable = intval($liable); |
118
|
|
|
|
119
|
|
|
return $this; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return int |
124
|
|
|
*/ |
125
|
|
|
public function getChargeProcessingFee() |
126
|
|
|
{ |
127
|
|
|
return $this->chargeProcessingFee; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @param int $chargeProcessingFee |
132
|
|
|
* |
133
|
|
|
* @return self |
134
|
|
|
*/ |
135
|
|
|
public function setChargeProcessingFee($chargeProcessingFee = 0) |
136
|
|
|
{ |
137
|
|
|
$this->chargeProcessingFee = intval($chargeProcessingFee); |
138
|
|
|
|
139
|
|
|
return $this; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* Get the value of holdReceivables |
144
|
|
|
* |
145
|
|
|
* @return int |
146
|
|
|
*/ |
147
|
|
|
public function getHoldReceivables() |
148
|
|
|
{ |
149
|
|
|
return $this->holdReceivables; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* Set the value of holdReceivables |
154
|
|
|
* |
155
|
|
|
* @param int $holdReceivables |
156
|
|
|
* |
157
|
|
|
* @return self |
158
|
|
|
*/ |
159
|
|
|
public function setHoldReceivables($holdReceivables = 0) |
160
|
|
|
{ |
161
|
|
|
$this->holdReceivables = (int) $holdReceivables; |
162
|
|
|
|
163
|
|
|
return $this; |
164
|
|
|
} |
165
|
|
|
} |
166
|
|
|
|