Class: SixSaferpay::Liability

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/liability.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(liability_shift:, liable_entity:, three_ds: nil, fraud_free: nil) ⇒ Liability

Returns a new instance of Liability.



10
11
12
13
14
15
16
17
18
19
# File 'lib/six_saferpay/models/liability.rb', line 10

def initialize(liability_shift:,
               liable_entity:,
               three_ds: nil,
               fraud_free: nil
              )
  @liability_shift = liability_shift
  @liable_entity = liable_entity
  @three_ds = SixSaferpay::ThreeDs.new(**three_ds.to_h) if three_ds
  @fraud_free = SixSaferpay::FraudFree.new(**fraud_free.to_h) if fraud_free
end

Instance Attribute Details

#liability_shiftObject

Returns the value of attribute liability_shift.



4
5
6
# File 'lib/six_saferpay/models/liability.rb', line 4

def liability_shift
  @liability_shift
end

#liable_entityObject

Returns the value of attribute liable_entity.



4
5
6
# File 'lib/six_saferpay/models/liability.rb', line 4

def liable_entity
  @liable_entity
end

#three_dsObject

Returns the value of attribute three_ds.



4
5
6
# File 'lib/six_saferpay/models/liability.rb', line 4

def three_ds
  @three_ds
end

Instance Method Details

#to_hashObject Also known as: to_h



21
22
23
24
25
26
27
28
# File 'lib/six_saferpay/models/liability.rb', line 21

def to_hash
  hash = Hash.new
  hash.merge!(liability_shift: @liability_shift)
  hash.merge!(liable_entity: @liable_entity)
  hash.merge!(three_ds: @three_ds.to_h) if @three_ds
  hash.merge!(fraud_free: @fraud_free.to_h) if @fraud_free
  hash
end