class SixSaferpay::SixTransaction::InitializeResponse

Attributes

expiration[RW]
liability_shift[RW]
redirect[RW]
redirect_required[RW]
response_header[RW]
token[RW]

Public Class Methods

new(response_header:, token:, expiration:, liability_shift: nil, redirect_required:, redirect: ) click to toggle source
# 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

Public Instance Methods

to_h()
Alias for: to_hash
to_hash() click to toggle source
# 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
Also aliased as: to_h