Class: SixSaferpay::RiskFactors

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delivery_type: nil, payer_profile: nil, is_b2b: nil) ⇒ RiskFactors

Returns a new instance of RiskFactors.



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

def initialize(
  delivery_type: nil,
  payer_profile: nil,
  is_b2b: nil
  )
  @delivery_type = delivery_type

  if payer_profile
    @payer_profile = SixSaferpay::PayerProfile.new(**payer_profile.to_h)
  end
  @is_b2b = is_b2b
end

Instance Attribute Details

#delivery_typeObject

Returns the value of attribute delivery_type.



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

def delivery_type
  @delivery_type
end

#payer_profileObject

Returns the value of attribute payer_profile.



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

def payer_profile
  @payer_profile
end

Instance Method Details

#to_hashObject Also known as: to_h



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/six_saferpay/models/risk_factors.rb', line 23

def to_hash
  hash = Hash.new
  if @delivery_type
    hash.merge!(delivery_type: @delivery_type)
  end
  if @payer_profile
    hash.merge!(payer_profile: @payer_profile.to_h)
  end
  if !@is_b2b.nil?
    hash.merge!(is_b2b: @is_b2b)
  end
  hash
end