Class: PaypalServerSdk::SupplementaryData

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

Overview

Supplementary data about a payment. This object passes information that can be used to improve risk assessments and processing costs, for example, by providing Level 2 and Level 3 payment data.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(card: SKIP) ⇒ SupplementaryData

Returns a new instance of SupplementaryData.



43
44
45
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 43

def initialize(card: SKIP)
  @card = card unless card == SKIP
end

Instance Attribute Details

#cardCardSupplementaryData

Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs. For more information about processing payments, see <a href=“developer.paypal.com/docs/checkout/advanced/processing/”>che ckout</a> or <a href=“developer.paypal.com/docs/multiparty/checkout/advanced/proce ssing/”>multiparty checkout</a>.



22
23
24
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 22

def card
  @card
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



48
49
50
51
52
53
54
55
56
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 48

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  card = CardSupplementaryData.from_hash(hash['card']) if hash['card']

  # Create object from extracted values.
  SupplementaryData.new(card: card)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



39
40
41
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 39

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    card
  ]
end