Class: SixSaferpay::SixTransaction::CaptureResponse
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::CaptureResponse
- Defined in:
- lib/six_saferpay/api/six_transaction/responses/capture_response.rb
Instance Attribute Summary collapse
-
#capture_id ⇒ Object
Returns the value of attribute capture_id.
-
#date ⇒ Object
Returns the value of attribute date.
-
#invoice ⇒ Object
Returns the value of attribute invoice.
-
#response_header ⇒ Object
Returns the value of attribute response_header.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response_header:, capture_id: nil, status:, date:, invoice: nil) ⇒ CaptureResponse
constructor
A new instance of CaptureResponse.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(response_header:, capture_id: nil, status:, date:, invoice: nil) ⇒ CaptureResponse
Returns a new instance of CaptureResponse.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 12 def initialize(response_header: , capture_id: nil, status: , date: , invoice: nil) @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header @capture_id = capture_id @status = status @date = date @invoice = SixSaferpay::Invoice.new(**invoice.to_h) if invoice end |
Instance Attribute Details
#capture_id ⇒ Object
Returns the value of attribute capture_id.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 5 def capture_id @capture_id end |
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 5 def date @date end |
#invoice ⇒ Object
Returns the value of attribute invoice.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 5 def invoice @invoice end |
#response_header ⇒ Object
Returns the value of attribute response_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 5 def response_header @response_header end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 5 def status @status end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
24 25 26 27 28 29 30 31 32 |
# File 'lib/six_saferpay/api/six_transaction/responses/capture_response.rb', line 24 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.merge!(invoice: @invoice.to_h) if @invoice hash end |