Class: PaypalServerSdk::CobrandedCard
- Defined in:
- lib/paypal_server_sdk/models/cobranded_card.rb
Overview
Details about the merchant cobranded card used for order purchase.
Instance Attribute Summary collapse
-
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
-
#labels ⇒ Array[String]
Array of labels for the cobranded card.
-
#payee ⇒ PayeeBase
The details for the merchant who receives the funds and fulfills the order.
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(labels: SKIP, payee: SKIP, amount: SKIP) ⇒ CobrandedCard
constructor
A new instance of CobrandedCard.
Methods inherited from BaseModel
Constructor Details
#initialize(labels: SKIP, payee: SKIP, amount: SKIP) ⇒ CobrandedCard
Returns a new instance of CobrandedCard.
49 50 51 52 53 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 49 def initialize(labels: SKIP, payee: SKIP, amount: SKIP) @labels = labels unless labels == SKIP @payee = payee unless payee == SKIP @amount = amount unless amount == SKIP end |
Instance Attribute Details
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
24 25 26 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 24 def amount @amount end |
#labels ⇒ Array[String]
Array of labels for the cobranded card.
14 15 16 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 14 def labels @labels end |
#payee ⇒ PayeeBase
The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee.
19 20 21 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 19 def payee @payee 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/cobranded_card.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. labels = hash.key?('labels') ? hash['labels'] : SKIP payee = PayeeBase.from_hash(hash['payee']) if hash['payee'] amount = Money.from_hash(hash['amount']) if hash['amount'] # Create object from extracted values. CobrandedCard.new(labels: labels, payee: payee, amount: amount) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['labels'] = 'labels' @_hash['payee'] = 'payee' @_hash['amount'] = 'amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 41 42 |
# File 'lib/paypal_server_sdk/models/cobranded_card.rb', line 36 def self.optionals %w[ labels payee amount ] end |