Class: PaypalServerSdk::SupplementaryData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::SupplementaryData
- 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
-
#card ⇒ CardSupplementaryData
Merchants and partners can add Level 2 and 3 data to payments to reduce risk and payment processing costs.
-
#risk ⇒ RiskSupplementaryData
Additional information necessary to evaluate the risk profile of a transaction.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(card: SKIP, risk: SKIP) ⇒ SupplementaryData
constructor
A new instance of SupplementaryData.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(card: SKIP, risk: SKIP) ⇒ SupplementaryData
Returns a new instance of SupplementaryData.
46 47 48 49 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 46 def initialize(card: SKIP, risk: SKIP) @card = card unless card == SKIP @risk = risk unless risk == SKIP end |
Instance Attribute Details
#card ⇒ CardSupplementaryData
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 checkout or multiparty checkout.
18 19 20 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 18 def card @card end |
#risk ⇒ RiskSupplementaryData
Additional information necessary to evaluate the risk profile of a transaction.
23 24 25 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 23 def risk @risk end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card = CardSupplementaryData.from_hash(hash['card']) if hash['card'] risk = RiskSupplementaryData.from_hash(hash['risk']) if hash['risk'] # Create object from extracted values. SupplementaryData.new(card: card, risk: risk) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['risk'] = 'risk' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 34 def self.optionals %w[ card risk ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
71 72 73 74 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 71 def inspect class_name = self.class.name.split('::').last "<#{class_name} card: #{@card.inspect}, risk: #{@risk.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
65 66 67 68 |
# File 'lib/paypal_server_sdk/models/supplementary_data.rb', line 65 def to_s class_name = self.class.name.split('::').last "<#{class_name} card: #{@card}, risk: #{@risk}>" end |