Class: SixSaferpay::Marketplace
- Inherits:
-
Object
- Object
- SixSaferpay::Marketplace
- Defined in:
- lib/six_saferpay/models/marketplace.rb
Instance Attribute Summary collapse
-
#fee ⇒ Object
Returns the value of attribute fee.
-
#fee_refund ⇒ Object
Returns the value of attribute fee_refund.
-
#submerchant_id ⇒ Object
Returns the value of attribute submerchant_id.
Instance Method Summary collapse
-
#initialize(submerchant_id:, fee:, fee_refund:) ⇒ Marketplace
constructor
A new instance of Marketplace.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(submerchant_id:, fee:, fee_refund:) ⇒ Marketplace
Returns a new instance of Marketplace.
6 7 8 9 10 |
# File 'lib/six_saferpay/models/marketplace.rb', line 6 def initialize(submerchant_id: , fee: , fee_refund: ) @submerchant_id = submerchant_id @fee = SixSaferpay::Fee.new(**fee.to_h) if fee @fee_refund = SixSaferpay::FeeRefund.new(**fee_refund.to_h) if fee_refund end |
Instance Attribute Details
#fee ⇒ Object
Returns the value of attribute fee.
4 5 6 |
# File 'lib/six_saferpay/models/marketplace.rb', line 4 def fee @fee end |
#fee_refund ⇒ Object
Returns the value of attribute fee_refund.
4 5 6 |
# File 'lib/six_saferpay/models/marketplace.rb', line 4 def fee_refund @fee_refund end |
#submerchant_id ⇒ Object
Returns the value of attribute submerchant_id.
4 5 6 |
# File 'lib/six_saferpay/models/marketplace.rb', line 4 def submerchant_id @submerchant_id end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
12 13 14 15 16 17 18 |
# File 'lib/six_saferpay/models/marketplace.rb', line 12 def to_hash hash = Hash.new hash.merge!(submerchant_id: @submerchant_id) if @submerchant_id hash.merge!(fee: @fee.to_h) if @fee hash.merge!(fee_refund: @fee_refund.to_h) if @fee_refund hash end |