class Ingenico::Connect::SDK::Domain::Token::TokenSepaDirectDebit
@attr [Ingenico::Connect::SDK::Domain::Token::CustomerTokenWithContactDetails] customer @attr [Ingenico::Connect::SDK::Domain::Token::MandateSepaDirectDebit] mandate
Attributes
customer[RW]
mandate[RW]
Public Instance Methods
from_hash(hash)
click to toggle source
Calls superclass method
Ingenico::Connect::SDK::Domain::Token::AbstractToken#from_hash
# File lib/ingenico/connect/sdk/domain/token/token_sepa_direct_debit.rb, line 29 def from_hash(hash) super if hash.has_key? 'customer' raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash @customer = Ingenico::Connect::SDK::Domain::Token::CustomerTokenWithContactDetails.new_from_hash(hash['customer']) end if hash.has_key? 'mandate' raise TypeError, "value '%s' is not a Hash" % [hash['mandate']] unless hash['mandate'].is_a? Hash @mandate = Ingenico::Connect::SDK::Domain::Token::MandateSepaDirectDebit.new_from_hash(hash['mandate']) end end
to_h()
click to toggle source
@return (Hash)
Calls superclass method
Ingenico::Connect::SDK::Domain::Token::AbstractToken#to_h
# File lib/ingenico/connect/sdk/domain/token/token_sepa_direct_debit.rb, line 22 def to_h hash = super hash['customer'] = @customer.to_h unless @customer.nil? hash['mandate'] = @mandate.to_h unless @mandate.nil? hash end