Class: OnlinePayments::SDK::Domain::CreateHostedFieldsSessionRequest

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#localeString

Returns the current value of locale.

Returns:

  • (String)

    the current value of locale



12
13
14
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 12

def locale
  @locale
end

#originString

Returns the current value of origin.

Returns:

  • (String)

    the current value of origin



12
13
14
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 12

def origin
  @origin
end

#tokensArray<String>

Returns the current value of tokens.

Returns:

  • (Array<String>)

    the current value of tokens



12
13
14
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 12

def tokens
  @tokens
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 29

def from_hash(hash)
  super
  if hash.has_key? 'locale'
    @locale = hash['locale']
  end
  if hash.has_key? 'origin'
    @origin = hash['origin']
  end
  if hash.has_key? 'tokens'
    raise TypeError, "value '%s' is not an Array" % [hash['tokens']] unless hash['tokens'].is_a? Array
    @tokens = []
    hash['tokens'].each do |e|
      @tokens << e
    end
  end
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 21

def to_h
  hash = super
  hash['locale'] = @locale unless @locale.nil?
  hash['origin'] = @origin unless @origin.nil?
  hash['tokens'] = @tokens unless @tokens.nil?
  hash
end