Class: PaypalServerSdk::CardAttributes

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

Overview

Additional attributes associated with the use of this card.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(customer: SKIP, vault: SKIP, verification: SKIP) ⇒ CardAttributes

Returns a new instance of CardAttributes.



49
50
51
52
53
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 49

def initialize(customer: SKIP, vault: SKIP, verification: SKIP)
  @customer = customer unless customer == SKIP
  @vault = vault unless vault == SKIP
  @verification = verification unless verification == SKIP
end

Instance Attribute Details

#customerCardCustomerInformation

The details about a customer in PayPal’s system of record.



14
15
16
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 14

def customer
  @customer
end

#vaultVaultInstructionBase

Basic vault instruction specification that can be extended by specific payment sources that supports vaulting.



19
20
21
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 19

def vault
  @vault
end

#verificationCardVerification

The API caller can opt in to verify the card through PayPal offered verification services (e.g. Smart Dollar Auth, 3DS).

Returns:



24
25
26
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 24

def verification
  @verification
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 56

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer = CardCustomerInformation.from_hash(hash['customer']) if hash['customer']
  vault = VaultInstructionBase.from_hash(hash['vault']) if hash['vault']
  verification = CardVerification.from_hash(hash['verification']) if hash['verification']

  # Create object from extracted values.
  CardAttributes.new(customer: customer,
                     vault: vault,
                     verification: verification)
end

.namesObject

A mapping from model property names to API property names.



27
28
29
30
31
32
33
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 27

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer'] = 'customer'
  @_hash['vault'] = 'vault'
  @_hash['verification'] = 'verification'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



36
37
38
39
40
41
42
# File 'lib/paypal_server_sdk/models/card_attributes.rb', line 36

def self.optionals
  %w[
    customer
    vault
    verification
  ]
end