Class: Ingenico::Connect::SDK::Domain::Payment::Customer
- Inherits:
-
Definitions::CustomerBase
- Object
- Ingenico::Connect::SDK::DataObject
- Definitions::CustomerBase
- Ingenico::Connect::SDK::Domain::Payment::Customer
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/customer.rb
Instance Attribute Summary collapse
-
#account ⇒ Ingenico::Connect::SDK::Domain::Payment::CustomerAccount
The current value of account.
-
#account_type ⇒ String
The current value of account_type.
-
#billing_address ⇒ Ingenico::Connect::SDK::Domain::Definitions::Address
The current value of billing_address.
-
#contact_details ⇒ Ingenico::Connect::SDK::Domain::Payment::ContactDetails
The current value of contact_details.
-
#device ⇒ Ingenico::Connect::SDK::Domain::Payment::CustomerDevice
The current value of device.
-
#fiscal_number ⇒ String
The current value of fiscal_number.
-
#is_company ⇒ true/false
The current value of is_company.
-
#is_previous_customer ⇒ true/false
The current value of is_previous_customer.
-
#locale ⇒ String
The current value of locale.
-
#personal_information ⇒ Ingenico::Connect::SDK::Domain::Payment::PersonalInformation
The current value of personal_information.
-
#shipping_address ⇒ Object
deprecated
Deprecated.
Use Order.shipping.address instead
Attributes inherited from Definitions::CustomerBase
#company_information, #merchant_customer_id, #vat_number
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#account ⇒ Ingenico::Connect::SDK::Domain::Payment::CustomerAccount
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def account @account end |
#account_type ⇒ String
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def account_type @account_type end |
#billing_address ⇒ Ingenico::Connect::SDK::Domain::Definitions::Address
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def billing_address @billing_address end |
#contact_details ⇒ Ingenico::Connect::SDK::Domain::Payment::ContactDetails
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def contact_details @contact_details end |
#device ⇒ Ingenico::Connect::SDK::Domain::Payment::CustomerDevice
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def device @device end |
#fiscal_number ⇒ String
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def fiscal_number @fiscal_number end |
#is_company ⇒ true/false
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def is_company @is_company end |
#is_previous_customer ⇒ true/false
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def is_previous_customer @is_previous_customer end |
#locale ⇒ String
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def locale @locale end |
#personal_information ⇒ Ingenico::Connect::SDK::Domain::Payment::PersonalInformation
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def personal_information @personal_information end |
#shipping_address ⇒ Object
Deprecated.
Use Order.shipping.address instead
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 28 def shipping_address @shipping_address end |
Instance Method Details
#from_hash(hash) ⇒ Object
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 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 71 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 = Ingenico::Connect::SDK::Domain::Payment::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 = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['billingAddress']) end if hash.has_key? 'contactDetails' raise TypeError, "value '%s' is not a Hash" % [hash['contactDetails']] unless hash['contactDetails'].is_a? Hash @contact_details = Ingenico::Connect::SDK::Domain::Payment::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 = Ingenico::Connect::SDK::Domain::Payment::CustomerDevice.new_from_hash(hash['device']) end if hash.has_key? 'fiscalNumber' @fiscal_number = hash['fiscalNumber'] end if hash.has_key? 'isCompany' @is_company = hash['isCompany'] end if hash.has_key? 'isPreviousCustomer' @is_previous_customer = hash['isPreviousCustomer'] end if hash.has_key? 'locale' @locale = hash['locale'] end if hash.has_key? 'personalInformation' raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash @personal_information = Ingenico::Connect::SDK::Domain::Payment::PersonalInformation.new_from_hash(hash['personalInformation']) end if hash.has_key? 'shippingAddress' raise TypeError, "value '%s' is not a Hash" % [hash['shippingAddress']] unless hash['shippingAddress'].is_a? Hash @shipping_address = Ingenico::Connect::SDK::Domain::Payment::AddressPersonal.new_from_hash(hash['shippingAddress']) end end |
#to_h ⇒ Hash
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ingenico/connect/sdk/domain/payment/customer.rb', line 55 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['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['isCompany'] = @is_company unless @is_company.nil? hash['isPreviousCustomer'] = @is_previous_customer unless @is_previous_customer.nil? hash['locale'] = @locale unless @locale.nil? hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil? hash['shippingAddress'] = @shipping_address.to_h unless @shipping_address.nil? hash end |