Class: Braintree::Transaction::CreditCardDetails

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/transaction/credit_card_details.rb

Overview

:nodoc:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from BaseModule

included

Methods included from BaseModule::Methods

#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class

Constructor Details

- (CreditCardDetails) initialize(attributes)



10
11
12
# File 'lib/braintree/transaction/credit_card_details.rb', line 10

def initialize(attributes)
  set_instance_variables_from_hash attributes unless attributes.nil?
end

Instance Attribute Details

- (Object) bin (readonly)

Returns the value of attribute bin



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def bin
  @bin
end

- (Object) card_type (readonly)

Returns the value of attribute card_type



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def card_type
  @card_type
end

- (Object) cardholder_name (readonly)

Returns the value of attribute cardholder_name



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def cardholder_name
  @cardholder_name
end

- (Object) commercial (readonly)

Returns the value of attribute commercial



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def commercial
  @commercial
end

- (Object) country_of_issuance (readonly)

Returns the value of attribute country_of_issuance



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def country_of_issuance
  @country_of_issuance
end

- (Object) customer_location (readonly)

Returns the value of attribute customer_location



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def customer_location
  @customer_location
end

- (Object) debit (readonly)

Returns the value of attribute debit



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def debit
  @debit
end

- (Object) durbin_regulated (readonly)

Returns the value of attribute durbin_regulated



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def durbin_regulated
  @durbin_regulated
end

- (Object) expiration_month (readonly)

Returns the value of attribute expiration_month



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def expiration_month
  @expiration_month
end

- (Object) expiration_year (readonly)

Returns the value of attribute expiration_year



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def expiration_year
  @expiration_year
end

- (Object) healthcare (readonly)

Returns the value of attribute healthcare



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def healthcare
  @healthcare
end

- (Object) issuing_bank (readonly)

Returns the value of attribute issuing_bank



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def issuing_bank
  @issuing_bank
end

- (Object) last_4 (readonly)

Returns the value of attribute last_4



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def last_4
  @last_4
end

- (Object) payroll (readonly)

Returns the value of attribute payroll



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def payroll
  @payroll
end

- (Object) prepaid (readonly)

Returns the value of attribute prepaid



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def prepaid
  @prepaid
end

- (Object) token (readonly)

Returns the value of attribute token



6
7
8
# File 'lib/braintree/transaction/credit_card_details.rb', line 6

def token
  @token
end

Instance Method Details

- (Object) expiration_date



14
15
16
# File 'lib/braintree/transaction/credit_card_details.rb', line 14

def expiration_date
  "#{expiration_month}/#{expiration_year}"
end

- (Object) inspect



18
19
20
21
22
23
24
25
# File 'lib/braintree/transaction/credit_card_details.rb', line 18

def inspect
  attr_order = [:token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
  :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :country_of_issuance, :issuing_bank]
  formatted_attrs = attr_order.map do |attr|
    "#{attr}: #{send(attr).inspect}"
  end
  "#<#{formatted_attrs.join(", ")}>"
end

- (Object) masked_number



27
28
29
# File 'lib/braintree/transaction/credit_card_details.rb', line 27

def masked_number
  "#{bin}******#{last_4}"
end

- (Boolean) venmo_sdk?



31
32
33
# File 'lib/braintree/transaction/credit_card_details.rb', line 31

def venmo_sdk?
  @venmo_sdk
end