Class: ActiveMerchant::Billing::NetworkTokenizationCreditCard

Inherits:
CreditCard
  • Object
show all
Defined in:
lib/active_merchant/billing/network_tokenization_credit_card.rb

Constant Summary collapse

SOURCES =
%i(apple_pay android_pay google_pay network_token)

Constants inherited from CreditCard

CreditCard::BRANDS_WITH_SPACES_IN_NUMBER, CreditCard::READ_METHOD_DESCRIPTIONS

Constants included from CreditCardMethods

CreditCardMethods::ALELO_RANGES, CreditCardMethods::CABAL_RANGES, CreditCardMethods::CARD_COMPANY_DETECTORS, CreditCardMethods::CARNET_BINS, CreditCardMethods::CARNET_RANGES, CreditCardMethods::CARTES_BANCAIRES_RANGES, CreditCardMethods::ELECTRON_RANGES, CreditCardMethods::ELO_RANGES, CreditCardMethods::HIPERCARD_RANGES, CreditCardMethods::JCB_RANGES, CreditCardMethods::MADA_RANGES, CreditCardMethods::MAESTRO_BINS, CreditCardMethods::MAESTRO_RANGES, CreditCardMethods::MASTERCARD_RANGES, CreditCardMethods::NARANJA_RANGES, CreditCardMethods::PANAL_RANGES, CreditCardMethods::SODEXO_BINS, CreditCardMethods::SODEXO_NO_LUHN, CreditCardMethods::UNIONPAY_RANGES, CreditCardMethods::VERVE_RANGES

Instance Attribute Summary collapse

Attributes inherited from CreditCard

#encrypted_pin_cryptogram, #encrypted_pin_ksn, #first_name, #icc_data, #last_name, #manual_entry, #month, #number, #read_method, #track_data, #verification_value, #year

Instance Method Summary collapse

Methods inherited from CreditCard

#allow_spaces_in_card?, #brand, #brand=, #display_number, #emv?, #expired?, #expiry_date, #first_digits, #first_name?, #last_digits, #last_name?, #name, #name=, #name?, #require_verification_value=, requires_name?, #requires_verification_value?, requires_verification_value?, #type=, #validate, #verification_value?

Methods included from CreditCardMethods

#card_verification_value_length, #electron?, in_bin_range?, included, #valid_card_verification_value?, #valid_expiry_year?, #valid_issue_number?, #valid_month?, #valid_start_year?

Methods inherited from Model

#initialize, #validate

Methods included from Compatibility::Model

#errors, #valid?

Methods included from Rails::Model

#valid?

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Model

Instance Attribute Details

#eciObject

Returns the value of attribute eci.



17
18
19
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 17

def eci
  @eci
end

#metadataObject

Returns the value of attribute metadata.



17
18
19
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 17

def 
  @metadata
end

#payment_cryptogramObject

Returns the value of attribute payment_cryptogram.



17
18
19
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 17

def payment_cryptogram
  @payment_cryptogram
end

#payment_dataObject

Returns the value of attribute payment_data.



17
18
19
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 17

def payment_data
  @payment_data
end

#sourceObject



22
23
24
25
26
27
28
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 22

def source
  if defined?(@source) && SOURCES.include?(@source)
    @source
  else
    :apple_pay
  end
end

#transaction_idObject

Returns the value of attribute transaction_id.



17
18
19
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 17

def transaction_id
  @transaction_id
end

Instance Method Details

#credit_card?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 30

def credit_card?
  true
end

#encrypted_wallet?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 42

def encrypted_wallet?
  payment_data.present?
end

#mobile_wallet?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 38

def mobile_wallet?
  %i[apple_pay android_pay google_pay].include?(source)
end

#network_token?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 34

def network_token?
  source == :network_token
end

#typeObject



46
47
48
# File 'lib/active_merchant/billing/network_tokenization_credit_card.rb', line 46

def type
  'network_tokenization'
end