Class: Braintree::CreditCardVerification

Inherits:
Object
  • Object
show all
Includes:
BaseModule, Util::IdEquality
Defined in:
lib/braintree/credit_card_verification.rb

Defined Under Namespace

Modules: GatewayRejectionReason, Status

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::IdEquality

#==

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

#initialize(attributes) ⇒ CreditCardVerification

Returns a new instance of CreditCardVerification.



53
54
55
56
57
58
59
60
# File 'lib/braintree/credit_card_verification.rb', line 53

def initialize(attributes)
  set_instance_variables_from_hash(attributes)

  @amount = Util.to_big_decimal(amount)

  @risk_data = RiskData.new(attributes[:risk_data]) if attributes[:risk_data]
  @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



28
29
30
# File 'lib/braintree/credit_card_verification.rb', line 28

def amount
  @amount
end

#ani_first_name_response_codeObject (readonly)

Returns the value of attribute ani_first_name_response_code.



29
30
31
# File 'lib/braintree/credit_card_verification.rb', line 29

def ani_first_name_response_code
  @ani_first_name_response_code
end

#ani_last_name_response_codeObject (readonly)

Returns the value of attribute ani_last_name_response_code.



30
31
32
# File 'lib/braintree/credit_card_verification.rb', line 30

def ani_last_name_response_code
  @ani_last_name_response_code
end

#avs_error_response_codeObject (readonly)

Returns the value of attribute avs_error_response_code.



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

def avs_error_response_code
  @avs_error_response_code
end

#avs_postal_code_response_codeObject (readonly)

Returns the value of attribute avs_postal_code_response_code.



32
33
34
# File 'lib/braintree/credit_card_verification.rb', line 32

def avs_postal_code_response_code
  @avs_postal_code_response_code
end

#avs_street_address_response_codeObject (readonly)

Returns the value of attribute avs_street_address_response_code.



33
34
35
# File 'lib/braintree/credit_card_verification.rb', line 33

def avs_street_address_response_code
  @avs_street_address_response_code
end

#billingObject (readonly)

Returns the value of attribute billing.



34
35
36
# File 'lib/braintree/credit_card_verification.rb', line 34

def billing
  @billing
end

#created_atObject (readonly)

Returns the value of attribute created_at.



35
36
37
# File 'lib/braintree/credit_card_verification.rb', line 35

def created_at
  @created_at
end

#credit_cardObject (readonly)

Returns the value of attribute credit_card.



36
37
38
# File 'lib/braintree/credit_card_verification.rb', line 36

def credit_card
  @credit_card
end

#currency_iso_codeObject (readonly)

Returns the value of attribute currency_iso_code.



37
38
39
# File 'lib/braintree/credit_card_verification.rb', line 37

def currency_iso_code
  @currency_iso_code
end

#cvv_response_codeObject (readonly)

Returns the value of attribute cvv_response_code.



38
39
40
# File 'lib/braintree/credit_card_verification.rb', line 38

def cvv_response_code
  @cvv_response_code
end

#gateway_rejection_reasonObject (readonly)

Returns the value of attribute gateway_rejection_reason.



39
40
41
# File 'lib/braintree/credit_card_verification.rb', line 39

def gateway_rejection_reason
  @gateway_rejection_reason
end

#graphql_idObject (readonly)

Returns the value of attribute graphql_id.



40
41
42
# File 'lib/braintree/credit_card_verification.rb', line 40

def graphql_id
  @graphql_id
end

#idObject (readonly)

Returns the value of attribute id.



41
42
43
# File 'lib/braintree/credit_card_verification.rb', line 41

def id
  @id
end

#merchant_account_idObject (readonly)

Returns the value of attribute merchant_account_id.



42
43
44
# File 'lib/braintree/credit_card_verification.rb', line 42

def 
  
end

#network_response_codeObject (readonly)

Returns the value of attribute network_response_code.



43
44
45
# File 'lib/braintree/credit_card_verification.rb', line 43

def network_response_code
  @network_response_code
end

#network_response_textObject (readonly)

Returns the value of attribute network_response_text.



44
45
46
# File 'lib/braintree/credit_card_verification.rb', line 44

def network_response_text
  @network_response_text
end

#network_transaction_idObject (readonly)

Returns the value of attribute network_transaction_id.



45
46
47
# File 'lib/braintree/credit_card_verification.rb', line 45

def network_transaction_id
  @network_transaction_id
end

#processor_response_codeObject (readonly)

Returns the value of attribute processor_response_code.



46
47
48
# File 'lib/braintree/credit_card_verification.rb', line 46

def processor_response_code
  @processor_response_code
end

#processor_response_textObject (readonly)

Returns the value of attribute processor_response_text.



47
48
49
# File 'lib/braintree/credit_card_verification.rb', line 47

def processor_response_text
  @processor_response_text
end

#processor_response_typeObject (readonly)

Returns the value of attribute processor_response_type.



48
49
50
# File 'lib/braintree/credit_card_verification.rb', line 48

def processor_response_type
  @processor_response_type
end

#risk_dataObject (readonly)

Returns the value of attribute risk_data.



49
50
51
# File 'lib/braintree/credit_card_verification.rb', line 49

def risk_data
  @risk_data
end

#statusObject (readonly)

Returns the value of attribute status.



50
51
52
# File 'lib/braintree/credit_card_verification.rb', line 50

def status
  @status
end

#three_d_secure_infoObject (readonly)

Returns the value of attribute three_d_secure_info.



51
52
53
# File 'lib/braintree/credit_card_verification.rb', line 51

def three_d_secure_info
  @three_d_secure_info
end

Class Method Details

._new(*args) ⇒ Object



98
99
100
# File 'lib/braintree/credit_card_verification.rb', line 98

def self._new(*args)
  self.new(*args)
end

.create(attributes) ⇒ Object



110
111
112
113
# File 'lib/braintree/credit_card_verification.rb', line 110

def self.create(attributes)
  Util.verify_keys(CreditCardVerificationGateway._create_signature, attributes)
  Configuration.gateway.verification.create(attributes)
end

.find(*args) ⇒ Object



102
103
104
# File 'lib/braintree/credit_card_verification.rb', line 102

def self.find(*args)
  Configuration.gateway.verification.find(*args)
end

.search(&block) ⇒ Object



106
107
108
# File 'lib/braintree/credit_card_verification.rb', line 106

def self.search(&block)
  Configuration.gateway.verification.search(&block)
end

Instance Method Details

#inspectObject



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
87
88
89
90
91
92
# File 'lib/braintree/credit_card_verification.rb', line 62

def inspect
  attr_order = [
    :amount,
    :ani_first_name_response_code,
    :ani_last_name_response_code,
    :avs_error_response_code,
    :avs_postal_code_response_code,
    :avs_street_address_response_code,
    :billing,
    :created_at,
    :credit_card,
    :currency_iso_code,
    :cvv_response_code,
    :gateway_rejection_reason,
    :id,
    :merchant_account_id,
    :network_response_code,
    :network_response_text,
    :processor_response_code,
    :processor_response_text,
    :status
  ]
  formatted_attrs = attr_order.map do |attr|
    if attr == :amount
      Util.inspect_amount(self.amount)
    else
      "#{attr}: #{send(attr).inspect}"
    end
  end
  "#<#{self.class} #{formatted_attrs.join(", ")}>"
end