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.



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

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

#apple_payObject (readonly)

Returns the value of attribute apple_pay.



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

def apple_pay
  @apple_pay
end

#avs_error_response_codeObject (readonly)

Returns the value of attribute avs_error_response_code.



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

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.



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

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.



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

def avs_street_address_response_code
  @avs_street_address_response_code
end

#billingObject (readonly)

Returns the value of attribute billing.



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

def billing
  @billing
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#credit_cardObject (readonly)

Returns the value of attribute credit_card.



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

def credit_card
  @credit_card
end

#currency_iso_codeObject (readonly)

Returns the value of attribute currency_iso_code.



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

def currency_iso_code
  @currency_iso_code
end

#cvv_response_codeObject (readonly)

Returns the value of attribute cvv_response_code.



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

def cvv_response_code
  @cvv_response_code
end

#gateway_rejection_reasonObject (readonly)

Returns the value of attribute gateway_rejection_reason.



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

def gateway_rejection_reason
  @gateway_rejection_reason
end

#graphql_idObject (readonly)

Returns the value of attribute graphql_id.



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

def graphql_id
  @graphql_id
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Returns the value of attribute mastercard_transaction_link_id.



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

def mastercard_transaction_link_id
  @mastercard_transaction_link_id
end

#merchant_account_idObject (readonly)

Returns the value of attribute merchant_account_id.



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

def 
  @merchant_account_id
end

#network_response_codeObject (readonly)

Returns the value of attribute network_response_code.



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

def network_response_code
  @network_response_code
end

#network_response_textObject (readonly)

Returns the value of attribute network_response_text.



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

def network_response_text
  @network_response_text
end

#network_transaction_idObject (readonly)

Returns the value of attribute network_transaction_id.



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

def network_transaction_id
  @network_transaction_id
end

#processor_response_codeObject (readonly)

Returns the value of attribute processor_response_code.



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

def processor_response_code
  @processor_response_code
end

#processor_response_textObject (readonly)

Returns the value of attribute processor_response_text.



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

def processor_response_text
  @processor_response_text
end

#processor_response_typeObject (readonly)

Returns the value of attribute processor_response_type.



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

def processor_response_type
  @processor_response_type
end

#risk_dataObject (readonly)

Returns the value of attribute risk_data.



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

def risk_data
  @risk_data
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#three_d_secure_infoObject (readonly)

Returns the value of attribute three_d_secure_info.



53
54
55
# File 'lib/braintree/credit_card_verification.rb', line 53

def three_d_secure_info
  @three_d_secure_info
end

Class Method Details

._new(*args) ⇒ Object



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

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

.create(attributes) ⇒ Object



113
114
115
116
# File 'lib/braintree/credit_card_verification.rb', line 113

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

.find(*args) ⇒ Object



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

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

.search(&block) ⇒ Object



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

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

Instance Method Details

#inspectObject



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
93
94
95
# File 'lib/braintree/credit_card_verification.rb', line 64

def inspect
  attr_order = [
    :amount,
    :ani_first_name_response_code,
    :ani_last_name_response_code,
    :apple_pay,
    :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