xero 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/xero/associations/belongs_to.rb +3 -2
- data/lib/xero/client.rb +10 -4
- data/lib/xero/configuration.rb +8 -1
- data/lib/xero/connection.rb +10 -2
- data/lib/xero/models/base_model.rb +7 -3
- data/lib/xero/models/contact.rb +6 -0
- data/lib/xero/models/invoice.rb +20 -6
- data/lib/xero/models/item.rb +18 -6
- data/lib/xero/models/line_item.rb +12 -3
- data/lib/xero/version.rb +1 -1
- data/spec/lib/xero/clients/private_application_spec.rb +19 -5
- data/spec/lib/xero/models/invoice_spec.rb +10 -0
- data/spec/lib/xero/models/item_spec.rb +0 -8
- data/spec/lib/xero/models/line_item_spec.rb +18 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/helpers.rb +4 -0
- data/spec/vcr_cassettes/save_invoice.yml +28 -25
- data/xero.gemspec +1 -0
- metadata +18 -2
@@ -4,17 +4,18 @@ module Xero
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
module ClassMethods
|
7
|
+
|
7
8
|
def belongs_to(association_name, options = {})
|
8
9
|
|
9
10
|
attr_accessor :"#{association_name}_id"
|
10
11
|
|
11
12
|
define_method association_name do
|
12
|
-
instance_variable_get(:"
|
13
|
+
instance_variable_get(:"@#{association_name}")
|
13
14
|
end
|
14
15
|
|
15
16
|
define_method "#{association_name}=" do |value|
|
16
17
|
instance_variable_set(:"@#{association_name}", value)
|
17
|
-
send "#{association_name}_id", value.id
|
18
|
+
send "#{association_name}_id=", value.id
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
data/lib/xero/client.rb
CHANGED
@@ -53,14 +53,20 @@ module Xero
|
|
53
53
|
def save(model)
|
54
54
|
model.tap do |item|
|
55
55
|
response = self.connection.post(model.class.path, model.to_xero_xml)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
|
57
|
+
Hash.from_xml(response.body)['Response'].tap do |resp|
|
58
|
+
klass = model.class.to_s.demodulize
|
59
|
+
model.attributes = resp[klass.pluralize][klass]
|
60
|
+
end
|
61
|
+
|
60
62
|
model.new_record = false
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
66
|
+
def build_invoice(attributes = {})
|
67
|
+
build_model Xero::Models::Invoice, attributes
|
68
|
+
end
|
69
|
+
|
64
70
|
def build_item(attributes = {})
|
65
71
|
build_model Xero::Models::Item, attributes
|
66
72
|
end
|
data/lib/xero/configuration.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
module Xero
|
2
2
|
class Configuration
|
3
3
|
|
4
|
-
attr_accessor :logger, :consumer_key, :consumer_secret, :private_key_path
|
4
|
+
attr_accessor :logger, :consumer_key, :consumer_secret, :private_key_path,
|
5
|
+
:invoice_due_days
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
default_options = { invoice_due_days: 30 }.merge(options)
|
9
|
+
default_options.each { |key, value| self.send("#{key}=", value) }
|
10
|
+
self
|
11
|
+
end
|
5
12
|
|
6
13
|
def logger
|
7
14
|
@logger || Logger.new(STDOUT)
|
data/lib/xero/connection.rb
CHANGED
@@ -14,8 +14,7 @@ module Xero
|
|
14
14
|
|
15
15
|
def consumer
|
16
16
|
@consumer ||= ::OAuth::Consumer.new(
|
17
|
-
Xero.configuration.consumer_key,
|
18
|
-
Xero.configuration.consumer_secret,
|
17
|
+
Xero.configuration.consumer_key, Xero.configuration.consumer_secret,
|
19
18
|
self.consumer_options
|
20
19
|
)
|
21
20
|
end
|
@@ -47,11 +46,20 @@ module Xero
|
|
47
46
|
|
48
47
|
headers = { 'charset' => 'utf-8' }
|
49
48
|
|
49
|
+
Xero.configuration.logger.debug(
|
50
|
+
"XERO::Connection #{method.upcase} #{uri} with #{params}"
|
51
|
+
)
|
52
|
+
|
50
53
|
if method == :get
|
51
54
|
response = access_token.get(uri, params)
|
52
55
|
else
|
53
56
|
response = access_token.post(uri, params, headers)
|
54
57
|
end
|
58
|
+
|
59
|
+
Xero.configuration.logger.debug(
|
60
|
+
"XERO::Connection RESPONSE code: #{response} body: #{response.body}"
|
61
|
+
)
|
62
|
+
|
55
63
|
handle_response(response)
|
56
64
|
end
|
57
65
|
|
@@ -2,6 +2,7 @@ module Xero
|
|
2
2
|
module Models
|
3
3
|
class BaseModel
|
4
4
|
include ActiveAttr::Model
|
5
|
+
include ActiveAttr::Attributes
|
5
6
|
include Xero::Associations
|
6
7
|
|
7
8
|
class << self
|
@@ -13,12 +14,14 @@ module Xero
|
|
13
14
|
attr_accessor :new_record, :client
|
14
15
|
|
15
16
|
def initialize(attributes = {})
|
17
|
+
super(cleanup_hash(attributes))
|
16
18
|
@new_record = true
|
17
|
-
self.attributes = attributes
|
18
19
|
end
|
19
20
|
|
20
21
|
def attributes=(attrs)
|
21
|
-
cleanup_hash(attrs).each
|
22
|
+
cleanup_hash(attrs).each do |key, value|
|
23
|
+
send("#{key}=", value) unless value.blank?
|
24
|
+
end
|
22
25
|
end
|
23
26
|
|
24
27
|
def save
|
@@ -28,13 +31,14 @@ module Xero
|
|
28
31
|
|
29
32
|
def xero_attributes(attrs = nil)
|
30
33
|
attrs ||= attributes.clone
|
31
|
-
attrs.delete('id')
|
34
|
+
id = attrs.delete('id')
|
32
35
|
attrs.delete('updated_date_utc')
|
33
36
|
attrs.keys.each do |key|
|
34
37
|
value = attrs.delete(key)
|
35
38
|
value = xero_attributes(value) if value.is_a?(Hash)
|
36
39
|
attrs[key.to_s.camelize] = value.to_s unless value.blank?
|
37
40
|
end
|
41
|
+
attrs.merge!("#{self.class.to_s.demodulize}ID" => id) unless id.blank?
|
38
42
|
attrs
|
39
43
|
end
|
40
44
|
|
data/lib/xero/models/contact.rb
CHANGED
data/lib/xero/models/invoice.rb
CHANGED
@@ -8,7 +8,8 @@ module Xero
|
|
8
8
|
|
9
9
|
attribute :type
|
10
10
|
attribute :date, type: Date
|
11
|
-
attribute :due_date, type: Date
|
11
|
+
attribute :due_date, type: Date, default:
|
12
|
+
lambda { Date.parse(Xero.configuration.invoice_due_days.days.from_now.to_s).to_s }
|
12
13
|
attribute :line_amount_type
|
13
14
|
attribute :invoice_number
|
14
15
|
attribute :reference
|
@@ -38,13 +39,26 @@ module Xero
|
|
38
39
|
validates :line_items, presence: true
|
39
40
|
|
40
41
|
def to_xero_xml
|
41
|
-
xero_attributes(attributes.clone).
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
xero_attributes(attributes.clone).tap do |attrs|
|
43
|
+
merge_contact(attrs) unless contact.blank?
|
44
|
+
merge_line_items(attrs) unless line_items.blank?
|
45
|
+
merge_payments(attrs) unless payments.blank?
|
46
|
+
end.to_xml(root: 'Invoice')
|
46
47
|
end
|
47
48
|
|
49
|
+
private
|
50
|
+
|
51
|
+
def merge_contact(attrs)
|
52
|
+
attrs.merge!('Contact' => contact.xero_attributes)
|
53
|
+
end
|
54
|
+
|
55
|
+
def merge_line_items(attrs)
|
56
|
+
attrs.merge!('LineItems' => line_items.xero_attributes)
|
57
|
+
end
|
58
|
+
|
59
|
+
def merge_payments(attrs)
|
60
|
+
attrs.merge!('Payments' => payments.xero_attributes)
|
61
|
+
end
|
48
62
|
end
|
49
63
|
end
|
50
64
|
end
|
data/lib/xero/models/item.rb
CHANGED
@@ -9,17 +9,29 @@ module Xero
|
|
9
9
|
attribute :updated_date_utc, type: DateTime
|
10
10
|
|
11
11
|
validates :code, presence: true
|
12
|
-
validates :purchase_details, presence: true
|
13
|
-
validates :sales_details, presence: true
|
14
12
|
|
15
13
|
has_one :purchase_details, class_name: :item_detail
|
16
14
|
has_one :sales_details, class_name: :item_detail
|
17
15
|
|
16
|
+
has_many :line_items
|
17
|
+
|
18
18
|
def to_xero_xml
|
19
|
-
xero_attributes(attributes.clone).
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
xero_attributes(attributes.clone).tap do |attrs|
|
20
|
+
merge_purchase_details(attrs) unless purchase_details.blank?
|
21
|
+
merge_sales_details(attrs) unless sales_details.blank?
|
22
|
+
end.to_xml(root: 'Item')
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def merge_purchase_details(attrs)
|
28
|
+
attrs.merge!(
|
29
|
+
'PurchaseDetails' => self.purchase_details.xero_attributes
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def merge_sales_details(attrs)
|
34
|
+
attrs.merge!('SalesDetails' => self.sales_details.xero_attributes)
|
23
35
|
end
|
24
36
|
end
|
25
37
|
end
|
@@ -7,10 +7,19 @@ module Xero
|
|
7
7
|
attribute :unit_amount, type: Float
|
8
8
|
attribute :account_code
|
9
9
|
|
10
|
-
validates :description, presence: true
|
10
|
+
validates :description, presence: true, unless: :item
|
11
11
|
validates :quantity, presence: true
|
12
|
-
validates :unit_amount, presence: true
|
13
|
-
validates :account_code, presence: true
|
12
|
+
validates :unit_amount, presence: true, unless: :item
|
13
|
+
validates :account_code, presence: true, unless: :item
|
14
|
+
|
15
|
+
belongs_to :invoice
|
16
|
+
belongs_to :item
|
17
|
+
|
18
|
+
def xero_attributes(attrs = nil)
|
19
|
+
attrs = super(attrs)
|
20
|
+
attrs.merge!('ItemCode' => item.code) if item
|
21
|
+
attrs
|
22
|
+
end
|
14
23
|
end
|
15
24
|
end
|
16
25
|
end
|
data/lib/xero/version.rb
CHANGED
@@ -167,18 +167,32 @@ describe Xero::Clients::PrivateApplication do
|
|
167
167
|
)
|
168
168
|
end
|
169
169
|
|
170
|
+
let(:address) do
|
171
|
+
Xero::Models::Address.new(
|
172
|
+
address_type: 'STREET', address_line1: Faker::Address.street_address,
|
173
|
+
city: Faker::Address.city, region: Faker::Address.state,
|
174
|
+
postal_code: Faker::Address.zip_code, country: 'Germany'
|
175
|
+
)
|
176
|
+
end
|
177
|
+
|
170
178
|
let(:contact) do
|
171
|
-
Xero::Models::Contact.new(
|
179
|
+
Xero::Models::Contact.new(
|
180
|
+
name: 'Xero Gem Test Contact', addresses: [address]
|
181
|
+
)
|
172
182
|
end
|
173
183
|
|
174
184
|
let(:line_items) { [line_item] }
|
175
185
|
|
176
186
|
let(:line_item) do
|
177
187
|
Xero::Models::LineItem.new(
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
188
|
+
quantity: 2.0, item: item, description: 'asdfsdafdf'
|
189
|
+
)
|
190
|
+
end
|
191
|
+
|
192
|
+
let(:item) do
|
193
|
+
Xero::Models::Item.new(
|
194
|
+
code: 'stepstone', description: 'some bullshit description',
|
195
|
+
id: '99213658-83c4-438a-b104-1172b1e69790'
|
182
196
|
)
|
183
197
|
end
|
184
198
|
|
@@ -2,9 +2,19 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Xero::Models::Invoice do
|
4
4
|
|
5
|
+
before { configure }
|
6
|
+
|
5
7
|
it { should validate_presence_of(:type) }
|
6
8
|
|
7
9
|
it { should validate_presence_of(:contact) }
|
8
10
|
|
9
11
|
it { should validate_presence_of(:line_items) }
|
12
|
+
|
13
|
+
describe 'defaults' do
|
14
|
+
let(:invoice) { Xero::Models::Invoice.new }
|
15
|
+
|
16
|
+
it 'should default due date to 30 days from now' do
|
17
|
+
invoice.due_date.to_s.should eql(Date.parse(30.days.from_now.to_s).to_s)
|
18
|
+
end
|
19
|
+
end
|
10
20
|
end
|
@@ -35,14 +35,6 @@ describe Xero::Models::Item do
|
|
35
35
|
subject.should match(/SalesDetails/)
|
36
36
|
end
|
37
37
|
|
38
|
-
it 'should not include the id' do
|
39
|
-
subject.should_not match(/ItemId/)
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should not include the id value' do
|
43
|
-
subject.should_not match(/34b3fc86\-483e\-4112\-8106\-9b23d36f925c/)
|
44
|
-
end
|
45
|
-
|
46
38
|
it 'should include the code' do
|
47
39
|
subject.should match(/Code/)
|
48
40
|
end
|
@@ -9,4 +9,22 @@ describe Xero::Models::LineItem do
|
|
9
9
|
it { should validate_presence_of(:unit_amount) }
|
10
10
|
|
11
11
|
it { should validate_presence_of(:account_code) }
|
12
|
+
|
13
|
+
context 'when item is set' do
|
14
|
+
let(:line_item) do
|
15
|
+
Xero::Models::LineItem.new(item: Xero::Models::Item.new)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should not require description' do
|
19
|
+
line_item.should_not validate_presence_of(:description)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should not require unit amount' do
|
23
|
+
line_item.should_not validate_presence_of(:unit_amount)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should not require account code' do
|
27
|
+
line_item.should_not validate_presence_of(:account_code)
|
28
|
+
end
|
29
|
+
end
|
12
30
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/helpers.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
module Helpers
|
2
2
|
def configure
|
3
|
+
logger = Logger.new(STDOUT)
|
4
|
+
logger.level = Logger::INFO
|
5
|
+
|
3
6
|
Xero.configure do |config|
|
4
7
|
config.consumer_key = 'TYMATGTPO5QEAWP8I307AOMBHSOJI2'
|
5
8
|
config.consumer_secret = 'VWZPP3PBRGERW7UFSULKZMBRZDRXIM'
|
6
9
|
config.private_key_path = 'spec/support/privatekey.pem'
|
10
|
+
config.logger = logger
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://api.xero.com/api.xro/2.0/Invoices
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: xml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CInvoice%3E%0A%20%20%3CType%3EACCREC%3C%2FType%3E%0A%20%20%3CContact%3E%0A%20%20%20%20%3CName%3EXero%20Gem%20Test%20Contact%3C%2FName%3E%0A%20%20%
|
8
|
+
string: xml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CInvoice%3E%0A%20%20%3CType%3EACCREC%3C%2FType%3E%0A%20%20%3CContact%3E%0A%20%20%20%20%3CName%3EXero%20Gem%20Test%20Contact%3C%2FName%3E%0A%20%20%20%20%3CAddresses%20type%3D%22array%22%3E%0A%20%20%20%20%20%20%3CAddress%3E%0A%20%20%20%20%20%20%20%20%3CAddressType%3ESTREET%3C%2FAddressType%3E%0A%20%20%20%20%20%20%20%20%3CAddressLine1%3E1684%20Schuster%20Ferry%3C%2FAddressLine1%3E%0A%20%20%20%20%20%20%20%20%3CCity%3EJewessview%3C%2FCity%3E%0A%20%20%20%20%20%20%20%20%3CRegion%3EFlorida%3C%2FRegion%3E%0A%20%20%20%20%20%20%20%20%3CPostalCode%3E61960%3C%2FPostalCode%3E%0A%20%20%20%20%20%20%20%20%3CCountry%3EGermany%3C%2FCountry%3E%0A%20%20%20%20%20%20%3C%2FAddress%3E%0A%20%20%20%20%3C%2FAddresses%3E%0A%20%20%3C%2FContact%3E%0A%20%20%3CLineItems%20type%3D%22array%22%3E%0A%20%20%20%20%3CLineItem%3E%0A%20%20%20%20%20%20%3CDescription%3Easdfsdafdf%3C%2FDescription%3E%0A%20%20%20%20%20%20%3CQuantity%3E2.0%3C%2FQuantity%3E%0A%20%20%20%20%20%20%3CItemCode%3Estepstone%3C%2FItemCode%3E%0A%20%20%20%20%3C%2FLineItem%3E%0A%20%20%3C%2FLineItems%3E%0A%3C%2FInvoice%3E%0A
|
9
9
|
headers:
|
10
10
|
charset:
|
11
11
|
- utf-8
|
@@ -18,9 +18,9 @@ http_interactions:
|
|
18
18
|
content-type:
|
19
19
|
- application/x-www-form-urlencoded
|
20
20
|
authorization:
|
21
|
-
- OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="
|
22
|
-
oauth_signature="
|
23
|
-
oauth_signature_method="RSA-SHA1", oauth_timestamp="
|
21
|
+
- OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="UspJpriFboClY5jaVCE1tcEaoeKcmq2B0KhVvA",
|
22
|
+
oauth_signature="3KLWj2gbnpIWD8RKLc9Bn52wl48OsNRvvU3gwMeHAJZkc5QZjevSg000eFMOn8f95hnn5oWTkS84EtBBkO9FC2iYimgnbLeHko9WeSsVCSQDgOlrXk2wzF0YmX06nVtOct4bhJOs0Wr8SzzZIvz0THrmK2F1PV2FYdP3yV25578%3D",
|
23
|
+
oauth_signature_method="RSA-SHA1", oauth_timestamp="1352106612", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
|
24
24
|
oauth_version="1.0"
|
25
25
|
response:
|
26
26
|
status:
|
@@ -44,40 +44,43 @@ http_interactions:
|
|
44
44
|
x-powered-by:
|
45
45
|
- ASP.NET
|
46
46
|
date:
|
47
|
-
-
|
47
|
+
- Mon, 05 Nov 2012 09:10:14 GMT
|
48
48
|
connection:
|
49
49
|
- close
|
50
50
|
content-length:
|
51
|
-
- '
|
51
|
+
- '2588'
|
52
52
|
body:
|
53
53
|
encoding: US-ASCII
|
54
54
|
string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
|
55
|
-
\ <Id>
|
56
|
-
\ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-11-
|
55
|
+
\ <Id>8f83bc92-52f5-47b0-ae93-e2db97205cb4</Id>\r\n <Status>OK</Status>\r\n
|
56
|
+
\ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-11-05T09:10:14.8934283Z</DateTimeUTC>\r\n
|
57
57
|
\ <Invoices>\r\n <Invoice>\r\n <Contact>\r\n <ContactID>a18c8d85-7ac1-4f14-b470-50adf56ee45f</ContactID>\r\n
|
58
58
|
\ <ContactStatus>ACTIVE</ContactStatus>\r\n <Name>Xero Gem Test
|
59
59
|
Contact</Name>\r\n <Addresses>\r\n <Address>\r\n <AddressType>POBOX</AddressType>\r\n
|
60
60
|
\ </Address>\r\n <Address>\r\n <AddressType>STREET</AddressType>\r\n
|
61
|
-
\
|
62
|
-
\ <
|
63
|
-
\ <
|
64
|
-
\
|
65
|
-
\
|
66
|
-
\
|
67
|
-
\
|
68
|
-
\
|
69
|
-
\
|
70
|
-
|
71
|
-
\
|
72
|
-
\
|
61
|
+
\ <AddressLine1>1684 Schuster Ferry</AddressLine1>\r\n <City>Jewessview</City>\r\n
|
62
|
+
\ <Region>Florida</Region>\r\n <PostalCode>61960</PostalCode>\r\n
|
63
|
+
\ <Country>Germany</Country>\r\n </Address>\r\n </Addresses>\r\n
|
64
|
+
\ <Phones>\r\n <Phone>\r\n <PhoneType>DDI</PhoneType>\r\n
|
65
|
+
\ </Phone>\r\n <Phone>\r\n <PhoneType>MOBILE</PhoneType>\r\n
|
66
|
+
\ </Phone>\r\n <Phone>\r\n <PhoneType>FAX</PhoneType>\r\n
|
67
|
+
\ </Phone>\r\n <Phone>\r\n <PhoneType>DEFAULT</PhoneType>\r\n
|
68
|
+
\ </Phone>\r\n </Phones>\r\n <UpdatedDateUTC>2012-11-05T09:10:14.72</UpdatedDateUTC>\r\n
|
69
|
+
\ <IsSupplier>false</IsSupplier>\r\n <IsCustomer>true</IsCustomer>\r\n
|
70
|
+
\ </Contact>\r\n <Date>2012-11-05T00:00:00</Date>\r\n <Status>DRAFT</Status>\r\n
|
71
|
+
\ <LineAmountTypes>Exclusive</LineAmountTypes>\r\n <LineItems>\r\n
|
72
|
+
\ <LineItem>\r\n <Description>asdfsdafdf</Description>\r\n
|
73
|
+
\ <UnitAmount>1095.00</UnitAmount>\r\n <TaxType>OUTPUT</TaxType>\r\n
|
74
|
+
\ <TaxAmount>0.00</TaxAmount>\r\n <LineAmount>2190.00</LineAmount>\r\n
|
75
|
+
\ <AccountCode>200</AccountCode>\r\n <ItemCode>stepstone</ItemCode>\r\n
|
73
76
|
\ <Quantity>2.0000</Quantity>\r\n </LineItem>\r\n </LineItems>\r\n
|
74
|
-
\ <SubTotal>
|
75
|
-
\ <UpdatedDateUTC>2012-11-
|
76
|
-
\ <Type>ACCREC</Type>\r\n <InvoiceID>
|
77
|
-
\ <InvoiceNumber>INV-
|
77
|
+
\ <SubTotal>2190.00</SubTotal>\r\n <TotalTax>0.00</TotalTax>\r\n
|
78
|
+
\ <Total>2190.00</Total>\r\n <UpdatedDateUTC>2012-11-05T09:10:14.753</UpdatedDateUTC>\r\n
|
79
|
+
\ <CurrencyCode>EUR</CurrencyCode>\r\n <Type>ACCREC</Type>\r\n <InvoiceID>de3b19f2-1ed0-4eca-aec2-6d1d247a0bd7</InvoiceID>\r\n
|
80
|
+
\ <InvoiceNumber>INV-0005</InvoiceNumber>\r\n <AmountDue>2190.00</AmountDue>\r\n
|
78
81
|
\ <AmountPaid>0.00</AmountPaid>\r\n <SentToContact>false</SentToContact>\r\n
|
79
82
|
\ <CurrencyRate>1.000000</CurrencyRate>\r\n <HasAttachments>false</HasAttachments>\r\n
|
80
83
|
\ </Invoice>\r\n </Invoices>\r\n</Response>"
|
81
84
|
http_version: '1.1'
|
82
|
-
recorded_at:
|
85
|
+
recorded_at: Mon, 05 Nov 2012 09:10:15 GMT
|
83
86
|
recorded_with: VCR 2.2.5
|
data/xero.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_dependency('active_attr')
|
21
21
|
gem.add_dependency('oauth')
|
22
22
|
|
23
|
+
gem.add_development_dependency('faker')
|
23
24
|
gem.add_development_dependency('fakeweb')
|
24
25
|
gem.add_development_dependency('guard')
|
25
26
|
gem.add_development_dependency('guard-rspec')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: active_attr
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: faker
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: fakeweb
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|