1: <?php
2: namespace Hyperwallet\Model;
3:
4: /**
5: * Represents a V4 Transfer
6: *
7: * @property string $token The transfer token
8: * @property string $status The transfer status
9: * @property \DateTime $createdOn The transfer creation date
10: * @property string $clientTransferId The client transfer id
11: * @property string $sourceToken The source token
12: * @property string $sourceAmount The source amount
13: * @property string $sourceFeeAmount The source fee amount
14: * @property string $sourceCurrency The source currency
15: * @property string $destinationToken The destination token
16: * @property string $destinationAmount The destination amount
17: * @property string $destinationFeeAmount The destination fee amount
18: * @property string $destinationCurrency The destination currency
19: * @property array $foreignExchanges The foreign exchanges
20: * @property string $notes The notes
21: * @property string $memo The memo
22: * @property \DateTime $expiresOn The transfer expiration date
23:
24: *
25: * @package Hyperwallet\Model
26: */
27:
28: class Transfer extends BaseModel {
29:
30: /**
31: * @internal
32: *
33: * Read only fields
34: *
35: * @var string[]
36: */
37: private static $READ_ONLY_FIELDS = array('token', 'status', 'createdOn', 'sourceFeeAmount', 'destinationFeeAmount', 'foreignExchanges', 'expiresOn');
38:
39: const STATUS_QUOTED = 'QUOTED';
40: const STATUS_SCHEDULED = 'SCHEDULED';
41: const STATUS_IN_PROGRESS = 'IN_PROGRESS';
42: const STATUS_VERIFICATION_REQUIRED = 'VERIFICATION_REQUIRED';
43: const STATUS_COMPLETED = 'COMPLETED';
44: const STATUS_CANCELLED = 'CANCELLED';
45: const STATUS_RETURNED = 'RETURNED';
46: const STATUS_FAILED = 'FAILED';
47: const STATUS_EXPIRED = 'EXPIRED';
48:
49: public static function FILTERS_ARRAY() {
50: return array('clientTransferId','sourceToken','destinationToken', 'createdBefore', 'createdAfter', 'limit');
51: }
52:
53: /**
54: * Creates a instance of Transfer
55: *
56: * @param string[] $properties The default properties
57: */
58: public function __construct(array $properties = array()) {
59: parent::__construct(self::$READ_ONLY_FIELDS, $properties);
60: }
61:
62: /**
63: * Get the transfer token
64: *
65: * @return string
66: */
67: public function getToken() {
68: return $this->token;
69: }
70:
71: /**
72: * Set the transfer token
73: *
74: * @param string $token
75: * @return Transfer
76: */
77: public function setToken($token) {
78: $this->token = $token;
79: return $this;
80: }
81:
82: /**
83: * Get the transfer status
84: *
85: * @return string
86: */
87: public function getStatus() {
88: return $this->status;
89: }
90:
91: /**
92: * Get the transfer creation date
93: *
94: * @return \DateTime
95: */
96: public function getCreatedOn() {
97: return $this->createdOn ? new \DateTime($this->createdOn) : null;
98: }
99:
100: /**
101: * Get transfer clientTransferId
102: *
103: * @return string
104: */
105: public function getClientTransferId() {
106: return $this->clientTransferId;
107: }
108:
109: /**
110: * Set transfer clientTransferId
111: *
112: * @param string $clientTransferId
113: * @return Transfer
114: */
115: public function setClientTransferId($clientTransferId) {
116: $this->clientTransferId = $clientTransferId;
117: return $this;
118: }
119:
120: /**
121: * Get transfer sourceToken
122: *
123: * @return string
124: */
125: public function getSourceToken() {
126: return $this->sourceToken;
127: }
128:
129: /**
130: * Set transfer sourceToken
131: *
132: * @param string $sourceToken
133: * @return Transfer
134: */
135: public function setSourceToken($sourceToken) {
136: $this->sourceToken = $sourceToken;
137: return $this;
138: }
139:
140: /**
141: * Get transfer sourceAmount
142: *
143: * @return string
144: */
145: public function getSourceAmount() {
146: return $this->sourceAmount;
147: }
148:
149: /**
150: * Set transfer sourceAmount
151: *
152: * @param string $sourceAmount
153: * @return Transfer
154: */
155: public function setSourceAmount($sourceAmount) {
156: $this->sourceAmount = $sourceAmount;
157: return $this;
158: }
159:
160: /**
161: * Get transfer sourceFeeAmount
162: *
163: * @return string
164: */
165: public function getSourceFeeAmount() {
166: return $this->sourceFeeAmount;
167: }
168:
169: /**
170: * Get transfer sourceCurrency
171: *
172: * @return string
173: */
174: public function getSourceCurrency() {
175: return $this->sourceCurrency;
176: }
177:
178: /**
179: * Set transfer sourceCurrency
180: *
181: * @param string $sourceCurrency
182: * @return Transfer
183: */
184: public function setSourceCurrency($sourceCurrency) {
185: $this->sourceCurrency = $sourceCurrency;
186: return $this;
187: }
188:
189: /**
190: * Get transfer destinationToken
191: *
192: * @return string
193: */
194: public function getDestinationToken() {
195: return $this->destinationToken;
196: }
197:
198: /**
199: * Set transfer destinationToken
200: *
201: * @param string $destinationToken
202: * @return Transfer
203: */
204: public function setDestinationToken($destinationToken) {
205: $this->destinationToken = $destinationToken;
206: return $this;
207: }
208:
209: /**
210: * Get transfer destinationAmount
211: *
212: * @return string
213: */
214: public function getDestinationAmount() {
215: return $this->destinationAmount;
216: }
217:
218: /**
219: * Set transfer destinationAmount
220: *
221: * @param string $destinationAmount
222: * @return Transfer
223: */
224: public function setDestinationAmount($destinationAmount) {
225: $this->destinationAmount = $destinationAmount;
226: return $this;
227: }
228:
229: /**
230: * Get transfer destinationFeeAmount
231: *
232: * @return string
233: */
234: public function getDestinationFeeAmount() {
235: return $this->destinationFeeAmount;
236: }
237:
238: /**
239: * Get transfer destinationCurrency
240: *
241: * @return string
242: */
243: public function getDestinationCurrency() {
244: return $this->destinationCurrency;
245: }
246:
247: /**
248: * Set transfer destinationCurrency
249: *
250: * @param string $destinationCurrency
251: * @return Transfer
252: */
253: public function setDestinationCurrency($destinationCurrency) {
254: $this->destinationCurrency = $destinationCurrency;
255: return $this;
256: }
257:
258: /**
259: * Get transfer foreignExchanges
260: *
261: * @return array
262: */
263: public function getForeignExchanges() {
264: return $this->foreignExchanges;
265: }
266:
267: /**
268: * Get transfer notes
269: *
270: * @return string
271: */
272: public function getNotes() {
273: return $this->notes;
274: }
275:
276: /**
277: * Set transfer notes
278: *
279: * @param string $notes
280: * @return Transfer
281: */
282: public function setNotes($notes) {
283: $this->notes = $notes;
284: return $this;
285: }
286:
287: /**
288: * Get transfer memo
289: *
290: * @return string
291: */
292: public function getMemo() {
293: return $this->memo;
294: }
295:
296: /**
297: * Set transfer memo
298: *
299: * @param string $memo
300: * @return Transfer
301: */
302: public function setMemo($memo) {
303: $this->memo = $memo;
304: return $this;
305: }
306:
307: /**
308: * Get transfer expiresOn
309: *
310: * @return \DateTime
311: */
312: public function getExpiresOn() {
313: return $this->expiresOn ? new \DateTime($this->expiresOn) : null;
314: }
315: }
316: