Class: PaypalServerSdk::PlatformFee
- Defined in:
- lib/paypal_server_sdk/models/platform_fee.rb
Overview
The platform or partner fee, commission, or brokerage fee that is associated with the transaction. Not a separate or isolated transaction leg from the external perspective. The platform fee is limited in scope and is always associated with the original payment for the purchase unit.
Instance Attribute Summary collapse
-
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
-
#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(amount:, payee: SKIP) ⇒ PlatformFee
constructor
A new instance of PlatformFee.
Methods inherited from BaseModel
Constructor Details
#initialize(amount:, payee: SKIP) ⇒ PlatformFee
Returns a new instance of PlatformFee.
45 46 47 48 |
# File 'lib/paypal_server_sdk/models/platform_fee.rb', line 45 def initialize(amount:, payee: SKIP) @amount = amount @payee = payee unless payee == SKIP end |
Instance Attribute Details
#amount ⇒ Money
The currency and amount for a financial transaction, such as a balance or payment due.
18 19 20 |
# File 'lib/paypal_server_sdk/models/platform_fee.rb', line 18 def amount @amount end |
#payee ⇒ PayeeBase
The details for the merchant who receives the funds and fulfills the order. The merchant is also known as the payee.
23 24 25 |
# File 'lib/paypal_server_sdk/models/platform_fee.rb', line 23 def payee @payee end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/paypal_server_sdk/models/platform_fee.rb', line 51 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = Money.from_hash(hash['amount']) if hash['amount'] payee = PayeeBase.from_hash(hash['payee']) if hash['payee'] # Create object from extracted values. PlatformFee.new(amount: amount, payee: payee) 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/platform_fee.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['payee'] = 'payee' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/paypal_server_sdk/models/platform_fee.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/paypal_server_sdk/models/platform_fee.rb', line 34 def self.optionals %w[ payee ] end |