Class: Worldline::Connect::SDK::V1::Domain::CustomerToken

Inherits:
CustomerBase show all
Defined in:
lib/worldline/connect/sdk/v1/domain/customer_token.rb

Direct Known Subclasses

CustomerTokenWithContactDetails

Instance Attribute Summary collapse

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

#billing_addressWorldline::Connect::SDK::V1::Domain::Address

Returns the current value of billing_address.

Returns:



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/customer_token.rb', line 16

def billing_address
  @billing_address
end

#personal_informationWorldline::Connect::SDK::V1::Domain::PersonalInformationToken

Returns the current value of personal_information.

Returns:



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/customer_token.rb', line 16

def personal_information
  @personal_information
end

Instance Method Details

#from_hash(hash) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/worldline/connect/sdk/v1/domain/customer_token.rb', line 30

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

#to_hHash

Returns:

  • (Hash)


23
24
25
26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/customer_token.rb', line 23

def to_h
  hash = super
  hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil?
  hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil?
  hash
end