Class: Brainshell::Commands::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/brainshell/commands/transaction.rb

Constant Summary

Constants included from ValueFormatter

ValueFormatter::KNOWN_FORMAT_METHODS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

define_query_options

Methods included from ValueFormatter

#format_value

Class Method Details

.multiple_search_fieldsObject



18
19
20
21
# File 'lib/brainshell/commands/transaction.rb', line 18

def multiple_search_fields
  %w(created_using credit_card_card_type credit_card_customer_location ids merchant_account_id
payment_instrument_type refund settled_at source status type user).freeze
end

.range_search_fieldsObject



23
24
25
26
# File 'lib/brainshell/commands/transaction.rb', line 23

def range_search_fields
  %w(amount authorization_expired_at authorized_at created_at dispute_date failed_at
gateway_rejected_at processor_declined_at submitted_for_settlement_at voided_at).freeze
end

.text_search_fieldsObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/brainshell/commands/transaction.rb', line 7

def text_search_fields
  %w(billing_company billing_country_name billing_extended_address billing_first_name
billing_last_name billing_locality billing_postal_code billing_region billing_street_address
credit_card_cardholder_name credit_card_expiration_date credit_card_number credit_card_unique_identifier
currency customer_company customer_email customer_fax customer_first_name customer_id customer_last_name
customer_phone customer_website id order_id payment_method_token paypal_authorization_id paypal_payer_email
paypal_payment_id processor_authorization_code settlement_batch_id shipping_company shipping_country_name
shipping_extended_address shipping_first_name shipping_last_name shipping_locality shipping_postal_code
shipping_region shipping_street_address).freeze
end

Instance Method Details

#disbursement_details(token) ⇒ Object



44
45
46
47
48
# File 'lib/brainshell/commands/transaction.rb', line 44

def disbursement_details(token)
  transaction = Braintree::Transaction.find(token)

  build_table([transaction.disbursement_details], [:disbursement_date, :funds_held?, :settlement_amount, :success])
end

#find(token) ⇒ Object



31
32
33
34
35
# File 'lib/brainshell/commands/transaction.rb', line 31

def find(token)
  transaction = Braintree::Transaction.find(token)

  build_table([transaction])
end

#queryObject



39
40
41
# File 'lib/brainshell/commands/transaction.rb', line 39

def query
  run_query Braintree::Transaction
end