1: <?php
2: namespace Hyperwallet\Model;
3:
4: /**
5: * Represents a V4 Payment
6: *
7: * @property string $token The payment token
8: * @property string $status The status
9: * @property \DateTime $createdOn The payment creation date
10: *
11: * @property string $clientPaymentId The client payment id
12: * @property string $amount The payment amount
13: * @property string $currency The payment currency
14: *
15: * @property string $description The payment description
16: * @property string $memo The payment memo
17: * @property string $purpose The payment purpose
18: * @property \DateTime $releaseOn The payment release date
19: * @property \DateTime $expiresOn The payment expiry date
20: *
21: * @property string $destinationToken The payment destination token
22: * @property string $programToken The payment program token
23: *
24: * @package Hyperwallet\Model
25: */
26: class Payment extends BaseModel implements IProgramAware {
27:
28: /**
29: * @internal
30: *
31: * Read only fields
32: *
33: * @var string[]
34: */
35: private static $READ_ONLY_FIELDS = array('token', 'createdOn');
36:
37: public static function FILTERS_ARRAY() {
38: return array('clientPaymentId', 'releaseDate', 'createdBefore', 'createdAfter', 'sortBy', 'limit');
39: }
40:
41: /**
42: * Creates a instance of Payment
43: *
44: * @param string[] $properties The default properties
45: */
46: public function __construct(array $properties = array()) {
47: parent::__construct(self::$READ_ONLY_FIELDS, $properties);
48: }
49:
50: /**
51: * Get the payment token
52: *
53: * @return string
54: */
55: public function getToken() {
56: return $this->token;
57: }
58:
59: /**
60: * Set the payment token
61: *
62: * @param string $token
63: * @return Payment
64: */
65: public function setToken($token) {
66: $this->token = $token;
67: return $this;
68: }
69:
70: /**
71: * Get the status
72: *
73: * @return string
74: */
75: public function getStatus() {
76: return $this->status;
77: }
78:
79: /**
80: * Set the status
81: *
82: * @param string $status
83: * @return Payment
84: */
85: public function setStatus($status) {
86: $this->status = $status;
87: return $this;
88: }
89:
90: /**
91: * Get the payment creation date
92: *
93: * @return \DateTime
94: */
95: public function getCreatedOn() {
96: return $this->createdOn ? new \DateTime($this->createdOn) : null;
97: }
98:
99: /**
100: * Get the client payment id
101: *
102: * @return string
103: */
104: public function getClientPaymentId() {
105: return $this->clientPaymentId;
106: }
107:
108: /**
109: * Set the client payment id
110: *
111: * @param string $clientPaymentId
112: * @return Payment
113: */
114: public function setClientPaymentId($clientPaymentId) {
115: $this->clientPaymentId = $clientPaymentId;
116: return $this;
117: }
118:
119: /**
120: * Get the payment amount
121: *
122: * @return string
123: */
124: public function getAmount() {
125: return $this->amount;
126: }
127:
128: /**
129: * Set the payment amount
130: *
131: * @param string $amount
132: * @return Payment
133: */
134: public function setAmount($amount) {
135: $this->amount = $amount;
136: return $this;
137: }
138:
139: /**
140: * Get the payment currency
141: *
142: * @return string
143: */
144: public function getCurrency() {
145: return $this->currency;
146: }
147:
148: /**
149: * Set the payment currency
150: *
151: * @param string $currency
152: * @return Payment
153: */
154: public function setCurrency($currency) {
155: $this->currency = $currency;
156: return $this;
157: }
158:
159: /**
160: * Get the payment description
161: *
162: * @return string
163: */
164: public function getDescription() {
165: return $this->description;
166: }
167:
168: /**
169: * Set the payment description
170: *
171: * @param string $description
172: * @return Payment
173: */
174: public function setDescription($description) {
175: $this->description = $description;
176: return $this;
177: }
178:
179: /**
180: * Get the payment memo
181: *
182: * @return string
183: */
184: public function getMemo() {
185: return $this->memo;
186: }
187:
188: /**
189: * Set the payment memo
190: *
191: * @param string $memo
192: * @return Payment
193: */
194: public function setMemo($memo) {
195: $this->memo = $memo;
196: return $this;
197: }
198:
199: /**
200: * Get the payment purpose
201: *
202: * @return string
203: */
204: public function getPurpose() {
205: return $this->purpose;
206: }
207:
208: /**
209: * Set the paymeny purpose
210: *
211: * @param string $purpose
212: * @return Payment
213: */
214: public function setPurpose($purpose) {
215: $this->purpose = $purpose;
216: return $this;
217: }
218:
219: /**
220: * Get the payment release date
221: * @return \DateTime
222: */
223: public function getReleaseOn() {
224: return $this->releaseOn ? new \DateTime($this->releaseOn) : null;
225: }
226:
227: /**
228: * Set the payment release date
229: *
230: * @param \DateTime $releaseOn
231: * @return Payment
232: */
233: public function setReleaseOn(\DateTime $releaseOn = null) {
234: $this->releaseOn = $releaseOn == null ? null : $releaseOn->format('Y-m-d\TH:i:s');
235: return $this;
236: }
237:
238: /**
239: * Get the payment expiry date
240: * @return \DateTime
241: */
242: public function getExpiresOn() {
243: return $this->expiresOn ? new \DateTime($this->expiresOn) : null;
244: }
245:
246: /**
247: * Set the payment expiry date
248: *
249: * @param \DateTime $expiresOn
250: * @return Payment
251: */
252: public function setExpiresOn(\DateTime $expiresOn = null) {
253: $this->expiresOn = $expiresOn == null ? null : $expiresOn->format('Y-m-d\TH:i:s');
254: return $this;
255: }
256:
257: /**
258: * Get the payment destination token
259: *
260: * @return string
261: */
262: public function getDestinationToken() {
263: return $this->destinationToken;
264: }
265:
266: /**
267: * Set the payment destination token
268: *
269: * @param string $destinationToken
270: * @return Payment
271: */
272: public function setDestinationToken($destinationToken) {
273: $this->destinationToken = $destinationToken;
274: return $this;
275: }
276:
277: /**
278: * Get the payment program token
279: *
280: * @return string
281: */
282: public function getProgramToken() {
283: return $this->programToken;
284: }
285:
286: /**
287: * Set the payment program token
288: *
289: * @param string $programToken
290: * @return Payment
291: */
292: public function setProgramToken($programToken) {
293: $this->programToken = $programToken;
294: return $this;
295: }
296:
297: }
298: