Class: OnlinePayments::SDK::Domain::CustomerToken
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CustomerToken
- Defined in:
- lib/onlinepayments/sdk/domain/customer_token.rb
Instance Attribute Summary collapse
-
#billing_address ⇒ OnlinePayments::SDK::Domain::Address
The current value of billing_address.
-
#company_information ⇒ OnlinePayments::SDK::Domain::CompanyInformation
The current value of company_information.
-
#personal_information ⇒ OnlinePayments::SDK::Domain::PersonalInformationToken
The current value of personal_information.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#billing_address ⇒ OnlinePayments::SDK::Domain::Address
Returns the current value of billing_address.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 15 def billing_address @billing_address end |
#company_information ⇒ OnlinePayments::SDK::Domain::CompanyInformation
Returns the current value of company_information.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 15 def company_information @company_information end |
#personal_information ⇒ OnlinePayments::SDK::Domain::PersonalInformationToken
Returns the current value of personal_information.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 15 def personal_information @personal_information end |
Instance Method Details
#from_hash(hash) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 32 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 = OnlinePayments::SDK::Domain::Address.new_from_hash(hash['billingAddress']) end if hash.has_key? 'companyInformation' raise TypeError, "value '%s' is not a Hash" % [hash['companyInformation']] unless hash['companyInformation'].is_a? Hash @company_information = OnlinePayments::SDK::Domain::CompanyInformation.new_from_hash(hash['companyInformation']) end if hash.has_key? 'personalInformation' raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash @personal_information = OnlinePayments::SDK::Domain::PersonalInformationToken.new_from_hash(hash['personalInformation']) end end |
#to_h ⇒ Hash
24 25 26 27 28 29 30 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 24 def to_h hash = super hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil? hash['companyInformation'] = @company_information.to_h unless @company_information.nil? hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil? hash end |