Class: OnlinePayments::SDK::Domain::Customer
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::Customer
- Defined in:
- lib/onlinepayments/sdk/domain/customer.rb
Instance Attribute Summary collapse
-
#account ⇒ OnlinePayments::SDK::Domain::CustomerAccount
The current value of account.
-
#account_type ⇒ String
The current value of account_type.
-
#billing_address ⇒ OnlinePayments::SDK::Domain::Address
The current value of billing_address.
-
#company_information ⇒ OnlinePayments::SDK::Domain::CompanyInformation
The current value of company_information.
-
#contact_details ⇒ OnlinePayments::SDK::Domain::ContactDetails
The current value of contact_details.
-
#device ⇒ OnlinePayments::SDK::Domain::CustomerDevice
The current value of device.
-
#fiscal_number ⇒ String
The current value of fiscal_number.
-
#locale ⇒ String
The current value of locale.
-
#merchant_customer_id ⇒ String
The current value of merchant_customer_id.
-
#personal_information ⇒ OnlinePayments::SDK::Domain::PersonalInformation
The current value of personal_information.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#account ⇒ OnlinePayments::SDK::Domain::CustomerAccount
Returns the current value of account.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def account @account end |
#account_type ⇒ String
Returns the current value of account_type.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def account_type @account_type end |
#billing_address ⇒ OnlinePayments::SDK::Domain::Address
Returns the current value of billing_address.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def billing_address @billing_address end |
#company_information ⇒ OnlinePayments::SDK::Domain::CompanyInformation
Returns the current value of company_information.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def company_information @company_information end |
#contact_details ⇒ OnlinePayments::SDK::Domain::ContactDetails
Returns the current value of contact_details.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def contact_details @contact_details end |
#device ⇒ OnlinePayments::SDK::Domain::CustomerDevice
Returns the current value of device.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def device @device end |
#fiscal_number ⇒ String
Returns the current value of fiscal_number.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def fiscal_number @fiscal_number end |
#locale ⇒ String
Returns the current value of locale.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def locale @locale end |
#merchant_customer_id ⇒ String
Returns the current value of merchant_customer_id.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def merchant_customer_id @merchant_customer_id end |
#personal_information ⇒ OnlinePayments::SDK::Domain::PersonalInformation
Returns the current value of personal_information.
25 26 27 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 25 def personal_information @personal_information end |
Instance Method Details
#from_hash(hash) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 63 def from_hash(hash) super if hash.has_key? 'account' raise TypeError, "value '%s' is not a Hash" % [hash['account']] unless hash['account'].is_a? Hash @account = OnlinePayments::SDK::Domain::CustomerAccount.new_from_hash(hash['account']) end if hash.has_key? 'accountType' @account_type = hash['accountType'] end 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? 'contactDetails' raise TypeError, "value '%s' is not a Hash" % [hash['contactDetails']] unless hash['contactDetails'].is_a? Hash @contact_details = OnlinePayments::SDK::Domain::ContactDetails.new_from_hash(hash['contactDetails']) end if hash.has_key? 'device' raise TypeError, "value '%s' is not a Hash" % [hash['device']] unless hash['device'].is_a? Hash @device = OnlinePayments::SDK::Domain::CustomerDevice.new_from_hash(hash['device']) end if hash.has_key? 'fiscalNumber' @fiscal_number = hash['fiscalNumber'] end if hash.has_key? 'locale' @locale = hash['locale'] end if hash.has_key? 'merchantCustomerId' @merchant_customer_id = hash['merchantCustomerId'] 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::PersonalInformation.new_from_hash(hash['personalInformation']) end end |
#to_h ⇒ Hash
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/onlinepayments/sdk/domain/customer.rb', line 48 def to_h hash = super hash['account'] = @account.to_h unless @account.nil? hash['accountType'] = @account_type unless @account_type.nil? hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil? hash['companyInformation'] = @company_information.to_h unless @company_information.nil? hash['contactDetails'] = @contact_details.to_h unless @contact_details.nil? hash['device'] = @device.to_h unless @device.nil? hash['fiscalNumber'] = @fiscal_number unless @fiscal_number.nil? hash['locale'] = @locale unless @locale.nil? hash['merchantCustomerId'] = @merchant_customer_id unless @merchant_customer_id.nil? hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil? hash end |