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

#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.



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

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:



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

def amount
  @amount
end

#dateString

The date that the transaction was authorized by the scheme. This field may not be returned for all networks. MasterCard refers to this field as “BankNet reference date”.

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

Transaction Identifier as given by the network to indicate a previously executed CIT authorization. Only present when authorization is successful for a verification.

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.



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

def processor_response
  @processor_response
end

#three_d_secureObject

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

Returns:

  • (Object)


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

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.<blockquote><strong>Note:</strong> The regular expression provides guidance but does not reject all invalid dates.</blockquote>

Returns:

  • (String)


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

def time
  @time
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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.



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

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



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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