Class: PaypalServerSdk::CardVerificationDetails

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/card_verification_details.rb

Overview

Card Verification details including the authorization details and 3D SECURE details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(network_transaction_id: SKIP, date: SKIP, network: SKIP, time: SKIP, amount: SKIP, processor_response: SKIP, three_d_secure: SKIP) ⇒ CardVerificationDetails

Returns a new instance of CardVerificationDetails.



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 84

def initialize(network_transaction_id: SKIP, date: SKIP, network: SKIP,
               time: SKIP, amount: SKIP, processor_response: SKIP,
               three_d_secure: SKIP)
  @network_transaction_id = network_transaction_id unless network_transaction_id == SKIP
  @date = date unless date == SKIP
  @network = network unless network == SKIP
  @time = time unless time == SKIP
  @amount = amount unless amount == SKIP
  @processor_response = processor_response unless processor_response == SKIP
  @three_d_secure = three_d_secure unless three_d_secure == SKIP
end

Instance Attribute Details

#amountMoney

The currency and amount for a financial transaction, such as a balance or payment due.

Returns:



40
41
42
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 40

def amount
  @amount
end

#dateString

DEPRECATED. This field is DEPRECATED. Please find the date data in the ‘date’ field under the ‘network_transaction_reference’ object instead of the ‘verification’ object.

Returns:

  • (String)


23
24
25
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 23

def date
  @date
end

#networkCardBrand

The card network or brand. Applies to credit, debit, gift, and payment cards.

Returns:



28
29
30
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 28

def network
  @network
end

#network_transaction_idString

DEPRECATED. This field is DEPRECATED. Please find the network transaction id data in the ‘id’ field under the ‘network_transaction_reference’ object instead of the ‘verification’ object.

Returns:

  • (String)


17
18
19
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 17

def network_transaction_id
  @network_transaction_id
end

#processor_responseCardVerificationProcessorResponse

The processor response information for payment requests, such as direct credit card transactions.



45
46
47
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 45

def processor_response
  @processor_response
end

#three_d_secureObject

DEPRECATED. This field is DEPRECATED. Please find the 3D secure authentication data in the ‘three_d_secure’ object under the ‘authentication_result’ object instead of the ‘verification’ object.

Returns:

  • (Object)


51
52
53
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 51

def three_d_secure
  @three_d_secure
end

#timeString

The date and time, in [Internet date and time format](tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

Returns:

  • (String)


35
36
37
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 35

def time
  @time
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 97

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  network_transaction_id =
    hash.key?('network_transaction_id') ? hash['network_transaction_id'] : SKIP
  date = hash.key?('date') ? hash['date'] : SKIP
  network = hash.key?('network') ? hash['network'] : SKIP
  time = hash.key?('time') ? hash['time'] : SKIP
  amount = Money.from_hash(hash['amount']) if hash['amount']
  if hash['processor_response']
    processor_response = CardVerificationProcessorResponse.from_hash(hash['processor_response'])
  end
  three_d_secure =
    hash.key?('three_d_secure') ? hash['three_d_secure'] : SKIP

  # Create object from extracted values.
  CardVerificationDetails.new(network_transaction_id: network_transaction_id,
                              date: date,
                              network: network,
                              time: time,
                              amount: amount,
                              processor_response: processor_response,
                              three_d_secure: three_d_secure)
end

.namesObject

A mapping from model property names to API property names.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 54

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['network_transaction_id'] = 'network_transaction_id'
  @_hash['date'] = 'date'
  @_hash['network'] = 'network'
  @_hash['time'] = 'time'
  @_hash['amount'] = 'amount'
  @_hash['processor_response'] = 'processor_response'
  @_hash['three_d_secure'] = 'three_d_secure'
  @_hash
end

.nullablesObject

An array for nullable fields



80
81
82
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 80

def self.nullables
  []
end

.optionalsObject

An array for optional fields



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 67

def self.optionals
  %w[
    network_transaction_id
    date
    network
    time
    amount
    processor_response
    three_d_secure
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



132
133
134
135
136
137
138
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 132

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} network_transaction_id: #{@network_transaction_id.inspect}, date:"\
  " #{@date.inspect}, network: #{@network.inspect}, time: #{@time.inspect}, amount:"\
  " #{@amount.inspect}, processor_response: #{@processor_response.inspect}, three_d_secure:"\
  " #{@three_d_secure.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



124
125
126
127
128
129
# File 'lib/paypal_server_sdk/models/card_verification_details.rb', line 124

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} network_transaction_id: #{@network_transaction_id}, date: #{@date},"\
  " network: #{@network}, time: #{@time}, amount: #{@amount}, processor_response:"\
  " #{@processor_response}, three_d_secure: #{@three_d_secure}>"
end