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