Class: SixSaferpay::SixSecureData::InsertResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_header:, token:, expiration:, redirect_required:, redirect:) ⇒ InsertResponse

Returns a new instance of InsertResponse.



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

def initialize(response_header:,
               token:,
               expiration:,
               redirect_required:,
               redirect:
              )
  @response_header = SixSaferpay::ResponseHeader.new(**response_header.to_h) if response_header
  @token = token
  @expiration = expiration
  @redirect_required = redirect_required
  @redirect = SixSaferpay::Redirect.new(**redirect.to_h) if redirect
end

Instance Attribute Details

#expirationObject

Returns the value of attribute expiration.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb', line 5

def expiration
  @expiration
end

#redirectObject

Returns the value of attribute redirect.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb', line 5

def redirect
  @redirect
end

#redirect_requiredObject

Returns the value of attribute redirect_required.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb', line 5

def redirect_required
  @redirect_required
end

#response_headerObject

Returns the value of attribute response_header.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb', line 5

def response_header
  @response_header
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb', line 5

def token
  @token
end

Instance Method Details

#to_hashObject Also known as: to_h



25
26
27
28
29
30
31
32
33
# File 'lib/six_saferpay/api/six_secure_card_data/responses/insert_response.rb', line 25

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!(redirect_required: @redirect_required) if !@redirect_required.nil?
  hash.merge!(redirect: @redirect.to_h) if @redirect
  hash
end