Class: SixSaferpay::SixTransaction::AssertCaptureResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_header:, transaction_id:, order_id: nil, status:, date:) ⇒ AssertCaptureResponse

Returns a new instance of AssertCaptureResponse.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/six_saferpay/api/six_transaction/responses/assert_capture_response.rb', line 12

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

Instance Attribute Details

#dateObject

Returns the value of attribute date.



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

def date
  @date
end

#order_idObject

Returns the value of attribute order_id.



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

def order_id
  @order_id
end

#response_headerObject

Returns the value of attribute response_header.



5
6
7
# File 'lib/six_saferpay/api/six_transaction/responses/assert_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/assert_capture_response.rb', line 5

def status
  @status
end

#transaction_idObject

Returns the value of attribute transaction_id.



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

def transaction_id
  @transaction_id
end

Instance Method Details

#to_hashObject Also known as: to_h



24
25
26
27
28
29
30
31
32
# File 'lib/six_saferpay/api/six_transaction/responses/assert_capture_response.rb', line 24

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