Class: SixSaferpay::Options

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pre_auth: nil, allow_partial_authorization: nil) ⇒ Options

Returns a new instance of Options.



9
10
11
12
13
14
15
# File 'lib/six_saferpay/models/options.rb', line 9

def initialize(
  pre_auth: nil,
  allow_partial_authorization: nil
  )
  @pre_auth = pre_auth
  @allow_partial_authorization = allow_partial_authorization
end

Instance Attribute Details

#pre_authObject

Returns the value of attribute pre_auth.



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

def pre_auth
  @pre_auth
end

Instance Method Details

#to_hashObject Also known as: to_h



17
18
19
20
21
22
23
24
25
26
# File 'lib/six_saferpay/models/options.rb', line 17

def to_hash
  hash = Hash.new
  if !@pre_auth.nil?
    hash.merge!(pre_auth: @pre_auth)
  end
  if !@allow_partial_authorization.nil?
    hash.merge!(allow_partial_authorization: @allow_partial_authorization)
  end
  hash
end