class Ingenico::Direct::SDK::Domain::PaymentProduct840SpecificOutput

@attr [Ingenico::Direct::SDK::Domain::Address] billing_address @attr [Ingenico::Direct::SDK::Domain::PaymentProduct840CustomerAccount] customer_account @attr [Ingenico::Direct::SDK::Domain::Address] customer_address @attr [Ingenico::Direct::SDK::Domain::ProtectionEligibility] protection_eligibility

Attributes

billing_address[RW]
customer_account[RW]
customer_address[RW]
protection_eligibility[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/payment_product840_specific_output.rb, line 33
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 = Ingenico::Direct::SDK::Domain::Address.new_from_hash(hash['billingAddress'])
  end
  if hash.key? 'customerAccount'
    raise TypeError, "value '%s' is not a Hash" % [hash['customerAccount']] unless hash['customerAccount'].is_a? Hash
    @customer_account = Ingenico::Direct::SDK::Domain::PaymentProduct840CustomerAccount.new_from_hash(hash['customerAccount'])
  end
  if hash.key? 'customerAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['customerAddress']] unless hash['customerAddress'].is_a? Hash
    @customer_address = Ingenico::Direct::SDK::Domain::Address.new_from_hash(hash['customerAddress'])
  end
  if hash.key? 'protectionEligibility'
    raise TypeError, "value '%s' is not a Hash" % [hash['protectionEligibility']] unless hash['protectionEligibility'].is_a? Hash
    @protection_eligibility = Ingenico::Direct::SDK::Domain::ProtectionEligibility.new_from_hash(hash['protectionEligibility'])
  end
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/payment_product840_specific_output.rb, line 24
def to_h
  hash = super
  hash['billingAddress'] = @billing_address.to_h if @billing_address
  hash['customerAccount'] = @customer_account.to_h if @customer_account
  hash['customerAddress'] = @customer_address.to_h if @customer_address
  hash['protectionEligibility'] = @protection_eligibility.to_h if @protection_eligibility
  hash
end