Class: SixSaferpay::SixTransaction::MultipartCaptureResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_header:, capture_id: nil, status:, date:) ⇒ MultipartCaptureResponse

Returns a new instance of MultipartCaptureResponse.



11
12
13
14
15
16
17
18
19
# File 'lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb', line 11

def initialize(response_header: ,
              capture_id: nil,
              status: ,
              date: )
  @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
  @capture_id = capture_id
  @status = status
  @date = date
end

Instance Attribute Details

#capture_idObject

Returns the value of attribute capture_id.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb', line 5

def capture_id
  @capture_id
end

#dateObject

Returns the value of attribute date.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb', line 5

def date
  @date
end

#response_headerObject

Returns the value of attribute response_header.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb', line 5

def response_header
  @response_header
end

#statusObject

Returns the value of attribute status.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb', line 5

def status
  @status
end

Instance Method Details

#to_hashObject Also known as: to_h



21
22
23
24
25
26
27
28
# File 'lib/six_saferpay/api/six_transaction/responses/multipart_capture_response.rb', line 21

def to_hash
  hash = Hash.new
  hash.merge!(response_header: @response_header.to_h) if @response_header
  hash.merge!(capture_id: @capture_id) if @capture_id
  hash.merge!(status: @status) if @status
  hash.merge!(date: @date) if @date
  hash
end