class PaymentMethod < ActiveRecord::Base
def authorize(amount)
processor = Payment::TrustCommerce.new('billingid' => self.processor_id)
if !processor.process('preauth', 'amount' => amount.to_s)
raise PaymentMethodError, processor.error
end
self.payment_transactions.create(:processor => processor, :action => 'Authorization')
end
end