Class: SixSaferpay::SixBatch::Close

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/api/six_batch/requests/close.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_header: nil, terminal_id:) ⇒ Close

Returns a new instance of Close.



9
10
11
12
13
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 9

def initialize(request_header: nil,
               terminal_id: )
  @request_header = request_header || SixSaferpay::RequestHeader.new()
  @terminal_id = terminal_id
end

Instance Attribute Details

#request_headerObject

Returns the value of attribute request_header.



5
6
7
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 5

def request_header
  @request_header
end

#terminal_idObject

Returns the value of attribute terminal_id.



5
6
7
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 5

def terminal_id
  @terminal_id
end

Instance Method Details

#response_classObject



31
32
33
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 31

def response_class
  SixSaferpay::SixBatch::CloseResponse
end

#to_hashObject Also known as: to_h



15
16
17
18
19
20
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 15

def to_hash
  hash = Hash.new
  hash.merge!(request_header: @request_header.to_h) if @request_header
  hash.merge!(terminal_id: @terminal_id) if @terminal_id
  hash
end

#to_jsonObject



23
24
25
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 23

def to_json
  to_hash.to_json
end

#urlObject



27
28
29
# File 'lib/six_saferpay/api/six_batch/requests/close.rb', line 27

def url
  '/Payment/v1/Batch/Close'
end