Class: Worldline::Connect::SDK::V1::Domain::CustomerTokenWithContactDetails

Inherits:
CustomerToken show all
Defined in:
lib/worldline/connect/sdk/v1/domain/customer_token_with_contact_details.rb

Instance Attribute Summary collapse

Attributes inherited from CustomerToken

#billing_address, #personal_information

Attributes inherited from CustomerBase

#company_information, #merchant_customer_id, #vat_number

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#contact_detailsWorldline::Connect::SDK::V1::Domain::ContactDetailsToken

Returns the current value of contact_details.

Returns:



14
15
16
# File 'lib/worldline/connect/sdk/v1/domain/customer_token_with_contact_details.rb', line 14

def contact_details
  @contact_details
end

Instance Method Details

#from_hash(hash) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/worldline/connect/sdk/v1/domain/customer_token_with_contact_details.rb', line 25

def from_hash(hash)
  super
  if hash.has_key? 'contactDetails'
    raise TypeError, "value '%s' is not a Hash" % [hash['contactDetails']] unless hash['contactDetails'].is_a? Hash
    @contact_details = Worldline::Connect::SDK::V1::Domain::ContactDetailsToken.new_from_hash(hash['contactDetails'])
  end
end

#to_hHash

Returns:

  • (Hash)


19
20
21
22
23
# File 'lib/worldline/connect/sdk/v1/domain/customer_token_with_contact_details.rb', line 19

def to_h
  hash = super
  hash['contactDetails'] = @contact_details.to_h unless @contact_details.nil?
  hash
end