-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathtransaction_search.js
86 lines (82 loc) · 2.7 KB
/
transaction_search.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
'use strict';
let AdvancedSearch = require('./advanced_search').AdvancedSearch;
let Transaction = require('./transaction').Transaction;
let CreditCard = require('./credit_card').CreditCard;
class TransactionSearch extends AdvancedSearch {
static initClass() {
this.textFields(
'billingCompany',
'billingCountryName',
'billingExtendedAddress',
'billingFirstName',
'billingLastName',
'billingLocality',
'billingPostalCode',
'billingRegion',
'billingStreetAddress',
'creditCardCardholderName',
'currency',
'customerCompany',
'customerEmail',
'customerFax',
'customerFirstName',
'customerId',
'customerLastName',
'customerPhone',
'customerWebsite',
'id',
'orderId',
'paymentMethodToken',
'paypalPayerEmail',
'paypalPaymentId',
'paypalAuthorizationId',
'processorAuthorizationCode',
'settlementBatchId',
'shippingCompany',
'shippingCountryName',
'shippingExtendedAddress',
'shippingFirstName',
'shippingLastName',
'shippingLocality',
'shippingPostalCode',
'shippingRegion',
'shippingStreetAddress',
'creditCardUniqueIdentifier'
);
this.equalityFields('creditCardExpirationDate');
this.partialMatchFields('creditCardNumber');
this.multipleValueField('createdUsing', {allows: [
Transaction.CreatedUsing.FullInformation,
Transaction.CreatedUsing.Token
]});
this.multipleValueField('creditCardCardType', {allows: CreditCard.CardType.All()}); // eslint-disable-line new-cap
this.multipleValueField('creditCardCustomerLocation', {allows: [
CreditCard.CustomerLocation.International,
CreditCard.CustomerLocation.US
]});
this.multipleValueField('ids');
this.multipleValueField('user');
this.multipleValueField('paymentInstrumentType');
this.multipleValueField('merchantAccountId');
this.multipleValueField('status', {allows: Transaction.Status.All()}); // eslint-disable-line new-cap
this.multipleValueField('source');
this.multipleValueField('type', {allows: Transaction.Type.All()}); // eslint-disable-line new-cap
this.keyValueFields('refund');
this.rangeFields(
'amount',
'authorizationExpiredAt',
'authorizedAt',
'createdAt',
'disbursementDate',
'disputeDate',
'failedAt',
'gatewayRejectedAt',
'processorDeclinedAt',
'settledAt',
'submittedForSettlementAt',
'voidedAt'
);
}
}
TransactionSearch.initClass();
module.exports = {TransactionSearch: TransactionSearch};