lib/finix/resources/payment_instrument.rb in finix-0.7 vs lib/finix/resources/payment_instrument.rb in finix-0.8

- old
+ new

@@ -1,8 +1,23 @@ module Finix class PaymentInstrument include Finix::Resource include Finix::HypermediaRegistry + include Finix::Verifiable define_hypermedia_types [:payment_instruments] + + class << self + def hypermedia_subtype(response) + unless response.nil? + type = response['instrument_type'] || response['type'] + if type == 'PAYMENT_CARD' + return Finix::PaymentCard + elsif type == 'BANK_ACCOUNT' + return Finix::BankAccount + end + end + self + end + end end end