1: <?php
2: namespace Hyperwallet\Model;
3:
4: /**
5: * Represents a V4 Receipt
6: *
7: * @property string $journalId The journal id
8: * @property string $type The transaction type
9: * @property \DateTime $createdOn The transaction creation date
10: * @property string $entry The entry type
11: * @property string $sourceToken The source token
12: * @property string $destinationToken The destination token
13: * @property string $amount The transaction amount
14: * @property string $fee The fee amount
15: * @property string $currency The transaction currency
16: * @property double $foreignExchangeRate The foreign exchange rate
17: * @property string $foreignExchangeCurrency The foreign exchange currency
18: * @property array $details The transaction details
19: *
20: * @package Hyperwallet\Model
21: */
22: class Receipt extends BaseModel {
23:
24: /**
25: * @internal
26: *
27: * Read only fields
28: *
29: * @var string[]
30: */
31: private static $READ_ONLY_FIELDS = array('journalId', 'type', 'createdOn', 'entry', 'sourceToken', 'destinationToken', 'amount', 'fee', 'currency', 'foreignExchangeRate', 'foreignExchangeCurrency', 'details');
32:
33: public static function FILTERS_ARRAY_USER() {
34: return array('createdBefore', 'createdAfter', 'sortBy', 'limit');
35: }
36:
37: public static function FILTERS_ARRAY_PREPAID_CARD() {
38: return array('createdBefore', 'createdAfter');
39: }
40:
41: public static function FILTERS_ARRAY_ACCOUNT() {
42: return array('currency', 'createdBefore', 'createdAfter', 'sortBy', 'limit');
43: }
44:
45: const ENTRY_DEBIT = 'DEBIT';
46: const ENTRY_CREDIT = 'CREDIT';
47:
48: // Generic Fees
49: const TYPE_ANNUAL_FEE = 'ANNUAL_FEE';
50: const TYPE_ANNUAL_FEE_REFUND = 'ANNUAL_FEE_REFUND';
51: const TYPE_CUSTOMER_SERVICE_FEE = 'CUSTOMER_SERVICE_FEE';
52: const TYPE_CUSTOMER_SERVICE_FEE_REFUND = 'CUSTOMER_SERVICE_FEE_REFUND';
53: const TYPE_EXPEDITED_SHIPPING_FEE = 'EXPEDITED_SHIPPING_FEE';
54: const TYPE_GENERIC_FEE_REFUND = 'GENERIC_FEE_REFUND';
55: const TYPE_MONTHLY_FEE = 'MONTHLY_FEE';
56: const TYPE_MONTHLY_FEE_REFUND = 'MONTHLY_FEE_REFUND';
57: const TYPE_PAYMENT_EXPIRY_FEE = 'PAYMENT_EXPIRY_FEE';
58: const TYPE_PAYMENT_FEE = 'PAYMENT_FEE';
59: const TYPE_PROCESSING_FEE = 'PROCESSING_FEE';
60: const TYPE_STANDARD_SHIPPING_FEE = 'STANDARD_SHIPPING_FEE';
61: const TYPE_TRANSFER_FEE = 'TRANSFER_FEE';
62:
63: // Generic Payment Types
64: const TYPE_ADJUSTMENT = 'ADJUSTMENT';
65: const TYPE_FOREIGN_EXCHANGE = 'FOREIGN_EXCHANGE';
66: const TYPE_DEPOSIT = 'DEPOSIT';
67: const TYPE_MANUAL_ADJUSTMENT = 'MANUAL_ADJUSTMENT';
68: const TYPE_PAYMENT_EXPIRATION = 'PAYMENT_EXPIRATION';
69:
70: // Related to Bank Accounts
71: const TYPE_BANK_ACCOUNT_TRANSFER_FEE = 'BANK_ACCOUNT_TRANSFER_FEE';
72: const TYPE_BANK_ACCOUNT_TRANSFER_RETURN = 'BANK_ACCOUNT_TRANSFER_RETURN';
73: const TYPE_BANK_ACCOUNT_TRANSFER_RETURN_FEE = 'BANK_ACCOUNT_TRANSFER_RETURN_FEE';
74: const TYPE_TRANSFER_TO_BANK_ACCOUNT = 'TRANSFER_TO_BANK_ACCOUNT';
75:
76: // Related to Cards
77: const TYPE_CARD_ACTIVATION_FEE = 'CARD_ACTIVATION_FEE';
78: const TYPE_CARD_ACTIVATION_FEE_WAIVER = 'CARD_ACTIVATION_FEE_WAIVER';
79: const TYPE_CARD_FEE = 'CARD_FEE';
80: const TYPE_MANUAL_TRANSFER_TO_PREPAID_CARD = 'MANUAL_TRANSFER_TO_PREPAID_CARD';
81: const TYPE_PREPAID_CARD_ACCOUNT_DEPOSIT = 'PREPAID_CARD_ACCOUNT_DEPOSIT';
82: const TYPE_PREPAID_CARD_ACCOUNT_FEE = 'PREPAID_CARD_ACCOUNT_FEE';
83: const TYPE_PREPAID_CARD_ANNUAL_FEE_DISCOUNT = 'PREPAID_CARD_ANNUAL_FEE_DISCOUNT';
84: const TYPE_PREPAID_CARD_BALANCE_INQUIRY_FEE = 'PREPAID_CARD_BALANCE_INQUIRY_FEE';
85: const TYPE_PREPAID_CARD_BILL_REPRINT_FEE = 'PREPAID_CARD_BILL_REPRINT_FEE';
86: const TYPE_PREPAID_CARD_CASH_ADVANCE = 'PREPAID_CARD_CASH_ADVANCE';
87: const TYPE_PREPAID_CARD_ATM_OR_CASH_ADVANCE_FEE = 'PREPAID_CARD_ATM_OR_CASH_ADVANCE_FEE';
88: const TYPE_PREPAID_CARD_CASH_ADVANCE_CHARGEBACK = 'PREPAID_CARD_CASH_ADVANCE_CHARGEBACK';
89: const TYPE_PREPAID_CARD_CASH_ADVANCE_CHARGEBACK_REVERSAL = 'PREPAID_CARD_CASH_ADVANCE_CHARGEBACK_REVERSAL';
90: const TYPE_PREPAID_CARD_CASH_ADVANCE_REPRESS = 'PREPAID_CARD_CASH_ADVANCE_REPRESS';
91: const TYPE_PREPAID_CARD_CASH_ADVANCE_REPRESS_REVERSAL = 'PREPAID_CARD_CASH_ADVANCE_REPRESS_REVERSAL';
92: const TYPE_PREPAID_CARD_CHARGEBACK = 'PREPAID_CARD_CHARGEBACK';
93: const TYPE_PREPAID_CARD_CHARGEBACK_REFUND = 'PREPAID_CARD_CHARGEBACK_REFUND';
94: const TYPE_PREPAID_CARD_CHARGEBACK_REFUND_REVERSAL = 'PREPAID_CARD_CHARGEBACK_REFUND_REVERSAL';
95: const TYPE_PREPAID_CARD_CHARGEBACK_REVERSAL = 'PREPAID_CARD_CHARGEBACK_REVERSAL';
96: const TYPE_PREPAID_CARD_COMMISSION_OR_FEE = 'PREPAID_CARD_COMMISSION_OR_FEE';
97: const TYPE_PREPAID_CARD_DEBIT_TRANSFER = 'PREPAID_CARD_DEBIT_TRANSFER';
98: const TYPE_PREPAID_CARD_DISPUTED_CHARGE_REFUND = 'PREPAID_CARD_DISPUTED_CHARGE_REFUND';
99: const TYPE_PREPAID_CARD_DISPUTE_DEPOSIT = 'PREPAID_CARD_DISPUTE_DEPOSIT';
100: const TYPE_PREPAID_CARD_DOCUMENT_REQUEST_FEE = 'PREPAID_CARD_DOCUMENT_REQUEST_FEE';
101: const TYPE_PREPAID_CARD_DOMESTIC_CASH_WITHDRAWAL_FEE = 'PREPAID_CARD_DOMESTIC_CASH_WITHDRAWAL_FEE';
102: const TYPE_PREPAID_CARD_EMERGENCY_CASH = 'PREPAID_CARD_EMERGENCY_CASH';
103: const TYPE_PREPAID_CARD_EMERGENCY_CARD = 'PREPAID_CARD_EMERGENCY_CARD';
104: const TYPE_PREPAID_CARD_EXCHANGE_RATE_DIFFERENCE = 'PREPAID_CARD_EXCHANGE_RATE_DIFFERENCE';
105: const TYPE_PREPAID_CARD_INCOME = 'PREPAID_CARD_INCOME';
106: const TYPE_PREPAID_CARD_LOAD_FEE = 'PREPAID_CARD_LOAD_FEE';
107: const TYPE_PREPAID_CARD_MANUAL_UNLOAD = 'PREPAID_CARD_MANUAL_UNLOAD';
108: const TYPE_PREPAID_CARD_OVERDUE_PAYMENT_INTEREST = 'PREPAID_CARD_OVERDUE_PAYMENT_INTEREST';
109: const TYPE_PREPAID_CARD_OVERSEAS_CASH_WITHDRAWAL_FEE = 'PREPAID_CARD_OVERSEAS_CASH_WITHDRAWAL_FEE';
110: const TYPE_PREPAID_CARD_PAYMENT = 'PREPAID_CARD_PAYMENT';
111: const TYPE_PREPAID_CARD_PIN_CHANGE_FEE = 'PREPAID_CARD_PIN_CHANGE_FEE';
112: const TYPE_PREPAID_CARD_PIN_REPRINT_FEE = 'PREPAID_CARD_PIN_REPRINT_FEE';
113: const TYPE_PREPAID_CARD_PRIORITY_PASS_FEE = 'PREPAID_CARD_PRIORITY_PASS_FEE';
114: const TYPE_PREPAID_CARD_PRIORITY_PASS_RENEWAL = 'PREPAID_CARD_PRIORITY_PASS_RENEWAL';
115: const TYPE_PREPAID_CARD_RECURRING_INTEREST = 'PREPAID_CARD_RECURRING_INTEREST';
116: const TYPE_PREPAID_CARD_REFUND = 'PREPAID_CARD_REFUND';
117: const TYPE_PREPAID_CARD_REFUND_REPRESS = 'PREPAID_CARD_REFUND_REPRESS';
118: const TYPE_PREPAID_CARD_REFUND_REPRESS_REVERSAL = 'PREPAID_CARD_REFUND_REPRESS_REVERSAL';
119: const TYPE_PREPAID_CARD_REPLACEMENT_FEE = 'PREPAID_CARD_REPLACEMENT_FEE';
120: const TYPE_PREPAID_CARD_SALE = 'PREPAID_CARD_SALE';
121: const TYPE_PREPAID_CARD_SALE_REPRESS = 'PREPAID_CARD_SALE_REPRESS';
122: const TYPE_PREPAID_CARD_SALE_REVERSAL = 'PREPAID_CARD_SALE_REVERSAL';
123: const TYPE_PREPAID_CARD_STATEMENT_FEE = 'PREPAID_CARD_STATEMENT_FEE';
124: const TYPE_PREPAID_CARD_TELEPHONE_SUPPORT_FEE = 'PREPAID_CARD_TELEPHONE_SUPPORT_FEE';
125: const TYPE_PREPAID_CARD_TRANSFER_FEE = 'PREPAID_CARD_TRANSFER_FEE';
126: const TYPE_PREPAID_CARD_TRANSFER_RETURN = 'PREPAID_CARD_TRANSFER_RETURN';
127: const TYPE_PREPAID_CARD_UNLOAD = 'PREPAID_CARD_UNLOAD';
128: const TYPE_PREPAID_CARD_BANK_WITHDRAWAL_REVERSAL = 'PREPAID_CARD_BANK_WITHDRAWAL_REVERSAL';
129: const TYPE_PREPAID_CARD_BANK_WITHDRAWAL_CHARGEBACK = 'PREPAID_CARD_BANK_WITHDRAWAL_CHARGEBACK';
130: const TYPE_TRANSFER_TO_PREPAID_CARD = 'TRANSFER_TO_PREPAID_CARD';
131:
132: // Related to Donations
133: const TYPE_DONATION = 'DONATION';
134: const TYPE_DONATION_FEE = 'DONATION_FEE';
135: const TYPE_DONATION_RETURN = 'DONATION_RETURN';
136:
137: // Related to Merchant Payments
138: const TYPE_MERCHANT_PAYMENT = 'MERCHANT_PAYMENT';
139: const TYPE_MERCHANT_PAYMENT_FEE = 'MERCHANT_PAYMENT_FEE';
140: const TYPE_MERCHANT_PAYMENT_REFUND = 'MERCHANT_PAYMENT_REFUND';
141: const TYPE_MERCHANT_PAYMENT_RETURN = 'MERCHANT_PAYMENT_RETURN';
142:
143: // Related to MoneyGram
144: const TYPE_MONEYGRAM_TRANSFER_RETURN = 'MONEYGRAM_TRANSFER_RETURN';
145: const TYPE_TRANSFER_TO_MONEYGRAM = 'TRANSFER_TO_MONEYGRAM';
146:
147: // Related to Paper Checks
148: const TYPE_PAPER_CHECK_FEE = 'PAPER_CHECK_FEE';
149: const TYPE_PAPER_CHECK_REFUND = 'PAPER_CHECK_REFUND';
150: const TYPE_TRANSFER_TO_PAPER_CHECK = 'TRANSFER_TO_PAPER_CHECK';
151:
152: // Related to PayNearMe
153: const TYPE_PAYNEARME_CASH_DEPOSIT = 'PAYNEARME_CASH_DEPOSIT';
154:
155: // Related to Users or Program Accounts
156: const TYPE_ACCOUNT_CLOSURE = 'ACCOUNT_CLOSURE';
157: const TYPE_ACCOUNT_CLOSURE_FEE = 'ACCOUNT_CLOSURE_FEE';
158: const TYPE_ACCOUNT_UNLOAD = 'ACCOUNT_UNLOAD';
159: const TYPE_DORMANT_USER_FEE = 'DORMANT_USER_FEE';
160: const TYPE_DORMANT_USER_FEE_REFUND = 'DORMANT_USER_FEE_REFUND';
161: const TYPE_PAYMENT = 'PAYMENT';
162: const TYPE_PAYMENT_CANCELLATION = 'PAYMENT_CANCELLATION';
163: const TYPE_PAYMENT_REVERSAL = 'PAYMENT_REVERSAL';
164: const TYPE_PAYMENT_REVERSAL_FEE = 'PAYMENT_REVERSAL_FEE';
165: const TYPE_PAYMENT_RETURN = 'PAYMENT_RETURN';
166: const TYPE_TRANSFER_TO_PROGRAM_ACCOUNT = 'TRANSFER_TO_PROGRAM_ACCOUNT';
167: const TYPE_TRANSFER_TO_USER = 'TRANSFER_TO_USER';
168:
169: // Related to Virtual Incentives
170: const TYPE_VIRTUAL_INCENTIVE_CANCELLATION = 'VIRTUAL_INCENTIVE_CANCELLATION';
171: const TYPE_VIRTUAL_INCENTIVE_ISSUANCE = 'VIRTUAL_INCENTIVE_ISSUANCE';
172: const TYPE_VIRTUAL_INCENTIVE_PURCHASE = 'VIRTUAL_INCENTIVE_PURCHASE';
173: const TYPE_VIRTUAL_INCENTIVE_REFUND = 'VIRTUAL_INCENTIVE_REFUND';
174:
175: // Related to Western Union and WUBS
176: const TYPE_TRANSFER_TO_WESTERN_UNION = 'TRANSFER_TO_WESTERN_UNION';
177: const TYPE_TRANSFER_TO_WUBS_WIRE = 'TRANSFER_TO_WUBS_WIRE';
178: const TYPE_WESTERN_UNION_TRANSFER_RETURN = 'WESTERN_UNION_TRANSFER_RETURN';
179: const TYPE_WUBS_WIRE_TRANSFER_RETURN = 'WUBS_WIRE_TRANSFER_RETURN';
180:
181: // Related to Wire Transfers
182: const TYPE_TRANSFER_TO_WIRE = 'TRANSFER_TO_WIRE';
183: const TYPE_WIRE_TRANSFER_FEE = 'WIRE_TRANSFER_FEE';
184: const TYPE_WIRE_TRANSFER_RETURN = 'WIRE_TRANSFER_RETURN';
185:
186: const DETAILS_FIELD_KEY_CLIENT_PAYMENT_ID = 'clientPaymentId';
187: const DETAILS_FIELD_KEY_NOTES = 'notes';
188: const DETAILS_FIELD_KEY_MEMO = 'memo';
189: const DETAILS_FIELD_KEY_RETURN_OR_RECALL_REASON = 'returnOrRecallReason';
190: const DETAILS_FIELD_KEY_WEBSITE = 'website';
191: const DETAILS_FIELD_KEY_PAYER_NAME = 'payerName';
192: const DETAILS_FIELD_KEY_PAYEE_NAME = 'payeeName';
193: const DETAILS_FIELD_KEY_CHARITY_NAME = 'charityName';
194: const DETAILS_FIELD_KEY_CARD_HOLDER_NAME = 'cardHolderName';
195: const DETAILS_FIELD_KEY_BANK_NAME = 'bankName';
196: const DETAILS_FIELD_KEY_BANK_ID = 'bankId';
197: const DETAILS_FIELD_KEY_BRANCH_NAME = 'branchName';
198: const DETAILS_FIELD_KEY_BRANCH_ID = 'branchId';
199: const DETAILS_FIELD_KEY_BANK_ACCOUNT_ID = 'bankAccountId';
200: const DETAILS_FIELD_KEY_BANK_ACCOUNT_PURPOSE = 'bankAccountPurpose';
201: const DETAILS_FIELD_KEY_BRANCH_ADDRESS_LINE1 = 'branchAddressLine1';
202: const DETAILS_FIELD_KEY_BRANCH_ADDRESS_LINE2 = 'branchAddressLine2';
203: const DETAILS_FIELD_KEY_BRANCH_CITY = 'branchCity';
204: const DETAILS_FIELD_KEY_BRANCH_STATE_PROVINCE = 'branchStateProvince';
205: const DETAILS_FIELD_KEY_BRANCH_COUNTRY = 'branchCountry';
206: const DETAILS_FIELD_KEY_BRANCH_POSTAL_CODE = 'branchPostalCode';
207: const DETAILS_FIELD_KEY_CHECK_NUMBER = 'checkNumber';
208: const DETAILS_FIELD_KEY_CARD_NUMBER = 'cardNumber';
209: const DETAILS_FIELD_KEY_CARD_EXPIRY_DATE = 'cardExpiryDate';
210: const DETAILS_FIELD_KEY_PAYEE_EMAIL = 'payeeEmail';
211: const DETAILS_FIELD_KEY_PAYEE_ADDRESS_LINE1 = 'payeeAddressLine1';
212: const DETAILS_FIELD_KEY_PAYEE_ADDRESS_LINE2 = 'payeeAddressLine2';
213: const DETAILS_FIELD_KEY_PAYEE_CITY = 'payeeCity';
214: const DETAILS_FIELD_KEY_PAYEE_STATE_PROVINCE = 'payeeStateProvince';
215: const DETAILS_FIELD_KEY_PAYEE_COUNTRY = 'payeeCountry';
216: const DETAILS_FIELD_KEY_PAYEE_POSTAL_CODE = 'payeePostalCode';
217: const DETAILS_FIELD_KEY_PAYMENT_EXPIRY_DATE = 'paymentExpiryDate';
218: const DETAILS_FIELD_KEY_SECURITY_QUESTION = 'securityQuestion';
219: const DETAILS_FIELD_KEY_SECURITY_ANSWER = 'securityAnswer';
220:
221: /**
222: * Creates a instance of Balance
223: *
224: * @param string[] $properties The default properties
225: */
226: public function __construct(array $properties = array()) {
227: parent::__construct(self::$READ_ONLY_FIELDS, $properties);
228: }
229:
230: /**
231: * Get the journal id
232: *
233: * @return string
234: */
235: public function getJournalId() {
236: return $this->journalId;
237: }
238:
239: /**
240: * Get the transcation type
241: *
242: * @return string
243: */
244: public function getType() {
245: return $this->type;
246: }
247:
248: /**
249: * Get the transaction creation date
250: *
251: * @return \DateTime
252: */
253: public function getCreatedOn() {
254: return $this->createdOn ? new \DateTime($this->createdOn) : null;
255: }
256:
257: /**
258: * Get the entry type
259: *
260: * @return string
261: */
262: public function getEntry() {
263: return $this->entry;
264: }
265:
266: /**
267: * Get the source token
268: *
269: * @return string
270: */
271: public function getSourceToken() {
272: return $this->sourceToken;
273: }
274:
275: /**
276: * Get the destination token
277: *
278: * @return string
279: */
280: public function getDestinationToken() {
281: return $this->destinationToken;
282: }
283:
284: /**
285: * Get the transaction amount
286: *
287: * @return string
288: */
289: public function getAmount() {
290: return $this->amount;
291: }
292:
293: /**
294: * Get the transaction fee amount
295: *
296: * @return string
297: */
298: public function getFee() {
299: return $this->fee;
300: }
301:
302: /**
303: * Get the transaction currency
304: *
305: * @return string
306: */
307: public function getCurrency() {
308: return $this->currency;
309: }
310:
311: /**
312: * Get the foreign exchange rate
313: *
314: * @return float
315: */
316: public function getForeignExchangeRate() {
317: return $this->foreignExchangeRate;
318: }
319:
320: /**
321: * Get the foreign exchange currency
322: *
323: * @return string
324: */
325: public function getForeignExchangeCurrency() {
326: return $this->foreignExchangeCurrency;
327: }
328:
329: /**
330: * Get the transaction details (note this is a multi dimensional array see `DETAILS_FIELD_KEY_*` for possible keys)
331: *
332: * @return array
333: */
334: public function getDetails() {
335: return $this->details;
336: }
337:
338: }
339: