1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Pagantis\OrdersApiClient\Model\Order; |
4
|
|
|
|
5
|
|
|
use Pagantis\OrdersApiClient\Model\AbstractModel; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class Refund |
9
|
|
|
* @package Pagantis\OrdersApiClient\Model |
10
|
|
|
*/ |
11
|
|
|
class Refund extends AbstractModel |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* @var string $id This is the refund Id |
15
|
|
|
*/ |
16
|
|
|
protected $id; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var int $promotedAmount In cents the amount of the refund that is considered as promoted |
20
|
|
|
*/ |
21
|
|
|
protected $promotedAmount; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var \DateTime $createdAt Datetime of the refund moment |
25
|
|
|
*/ |
26
|
|
|
protected $createdAt; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var int $totalAmount Total amount for the refund. |
30
|
|
|
*/ |
31
|
|
|
protected $totalAmount; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var int $refundedMerchantCost, the cost applied to the merchant. |
35
|
|
|
*/ |
36
|
|
|
protected $refundedMerchantCost; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var int $paymentProcessorCost, the cost generated by the payment processor. |
40
|
|
|
*/ |
41
|
|
|
protected $paymentProcessorCost; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Refund constructor. |
45
|
|
|
*/ |
46
|
|
|
public function __construct() |
47
|
|
|
{ |
48
|
|
|
$this->promotedAmount = 0; |
49
|
|
|
$this->paymentProcessorCost = 0; |
50
|
|
|
$this->refundedMerchantCost = 0; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @return string |
55
|
|
|
*/ |
56
|
|
|
public function getId() |
57
|
|
|
{ |
58
|
|
|
return $this->id; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @param string $id |
63
|
|
|
* @return Refund |
64
|
|
|
*/ |
65
|
|
|
public function setId($id) |
66
|
|
|
{ |
67
|
|
|
$this->id = $id; |
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return int |
73
|
|
|
*/ |
74
|
|
|
public function getPromotedAmount() |
75
|
|
|
{ |
76
|
|
|
return $this->promotedAmount; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @param $promotedAmount |
81
|
|
|
* |
82
|
|
|
* @return $this |
83
|
|
|
*/ |
84
|
|
|
public function setPromotedAmount($promotedAmount) |
85
|
|
|
{ |
86
|
|
|
$this->promotedAmount = $promotedAmount; |
87
|
|
|
|
88
|
|
|
return $this; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @return \DateTime |
93
|
|
|
*/ |
94
|
|
|
public function getCreatedAt() |
95
|
|
|
{ |
96
|
|
|
return $this->createdAt; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @param \DateTime $createdAt |
101
|
|
|
* |
102
|
|
|
* @return $this |
103
|
|
|
*/ |
104
|
|
|
public function setCreatedAt(\DateTime $createdAt) |
105
|
|
|
{ |
106
|
|
|
$this->createdAt = $createdAt; |
107
|
|
|
|
108
|
|
|
return $this; |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @return int |
113
|
|
|
*/ |
114
|
|
|
public function getTotalAmount() |
115
|
|
|
{ |
116
|
|
|
return $this->totalAmount; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @param $totalAmount |
121
|
|
|
* |
122
|
|
|
* @return $this |
123
|
|
|
*/ |
124
|
|
|
public function setTotalAmount($totalAmount) |
125
|
|
|
{ |
126
|
|
|
$this->totalAmount = $totalAmount; |
127
|
|
|
|
128
|
|
|
return $this; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return int |
133
|
|
|
*/ |
134
|
|
|
public function getRefundedMerchantCost() |
135
|
|
|
{ |
136
|
|
|
return $this->refundedMerchantCost; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @param int $refundedMerchantCost |
141
|
|
|
* |
142
|
|
|
* @return Refund |
143
|
|
|
*/ |
144
|
|
|
public function setRefundedMerchantCost($refundedMerchantCost) |
145
|
|
|
{ |
146
|
|
|
$this->refundedMerchantCost = $refundedMerchantCost; |
147
|
|
|
|
148
|
|
|
return $this; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @return int |
153
|
|
|
*/ |
154
|
|
|
public function getPaymentProcessorCost() |
155
|
|
|
{ |
156
|
|
|
return $this->paymentProcessorCost; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* @param int $paymentProcessorCost |
161
|
|
|
* |
162
|
|
|
* @return Refund |
163
|
|
|
*/ |
164
|
|
|
public function setPaymentProcessorCost($paymentProcessorCost) |
165
|
|
|
{ |
166
|
|
|
$this->paymentProcessorCost = $paymentProcessorCost; |
167
|
|
|
|
168
|
|
|
return $this; |
169
|
|
|
} |
170
|
|
|
} |
171
|
|
|
|