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.



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

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

#avs_error_response_codeObject (readonly)

Returns the value of attribute avs_error_response_code.



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

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.



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

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.



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

def avs_street_address_response_code
  @avs_street_address_response_code
end

#billingObject (readonly)

Returns the value of attribute billing.



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

def billing
  @billing
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#credit_cardObject (readonly)

Returns the value of attribute credit_card.



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

def credit_card
  @credit_card
end

#currency_iso_codeObject (readonly)

Returns the value of attribute currency_iso_code.



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

def currency_iso_code
  @currency_iso_code
end

#cvv_response_codeObject (readonly)

Returns the value of attribute cvv_response_code.



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

def cvv_response_code
  @cvv_response_code
end

#gateway_rejection_reasonObject (readonly)

Returns the value of attribute gateway_rejection_reason.



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

def gateway_rejection_reason
  @gateway_rejection_reason
end

#graphql_idObject (readonly)

Returns the value of attribute graphql_id.



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

def graphql_id
  @graphql_id
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#merchant_account_idObject (readonly)

Returns the value of attribute merchant_account_id.



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

def 
  @merchant_account_id
end

#network_response_codeObject (readonly)

Returns the value of attribute network_response_code.



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

def network_response_code
  @network_response_code
end

#network_response_textObject (readonly)

Returns the value of attribute network_response_text.



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

def network_response_text
  @network_response_text
end

#network_transaction_idObject (readonly)

Returns the value of attribute network_transaction_id.



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

def network_transaction_id
  @network_transaction_id
end

#processor_response_codeObject (readonly)

Returns the value of attribute processor_response_code.



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

def processor_response_code
  @processor_response_code
end

#processor_response_textObject (readonly)

Returns the value of attribute processor_response_text.



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

def processor_response_text
  @processor_response_text
end

#processor_response_typeObject (readonly)

Returns the value of attribute processor_response_type.



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

def processor_response_type
  @processor_response_type
end

#risk_dataObject (readonly)

Returns the value of attribute risk_data.



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

def risk_data
  @risk_data
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#three_d_secure_infoObject (readonly)

Returns the value of attribute three_d_secure_info.



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

def three_d_secure_info
  @three_d_secure_info
end

Class Method Details

._new(*args) ⇒ Object



94
95
96
# File 'lib/braintree/credit_card_verification.rb', line 94

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

.create(attributes) ⇒ Object



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

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

.find(*args) ⇒ Object



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

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

.search(&block) ⇒ Object



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

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

Instance Method Details

#inspectObject



60
61
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
# File 'lib/braintree/credit_card_verification.rb', line 60

def inspect
  attr_order = [
    :status,
    :processor_response_code,
    :processor_response_text,
    :amount,
    :currency_iso_code,
    :cvv_response_code,
    :avs_error_response_code,
    :avs_postal_code_response_code,
    :avs_street_address_response_code,
    :network_response_code,
    :network_response_text,
    :merchant_account_id,
    :gateway_rejection_reason,
    :id,
    :credit_card,
    :billing,
    :created_at
  ]
  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