From fea6d4828a17c464b8069a1cb063c0e549da4a3f Mon Sep 17 00:00:00 2001 From: Andrew Kalek Date: Sun, 20 Nov 2011 17:59:03 -0800 Subject: [PATCH] Updated API for payments, including gateway_transactions --- lib/freshbooks.rb | 1 + lib/freshbooks/gateway_transaction.rb | 8 ++++++++ lib/freshbooks/payment.rb | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lib/freshbooks/gateway_transaction.rb diff --git a/lib/freshbooks.rb b/lib/freshbooks.rb index 27b3c9e..65fff7a 100644 --- a/lib/freshbooks.rb +++ b/lib/freshbooks.rb @@ -20,6 +20,7 @@ require 'freshbooks/estimate' require 'freshbooks/expense' require 'freshbooks/expiration' +require 'freshbooks/gateway_transaction' require 'freshbooks/invoice' require 'freshbooks/contact' require 'freshbooks/item' diff --git a/lib/freshbooks/gateway_transaction.rb b/lib/freshbooks/gateway_transaction.rb new file mode 100644 index 0000000..256d472 --- /dev/null +++ b/lib/freshbooks/gateway_transaction.rb @@ -0,0 +1,8 @@ +module FreshBooks + class GatewayTransaction < FreshBooks::Base + define_schema do |s| + s.fixnum :reference_id + s.string :gateway_name + end + end +end diff --git a/lib/freshbooks/payment.rb b/lib/freshbooks/payment.rb index 7d29ad6..0af195e 100644 --- a/lib/freshbooks/payment.rb +++ b/lib/freshbooks/payment.rb @@ -5,7 +5,8 @@ class Payment < FreshBooks::Base s.float :amount s.date :date s.date_time :updated, :read_only => true - s.string :type, :notes + s.string :type, :notes, :currency_code + s.object :gateway_transaction end actions :list, :get, :create, :update, :delete