Class: SixSaferpay::SixTransaction::InitializeResponse
- Inherits:
-
Object
- Object
- SixSaferpay::SixTransaction::InitializeResponse
- Defined in:
- lib/six_saferpay/api/six_transaction/responses/initialize_response.rb
Instance Attribute Summary collapse
-
#expiration ⇒ Object
Returns the value of attribute expiration.
-
#liability_shift ⇒ Object
Returns the value of attribute liability_shift.
-
#redirect ⇒ Object
Returns the value of attribute redirect.
-
#redirect_required ⇒ Object
Returns the value of attribute redirect_required.
-
#response_header ⇒ Object
Returns the value of attribute response_header.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(response_header:, token:, expiration:, liability_shift: nil, redirect_required:, redirect:) ⇒ InitializeResponse
constructor
A new instance of InitializeResponse.
- #to_hash ⇒ Object (also: #to_h)
Constructor Details
#initialize(response_header:, token:, expiration:, liability_shift: nil, redirect_required:, redirect:) ⇒ InitializeResponse
Returns a new instance of InitializeResponse.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 13 def initialize(response_header:, token:, expiration:, liability_shift: nil, redirect_required:, redirect: ) @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header @token = token @expiration = expiration @liability_shift = liability_shift @redirect_required = redirect_required @redirect = SixSaferpay::Redirect.new(**redirect.to_h) if redirect end |
Instance Attribute Details
#expiration ⇒ Object
Returns the value of attribute expiration.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 5 def expiration @expiration end |
#liability_shift ⇒ Object
Returns the value of attribute liability_shift.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 5 def liability_shift @liability_shift end |
#redirect ⇒ Object
Returns the value of attribute redirect.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 5 def redirect @redirect end |
#redirect_required ⇒ Object
Returns the value of attribute redirect_required.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 5 def redirect_required @redirect_required end |
#response_header ⇒ Object
Returns the value of attribute response_header.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 5 def response_header @response_header end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 5 def token @token end |
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/six_saferpay/api/six_transaction/responses/initialize_response.rb', line 27 def to_hash hash = Hash.new hash.merge!(response_header: @response_header.to_h) if @response_header hash.merge!(token: @token) if @token hash.merge!(expiration: @expiration) if @expiration hash.merge!(liability_shift: @liability_shift) if !@liability_shift.nil? hash.merge!(redirect_required: @redirect_required) if !@redirect_required.nil? hash.merge!(redirect: @redirect.to_h) if @redirect hash end |