Class: PaypalServerSdk::CardVerificationProcessorResponse

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

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(avs_code: SKIP, cvv_code: SKIP) ⇒ CardVerificationProcessorResponse

Returns a new instance of CardVerificationProcessorResponse.



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

def initialize(avs_code: SKIP, cvv_code: SKIP)
  @avs_code = avs_code unless avs_code == SKIP
  @cvv_code = cvv_code unless cvv_code == SKIP
end

Instance Attribute Details

#avs_codeAVSCode

The address verification code for Visa, Discover, Mastercard, or American Express transactions.

Returns:



16
17
18
# File 'lib/paypal_server_sdk/models/card_verification_processor_response.rb', line 16

def avs_code
  @avs_code
end

#cvv_codeCVVCode

The card verification value code for for Visa, Discover, Mastercard, or American Express.

Returns:



21
22
23
# File 'lib/paypal_server_sdk/models/card_verification_processor_response.rb', line 21

def cvv_code
  @cvv_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/paypal_server_sdk/models/card_verification_processor_response.rb', line 50

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  avs_code = hash.key?('avs_code') ? hash['avs_code'] : SKIP
  cvv_code = hash.key?('cvv_code') ? hash['cvv_code'] : SKIP

  # Create object from extracted values.
  CardVerificationProcessorResponse.new(avs_code: avs_code,
                                        cvv_code: cvv_code)
end

.namesObject

A mapping from model property names to API property names.



24
25
26
27
28
29
# File 'lib/paypal_server_sdk/models/card_verification_processor_response.rb', line 24

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['avs_code'] = 'avs_code'
  @_hash['cvv_code'] = 'cvv_code'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



32
33
34
35
36
37
# File 'lib/paypal_server_sdk/models/card_verification_processor_response.rb', line 32

def self.optionals
  %w[
    avs_code
    cvv_code
  ]
end