Class: OnlinePayments::SDK::Domain::CustomerToken
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::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 OnlinePayments::SDK::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
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 29 def from_hash(hash) super if hash.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.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.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
21 22 23 24 25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer_token.rb', line 21 def to_h hash = super hash['billingAddress'] = @billing_address.to_h if @billing_address hash['companyInformation'] = @company_information.to_h if @company_information hash['personalInformation'] = @personal_information.to_h if @personal_information hash end |