1
|
|
|
<?php |
2
|
|
|
namespace Braintree; |
3
|
|
|
|
4
|
|
|
class TransactionSearch |
5
|
|
|
{ |
6
|
|
|
public static function amount() { return new RangeNode("amount"); } |
7
|
|
|
public static function authorizationExpiredAt() { return new RangeNode("authorizationExpiredAt"); } |
8
|
|
|
public static function authorizedAt() { return new RangeNode("authorizedAt"); } |
9
|
|
|
public static function billingCompany() { return new TextNode('billing_company'); } |
10
|
|
|
public static function billingCountryName() { return new TextNode('billing_country_name'); } |
11
|
|
|
public static function billingExtendedAddress() { return new TextNode('billing_extended_address'); } |
12
|
|
|
public static function billingFirstName() { return new TextNode('billing_first_name'); } |
13
|
|
|
public static function billingLastName() { return new TextNode('billing_last_name'); } |
14
|
|
|
public static function billingLocality() { return new TextNode('billing_locality'); } |
15
|
|
|
public static function billingPostalCode() { return new TextNode('billing_postal_code'); } |
16
|
|
|
public static function billingRegion() { return new TextNode('billing_region'); } |
17
|
|
|
public static function billingStreetAddress() { return new TextNode('billing_street_address'); } |
18
|
|
|
public static function createdAt() { return new RangeNode("createdAt"); } |
19
|
|
|
public static function creditCardCardholderName() { return new TextNode('credit_card_cardholderName'); } |
20
|
|
|
public static function creditCardExpirationDate() { return new EqualityNode('credit_card_expiration_date'); } |
21
|
|
|
public static function creditCardNumber() { return new PartialMatchNode('credit_card_number'); } |
22
|
|
|
public static function creditCardUniqueIdentifier() { return new TextNode('credit_card_unique_identifier'); } |
23
|
|
|
public static function currency() { return new TextNode('currency'); } |
24
|
|
|
public static function customerCompany() { return new TextNode('customer_company'); } |
25
|
|
|
public static function customerEmail() { return new TextNode('customer_email'); } |
26
|
|
|
public static function customerFax() { return new TextNode('customer_fax'); } |
27
|
|
|
public static function customerFirstName() { return new TextNode('customer_first_name'); } |
28
|
|
|
public static function customerId() { return new TextNode('customer_id'); } |
29
|
|
|
public static function customerLastName() { return new TextNode('customer_last_name'); } |
30
|
|
|
public static function customerPhone() { return new TextNode('customer_phone'); } |
31
|
|
|
public static function customerWebsite() { return new TextNode('customer_website'); } |
32
|
|
|
public static function disbursementDate() { return new RangeNode("disbursementDate"); } |
33
|
|
|
public static function disputeDate() { return new RangeNode("disputeDate"); } |
34
|
|
|
public static function europeBankAccountIban() { return new TextNode("europeBankAccountIban"); } |
35
|
|
|
public static function failedAt() { return new RangeNode("failedAt"); } |
36
|
|
|
public static function gatewayRejectedAt() { return new RangeNode("gatewayRejectedAt"); } |
37
|
|
|
public static function id() { return new TextNode('id'); } |
38
|
|
|
public static function ids() { return new MultipleValueNode('ids'); } |
39
|
|
|
public static function merchantAccountId() { return new MultipleValueNode("merchant_account_id"); } |
40
|
|
|
public static function orderId() { return new TextNode('order_id'); } |
41
|
|
|
public static function paymentInstrumentType() { return new MultipleValueNode('paymentInstrumentType'); } |
42
|
|
|
public static function paymentMethodToken() { return new TextNode('payment_method_token'); } |
43
|
|
|
public static function paypalAuthorizationId() { return new TextNode('paypal_authorization_id'); } |
44
|
|
|
public static function paypalPayerEmail() { return new TextNode('paypal_payer_email'); } |
45
|
|
|
public static function paypalPaymentId() { return new TextNode('paypal_payment_id'); } |
46
|
|
|
public static function processorAuthorizationCode() { return new TextNode('processor_authorization_code'); } |
47
|
|
|
public static function processorDeclinedAt() { return new RangeNode("processorDeclinedAt"); } |
48
|
|
|
public static function refund() { return new KeyValueNode("refund"); } |
49
|
|
|
public static function settledAt() { return new RangeNode("settledAt"); } |
50
|
|
|
public static function settlementBatchId() { return new TextNode('settlement_batch_id'); } |
51
|
|
|
public static function shippingCompany() { return new TextNode('shipping_company'); } |
52
|
|
|
public static function shippingCountryName() { return new TextNode('shipping_country_name'); } |
53
|
|
|
public static function shippingExtendedAddress() { return new TextNode('shipping_extended_address'); } |
54
|
|
|
public static function shippingFirstName() { return new TextNode('shipping_first_name'); } |
55
|
|
|
public static function shippingLastName() { return new TextNode('shipping_last_name'); } |
56
|
|
|
public static function shippingLocality() { return new TextNode('shipping_locality'); } |
57
|
|
|
public static function shippingPostalCode() { return new TextNode('shipping_postal_code'); } |
58
|
|
|
public static function shippingRegion() { return new TextNode('shipping_region'); } |
59
|
|
|
public static function shippingStreetAddress() { return new TextNode('shipping_street_address'); } |
60
|
|
|
public static function submittedForSettlementAt() { return new RangeNode("submittedForSettlementAt"); } |
61
|
|
|
public static function user() { return new MultipleValueNode('user'); } |
62
|
|
|
public static function voidedAt() { return new RangeNode("voidedAt"); } |
63
|
|
|
|
64
|
|
|
public static function createdUsing() |
65
|
|
|
{ |
66
|
|
|
return new MultipleValueNode('created_using', [ |
67
|
|
|
Transaction::FULL_INFORMATION, |
68
|
|
|
Transaction::TOKEN |
69
|
|
|
]); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
View Code Duplication |
public static function creditCardCardType() |
|
|
|
|
73
|
|
|
{ |
74
|
|
|
return new MultipleValueNode('credit_card_card_type', [ |
75
|
|
|
CreditCard::AMEX, |
76
|
|
|
CreditCard::CARTE_BLANCHE, |
77
|
|
|
CreditCard::CHINA_UNION_PAY, |
78
|
|
|
CreditCard::DINERS_CLUB_INTERNATIONAL, |
79
|
|
|
CreditCard::DISCOVER, |
80
|
|
|
CreditCard::JCB, |
81
|
|
|
CreditCard::LASER, |
82
|
|
|
CreditCard::MAESTRO, |
83
|
|
|
CreditCard::MASTER_CARD, |
84
|
|
|
CreditCard::SOLO, |
85
|
|
|
CreditCard::SWITCH_TYPE, |
86
|
|
|
CreditCard::VISA, |
87
|
|
|
CreditCard::UNKNOWN |
88
|
|
|
]); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
public static function creditCardCustomerLocation() |
92
|
|
|
{ |
93
|
|
|
return new MultipleValueNode('credit_card_customer_location', [ |
94
|
|
|
CreditCard::INTERNATIONAL, |
95
|
|
|
CreditCard::US |
96
|
|
|
]); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public static function source() |
100
|
|
|
{ |
101
|
|
|
return new MultipleValueNode('source', []); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
public static function status() |
105
|
|
|
{ |
106
|
|
|
return new MultipleValueNode('status', [ |
107
|
|
|
Transaction::AUTHORIZATION_EXPIRED, |
108
|
|
|
Transaction::AUTHORIZING, |
109
|
|
|
Transaction::AUTHORIZED, |
110
|
|
|
Transaction::GATEWAY_REJECTED, |
111
|
|
|
Transaction::FAILED, |
112
|
|
|
Transaction::PROCESSOR_DECLINED, |
113
|
|
|
Transaction::SETTLED, |
114
|
|
|
Transaction::SETTLING, |
115
|
|
|
Transaction::SUBMITTED_FOR_SETTLEMENT, |
116
|
|
|
Transaction::VOIDED, |
117
|
|
|
Transaction::SETTLEMENT_DECLINED, |
118
|
|
|
Transaction::SETTLEMENT_PENDING |
119
|
|
|
]); |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
public static function type() |
123
|
|
|
{ |
124
|
|
|
return new MultipleValueNode('type', [ |
125
|
|
|
Transaction::SALE, |
126
|
|
|
Transaction::CREDIT |
127
|
|
|
]); |
128
|
|
|
} |
129
|
|
|
} |
130
|
|
|
class_alias('Braintree\TransactionSearch', 'Braintree_TransactionSearch'); |
131
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.