xero 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +18 -0
  2. data/.rspec +2 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +8 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +29 -0
  7. data/Rakefile +1 -0
  8. data/lib/active_support/inflection_config.rb +4 -0
  9. data/lib/active_support/inflections.rb +3 -0
  10. data/lib/oauth/consumer.rb +13 -0
  11. data/lib/xero/associations/belongs_to.rb +24 -0
  12. data/lib/xero/associations/has_many.rb +40 -0
  13. data/lib/xero/associations/has_many_proxy.rb +20 -0
  14. data/lib/xero/associations/has_one.rb +25 -0
  15. data/lib/xero/associations.rb +11 -0
  16. data/lib/xero/client.rb +83 -0
  17. data/lib/xero/clients/partner_application.rb +6 -0
  18. data/lib/xero/clients/private_application.rb +12 -0
  19. data/lib/xero/configuration.rb +14 -0
  20. data/lib/xero/connection.rb +62 -0
  21. data/lib/xero/models/account.rb +66 -0
  22. data/lib/xero/models/address.rb +28 -0
  23. data/lib/xero/models/base_model.rb +52 -0
  24. data/lib/xero/models/contact.rb +27 -0
  25. data/lib/xero/models/invoice.rb +37 -0
  26. data/lib/xero/models/item.rb +26 -0
  27. data/lib/xero/models/item_detail.rb +14 -0
  28. data/lib/xero/models/line_item.rb +16 -0
  29. data/lib/xero/models/payment.rb +21 -0
  30. data/lib/xero/models/phone.rb +18 -0
  31. data/lib/xero/models/tracking_category.rb +12 -0
  32. data/lib/xero/models/tracking_category_option.rb +12 -0
  33. data/lib/xero/version.rb +3 -0
  34. data/lib/xero.rb +39 -0
  35. data/spec/lib/xero/client_spec.rb +4 -0
  36. data/spec/lib/xero/clients/private_application_spec.rb +216 -0
  37. data/spec/lib/xero/models/account_spec.rb +38 -0
  38. data/spec/lib/xero/models/address_spec.rb +21 -0
  39. data/spec/lib/xero/models/base_model_spec.rb +37 -0
  40. data/spec/lib/xero/models/contact_spec.rb +4 -0
  41. data/spec/lib/xero/models/invoice_spec.rb +6 -0
  42. data/spec/lib/xero/models/item_detail_spec.rb +10 -0
  43. data/spec/lib/xero/models/item_spec.rb +119 -0
  44. data/spec/lib/xero/models/line_item_spec.rb +12 -0
  45. data/spec/lib/xero/models/payment_spec.rb +4 -0
  46. data/spec/lib/xero/models/phone_spec.rb +15 -0
  47. data/spec/lib/xero/models/tracking_category_option_spec.rb +4 -0
  48. data/spec/lib/xero/models/tracking_category_spec.rb +4 -0
  49. data/spec/spec_helper.rb +28 -0
  50. data/spec/support/find_account.xml +13 -0
  51. data/spec/support/helpers.rb +9 -0
  52. data/spec/support/vcr.rb +6 -0
  53. data/spec/vcr_cassettes/contact.yml +66 -0
  54. data/spec/vcr_cassettes/contacts.yml +66 -0
  55. data/spec/vcr_cassettes/create_item.yml +67 -0
  56. data/spec/vcr_cassettes/get_invoice.yml +79 -0
  57. data/spec/vcr_cassettes/get_item.yml +61 -0
  58. data/spec/vcr_cassettes/get_items.yml +67 -0
  59. data/spec/vcr_cassettes/invoices.yml +62 -0
  60. data/xero.gemspec +30 -0
  61. metadata +274 -0
@@ -0,0 +1,13 @@
1
+ <Accounts>
2
+ <Account>
3
+ <AccountID>297c2dc5-cc47-4afd-8ec8-74990b8761e9</AccountID>
4
+ <Code/>
5
+ <Name>BNZ Cheque Account</Name>
6
+ <Type>BANK</Type>
7
+ <TaxType>NONE</TaxType>
8
+ <EnablePaymentsToAccount>false</EnablePaymentsToAccount>
9
+ <BankAccountNumber>3809087654321500</BankAccountNumber>
10
+ <CurrencyCode>NZD</CurrencyCode>
11
+ </Account>
12
+ </Accounts>
13
+
@@ -0,0 +1,9 @@
1
+ module Helpers
2
+ def configure
3
+ Xero.configure do |config|
4
+ config.consumer_key = 'TYMATGTPO5QEAWP8I307AOMBHSOJI2'
5
+ config.consumer_secret = 'VWZPP3PBRGERW7UFSULKZMBRZDRXIM'
6
+ config.private_key_path = 'spec/support/privatekey.pem'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/vcr_cassettes'
5
+ c.hook_into :fakeweb
6
+ end
@@ -0,0 +1,66 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.xero.com/api.xro/2.0/Contacts/9685e9b2-2219-4257-9a50-2f91f240b165
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - OAuth gem v0.4.7
14
+ authorization:
15
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="qtJnJ4xJbLO519OHDnGtgaDSUK5mfGdH7vJkJ2syM4",
16
+ oauth_signature="eGLzjbZkdV9OK525YCLjTWJimjSFhGjLH2fUL26R7PonxEdsOzk9VAk%2F9LwbSs2aN5tZpiC8SccGJyMaWaf2BNJm42LTP9wakzWwXn%2FMOcBoxr880%2FDTDYsf3UubpID%2BqcXL7wFhuyo%2FN%2F%2FIS9V%2F8UVzNl9c5JopQlzQkuQ5AKE%3D",
17
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351947173", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
18
+ oauth_version="1.0"
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ cache-control:
25
+ - private
26
+ content-type:
27
+ - text/xml; charset=utf-8
28
+ server:
29
+ - Microsoft-IIS/7.0
30
+ x-aspnetmvc-version:
31
+ - '2.0'
32
+ www-authenticate:
33
+ - OAuth Realm="api.xero.com"
34
+ x-aspnet-version:
35
+ - 4.0.30319
36
+ x-s:
37
+ - api2
38
+ x-powered-by:
39
+ - ASP.NET
40
+ date:
41
+ - Sat, 03 Nov 2012 12:52:45 GMT
42
+ connection:
43
+ - close
44
+ content-length:
45
+ - '1299'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
49
+ \ <Id>7b9fafb6-9497-4cf4-9d99-0115c2995b2b</Id>\r\n <Status>OK</Status>\r\n
50
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-11-03T12:52:45.6421493Z</DateTimeUTC>\r\n
51
+ \ <Contacts>\r\n <Contact>\r\n <ContactID>9685e9b2-2219-4257-9a50-2f91f240b165</ContactID>\r\n
52
+ \ <ContactStatus>ACTIVE</ContactStatus>\r\n <Name>Just Testing</Name>\r\n
53
+ \ <FirstName>Test</FirstName>\r\n <LastName>Person</LastName>\r\n
54
+ \ <EmailAddress>matt@geeland.com</EmailAddress>\r\n <Addresses>\r\n
55
+ \ <Address>\r\n <AddressType>STREET</AddressType>\r\n </Address>\r\n
56
+ \ <Address>\r\n <AddressType>POBOX</AddressType>\r\n </Address>\r\n
57
+ \ </Addresses>\r\n <Phones>\r\n <Phone>\r\n <PhoneType>DDI</PhoneType>\r\n
58
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>DEFAULT</PhoneType>\r\n
59
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>MOBILE</PhoneType>\r\n
60
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>FAX</PhoneType>\r\n
61
+ \ </Phone>\r\n </Phones>\r\n <UpdatedDateUTC>2012-10-30T13:59:49.787</UpdatedDateUTC>\r\n
62
+ \ <IsSupplier>false</IsSupplier>\r\n <IsCustomer>true</IsCustomer>\r\n
63
+ \ </Contact>\r\n </Contacts>\r\n</Response>"
64
+ http_version: '1.1'
65
+ recorded_at: Sat, 03 Nov 2012 12:52:55 GMT
66
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,66 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.xero.com/api.xro/2.0/Contacts
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - OAuth gem v0.4.7
14
+ authorization:
15
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="SIXbEqGcuWoME584M9SOfFWRkIgDNLBMuCg11PKFYMU",
16
+ oauth_signature="v9LkkrZBPkhSQHTp56WQwqwK9aVXAw0zfd9MEhM7xugzRChSDa8NsVT%2FKrSTxdHDFdbXTThPh0pl96earuEkhPH%2F%2F1wsRbU7Oo4Bdd66XiA3o%2FyXDCLfBKgkyuQhc%2F4Ei1A7XRQhfnHMtASyN2vKWgviFkpAvEAXplSqN6YeOws%3D",
17
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351946779", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
18
+ oauth_version="1.0"
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ cache-control:
25
+ - private
26
+ content-type:
27
+ - text/xml; charset=utf-8
28
+ server:
29
+ - Microsoft-IIS/7.0
30
+ x-aspnetmvc-version:
31
+ - '2.0'
32
+ www-authenticate:
33
+ - OAuth Realm="api.xero.com"
34
+ x-aspnet-version:
35
+ - 4.0.30319
36
+ x-s:
37
+ - api1
38
+ x-powered-by:
39
+ - ASP.NET
40
+ date:
41
+ - Sat, 03 Nov 2012 12:46:11 GMT
42
+ connection:
43
+ - close
44
+ content-length:
45
+ - '1299'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
49
+ \ <Id>84efa3ce-c0d6-4fa6-8262-854b16e67d8f</Id>\r\n <Status>OK</Status>\r\n
50
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-11-03T12:46:11.8638402Z</DateTimeUTC>\r\n
51
+ \ <Contacts>\r\n <Contact>\r\n <ContactID>9685e9b2-2219-4257-9a50-2f91f240b165</ContactID>\r\n
52
+ \ <ContactStatus>ACTIVE</ContactStatus>\r\n <Name>Just Testing</Name>\r\n
53
+ \ <FirstName>Test</FirstName>\r\n <LastName>Person</LastName>\r\n
54
+ \ <EmailAddress>matt@geeland.com</EmailAddress>\r\n <Addresses>\r\n
55
+ \ <Address>\r\n <AddressType>STREET</AddressType>\r\n </Address>\r\n
56
+ \ <Address>\r\n <AddressType>POBOX</AddressType>\r\n </Address>\r\n
57
+ \ </Addresses>\r\n <Phones>\r\n <Phone>\r\n <PhoneType>DDI</PhoneType>\r\n
58
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>DEFAULT</PhoneType>\r\n
59
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>MOBILE</PhoneType>\r\n
60
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>FAX</PhoneType>\r\n
61
+ \ </Phone>\r\n </Phones>\r\n <UpdatedDateUTC>2012-10-30T13:59:49.787</UpdatedDateUTC>\r\n
62
+ \ <IsSupplier>false</IsSupplier>\r\n <IsCustomer>true</IsCustomer>\r\n
63
+ \ </Contact>\r\n </Contacts>\r\n</Response>"
64
+ http_version: '1.1'
65
+ recorded_at: Sat, 03 Nov 2012 12:46:21 GMT
66
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.xero.com/api.xro/2.0/Items
6
+ body:
7
+ encoding: US-ASCII
8
+ string: xml=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3CItem%3E%0A%20%20%3CCode%3Etest-product%3C%2FCode%3E%0A%20%20%3CDescription%3Ejust%20testing%3C%2FDescription%3E%0A%20%20%3CPurchaseDetails%3E%0A%20%20%20%20%3CUnitPrice%3E100.0%3C%2FUnitPrice%3E%0A%20%20%20%20%3CAccountCode%3E620%3C%2FAccountCode%3E%0A%20%20%20%20%3CTaxType%3ENONE%3C%2FTaxType%3E%0A%20%20%3C%2FPurchaseDetails%3E%0A%20%20%3CSalesDetails%3E%0A%20%20%20%20%3CUnitPrice%3E550.0%3C%2FUnitPrice%3E%0A%20%20%20%20%3CAccountCode%3E200%3C%2FAccountCode%3E%0A%20%20%20%20%3CTaxType%3ENONE%3C%2FTaxType%3E%0A%20%20%3C%2FSalesDetails%3E%0A%3C%2FItem%3E%0A
9
+ headers:
10
+ charset:
11
+ - utf-8
12
+ accept:
13
+ - ! '*/*'
14
+ user-agent:
15
+ - OAuth gem v0.4.7
16
+ content-length:
17
+ - '0'
18
+ content-type:
19
+ - application/x-www-form-urlencoded
20
+ authorization:
21
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="WjHGnLnDnucxzf3E3rmQtp0tMc6XvhgRztaGoWvnak",
22
+ oauth_signature="cRcWMsungkPWhPLkIHjjiKC3N0eRk4W%2BJQJWR%2BIg5u4B63xjWTf7VDtwid3qOUhkmSNiifj2QrcEf6VzCY7sI80qKqCOal7nOIkhPTm6bAwT%2BhK08lHJXx1hFj5UWGk7qv%2BXiJuuvCdRJIr5tibSxCUC6HQCiMW7wUmNkpw3p88%3D",
23
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351722739", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
24
+ oauth_version="1.0"
25
+ response:
26
+ status:
27
+ code: 200
28
+ message: OK
29
+ headers:
30
+ cache-control:
31
+ - private
32
+ content-type:
33
+ - text/xml; charset=utf-8
34
+ server:
35
+ - Microsoft-IIS/7.0
36
+ x-aspnetmvc-version:
37
+ - '2.0'
38
+ www-authenticate:
39
+ - OAuth Realm="api.xero.com"
40
+ x-aspnet-version:
41
+ - 4.0.30319
42
+ x-s:
43
+ - api1
44
+ x-powered-by:
45
+ - ASP.NET
46
+ date:
47
+ - Wed, 31 Oct 2012 22:32:15 GMT
48
+ connection:
49
+ - close
50
+ content-length:
51
+ - '866'
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
55
+ \ <Id>ea6d3a7e-3d84-42d8-9eb4-e750c5fa2215</Id>\r\n <Status>OK</Status>\r\n
56
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-10-31T22:32:16.3097322Z</DateTimeUTC>\r\n
57
+ \ <Items>\r\n <Item>\r\n <ItemID>bedd53d2-1a98-4184-b947-e4947af3cbc6</ItemID>\r\n
58
+ \ <Code>test-product</Code>\r\n <Description>just testing</Description>\r\n
59
+ \ <UpdatedDateUTC>2012-10-31T22:32:16.28</UpdatedDateUTC>\r\n <PurchaseDetails>\r\n
60
+ \ <UnitPrice>100.00</UnitPrice>\r\n <AccountCode>620</AccountCode>\r\n
61
+ \ <TaxType>NONE</TaxType>\r\n </PurchaseDetails>\r\n <SalesDetails>\r\n
62
+ \ <UnitPrice>550.00</UnitPrice>\r\n <AccountCode>200</AccountCode>\r\n
63
+ \ <TaxType>NONE</TaxType>\r\n </SalesDetails>\r\n </Item>\r\n
64
+ \ </Items>\r\n</Response>"
65
+ http_version: '1.1'
66
+ recorded_at: Wed, 31 Oct 2012 22:32:22 GMT
67
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.xero.com/api.xro/2.0/Invoices/7f9e9823-f6d7-4302-90a1-ba59f6884ce9
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - OAuth gem v0.4.7
14
+ authorization:
15
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="6gmKw9BCOsTNFYJdsLh7PGtvbvp1R590N6fva9T3xtI",
16
+ oauth_signature="ookyqRQHjQtbq19FCojYB6Y1ih%2FTCnUY%2Bsgd1vs10O0Z99PsRJ6zBwZYnjvWpBNjvB0dI8yz87U%2BxwkQcRKGiONpTWKZOcu7%2BJ3J5wk4fjBvvaxzdnzEinOSwMV2v2l6xs6GKZnSud%2F%2BmGmMFOlftf18g%2BcSXi%2Bzr%2B2kZ49vhuA%3D",
17
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351854523", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
18
+ oauth_version="1.0"
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ cache-control:
25
+ - private
26
+ content-type:
27
+ - text/xml; charset=utf-8
28
+ server:
29
+ - Microsoft-IIS/7.0
30
+ x-aspnetmvc-version:
31
+ - '2.0'
32
+ www-authenticate:
33
+ - OAuth Realm="api.xero.com"
34
+ x-aspnet-version:
35
+ - 4.0.30319
36
+ x-s:
37
+ - api1
38
+ x-powered-by:
39
+ - ASP.NET
40
+ date:
41
+ - Fri, 02 Nov 2012 11:08:53 GMT
42
+ connection:
43
+ - close
44
+ content-length:
45
+ - '2533'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
49
+ \ <Id>ab149d9f-f1c0-442d-a8c7-cd5008933e31</Id>\r\n <Status>OK</Status>\r\n
50
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-11-02T11:08:53.143424Z</DateTimeUTC>\r\n
51
+ \ <Invoices>\r\n <Invoice>\r\n <Contact>\r\n <ContactID>9685e9b2-2219-4257-9a50-2f91f240b165</ContactID>\r\n
52
+ \ <ContactStatus>ACTIVE</ContactStatus>\r\n <Name>Just Testing</Name>\r\n
53
+ \ <FirstName>Test</FirstName>\r\n <LastName>Person</LastName>\r\n
54
+ \ <EmailAddress>matt@geeland.com</EmailAddress>\r\n <Addresses>\r\n
55
+ \ <Address>\r\n <AddressType>STREET</AddressType>\r\n </Address>\r\n
56
+ \ <Address>\r\n <AddressType>POBOX</AddressType>\r\n </Address>\r\n
57
+ \ </Addresses>\r\n <Phones>\r\n <Phone>\r\n <PhoneType>DDI</PhoneType>\r\n
58
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>DEFAULT</PhoneType>\r\n
59
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>MOBILE</PhoneType>\r\n
60
+ \ </Phone>\r\n <Phone>\r\n <PhoneType>FAX</PhoneType>\r\n
61
+ \ </Phone>\r\n </Phones>\r\n <UpdatedDateUTC>2012-10-30T13:59:49.787</UpdatedDateUTC>\r\n
62
+ \ <IsSupplier>false</IsSupplier>\r\n <IsCustomer>true</IsCustomer>\r\n
63
+ \ </Contact>\r\n <Date>2012-12-01T00:00:00</Date>\r\n <DueDate>2012-12-03T00:00:00</DueDate>\r\n
64
+ \ <Status>AUTHORISED</Status>\r\n <LineAmountTypes>Exclusive</LineAmountTypes>\r\n
65
+ \ <LineItems>\r\n <LineItem>\r\n <Description>Just Testing</Description>\r\n
66
+ \ <UnitAmount>995.00</UnitAmount>\r\n <TaxType>OUTPUT</TaxType>\r\n
67
+ \ <TaxAmount>0.00</TaxAmount>\r\n <LineAmount>995.00</LineAmount>\r\n
68
+ \ <AccountCode>200</AccountCode>\r\n <ItemCode>monster</ItemCode>\r\n
69
+ \ <Quantity>1.0000</Quantity>\r\n </LineItem>\r\n </LineItems>\r\n
70
+ \ <SubTotal>995.00</SubTotal>\r\n <TotalTax>0.00</TotalTax>\r\n <Total>995.00</Total>\r\n
71
+ \ <UpdatedDateUTC>2012-10-30T13:58:46.433</UpdatedDateUTC>\r\n <CurrencyCode>EUR</CurrencyCode>\r\n
72
+ \ <Type>ACCREC</Type>\r\n <InvoiceID>7f9e9823-f6d7-4302-90a1-ba59f6884ce9</InvoiceID>\r\n
73
+ \ <InvoiceNumber>INV-0001</InvoiceNumber>\r\n <AmountDue>995.00</AmountDue>\r\n
74
+ \ <AmountPaid>0.00</AmountPaid>\r\n <SentToContact>false</SentToContact>\r\n
75
+ \ <CurrencyRate>1.000000</CurrencyRate>\r\n <HasAttachments>false</HasAttachments>\r\n
76
+ \ </Invoice>\r\n </Invoices>\r\n</Response>"
77
+ http_version: '1.1'
78
+ recorded_at: Fri, 02 Nov 2012 11:08:54 GMT
79
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,61 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.xero.com/api.xro/2.0/Items/99213658-83c4-438a-b104-1172b1e69790
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - OAuth gem v0.4.7
14
+ authorization:
15
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="Ge836OV5Rp9fcFOwuiqOZDIzPVC9Axu1vFo90Fyg",
16
+ oauth_signature="UGjzOl23HElYnJ6uNTH0WyRTnBSXLK%2Fpq3prqgF5TLW5V3t7nS8cTL78VEyevn8S%2BSKVhkg1YAs%2FDtBMK1vyO8MJM0K8E5VZp1l8GHKOCl4IkBwwv%2Bk6iCG9G8w3X0iij0bCGDUJU9kVmxr3niBC4GsBZt5Ji%2FMj22Uk3ul%2Flnc%3D",
17
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351722300", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
18
+ oauth_version="1.0"
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ cache-control:
25
+ - private
26
+ content-type:
27
+ - text/xml; charset=utf-8
28
+ server:
29
+ - Microsoft-IIS/7.0
30
+ x-aspnetmvc-version:
31
+ - '2.0'
32
+ www-authenticate:
33
+ - OAuth Realm="api.xero.com"
34
+ x-aspnet-version:
35
+ - 4.0.30319
36
+ x-s:
37
+ - api2
38
+ x-powered-by:
39
+ - ASP.NET
40
+ date:
41
+ - Wed, 31 Oct 2012 22:24:56 GMT
42
+ connection:
43
+ - close
44
+ content-length:
45
+ - '864'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
49
+ \ <Id>582bf4e5-d340-494a-954d-d35d3b41552c</Id>\r\n <Status>OK</Status>\r\n
50
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-10-31T22:24:56.5094556Z</DateTimeUTC>\r\n
51
+ \ <Items>\r\n <Item>\r\n <ItemID>99213658-83c4-438a-b104-1172b1e69790</ItemID>\r\n
52
+ \ <Code>monster</Code>\r\n <Description>Just Testing</Description>\r\n
53
+ \ <UpdatedDateUTC>2012-10-27T17:50:23.633</UpdatedDateUTC>\r\n <PurchaseDetails>\r\n
54
+ \ <UnitPrice>900.00</UnitPrice>\r\n <AccountCode>620</AccountCode>\r\n
55
+ \ <TaxType>NONE</TaxType>\r\n </PurchaseDetails>\r\n <SalesDetails>\r\n
56
+ \ <UnitPrice>995.00</UnitPrice>\r\n <AccountCode>200</AccountCode>\r\n
57
+ \ <TaxType>OUTPUT</TaxType>\r\n </SalesDetails>\r\n </Item>\r\n
58
+ \ </Items>\r\n</Response>"
59
+ http_version: '1.1'
60
+ recorded_at: Wed, 31 Oct 2012 22:25:02 GMT
61
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.xero.com/api.xro/2.0/Items
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - OAuth gem v0.4.7
14
+ authorization:
15
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="G24UhIQgnPuY1mwi1DJmix101h9HWySKyHwk2KEuLM",
16
+ oauth_signature="Mj3GZT6NH33hpgTS1MEr76nqYuxRFJd9yOIEpTZIyWk5YjYI0WrCrB03Vxyy8wzb2sSOl1iUJ1ZpvcSue37ZeatfxbwR3qDvvxJHDRrQUfE8wj5vByQej9wA2%2BIs0tJYN%2FcRMn2Jv%2BJ1N%2BDXGKuziF98elzjEpjYAUPAPxVVwO8%3D",
17
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351722302", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
18
+ oauth_version="1.0"
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ cache-control:
25
+ - private
26
+ content-type:
27
+ - text/xml; charset=utf-8
28
+ server:
29
+ - Microsoft-IIS/7.0
30
+ x-aspnetmvc-version:
31
+ - '2.0'
32
+ www-authenticate:
33
+ - OAuth Realm="api.xero.com"
34
+ x-aspnet-version:
35
+ - 4.0.30319
36
+ x-s:
37
+ - api2
38
+ x-powered-by:
39
+ - ASP.NET
40
+ date:
41
+ - Wed, 31 Oct 2012 22:24:57 GMT
42
+ connection:
43
+ - close
44
+ content-length:
45
+ - '1366'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
49
+ \ <Id>c4b25892-8731-48cc-b355-d90a95b312fd</Id>\r\n <Status>OK</Status>\r\n
50
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-10-31T22:24:58.478193Z</DateTimeUTC>\r\n
51
+ \ <Items>\r\n <Item>\r\n <ItemID>99213658-83c4-438a-b104-1172b1e69790</ItemID>\r\n
52
+ \ <Code>monster</Code>\r\n <Description>Just Testing</Description>\r\n
53
+ \ <UpdatedDateUTC>2012-10-27T17:50:23.633</UpdatedDateUTC>\r\n <PurchaseDetails>\r\n
54
+ \ <UnitPrice>900.00</UnitPrice>\r\n <AccountCode>620</AccountCode>\r\n
55
+ \ <TaxType>NONE</TaxType>\r\n </PurchaseDetails>\r\n <SalesDetails>\r\n
56
+ \ <UnitPrice>995.00</UnitPrice>\r\n <AccountCode>200</AccountCode>\r\n
57
+ \ <TaxType>OUTPUT</TaxType>\r\n </SalesDetails>\r\n </Item>\r\n
58
+ \ <Item>\r\n <ItemID>16cb4513-626b-4f14-a8be-ec505f5b8934</ItemID>\r\n
59
+ \ <Code>stepstone</Code>\r\n <UpdatedDateUTC>2012-10-31T08:59:58.013</UpdatedDateUTC>\r\n
60
+ \ <PurchaseDetails>\r\n <UnitPrice>500.00</UnitPrice>\r\n <AccountCode>620</AccountCode>\r\n
61
+ \ <TaxType>NONE</TaxType>\r\n </PurchaseDetails>\r\n <SalesDetails>\r\n
62
+ \ <UnitPrice>1095.00</UnitPrice>\r\n <AccountCode>200</AccountCode>\r\n
63
+ \ <TaxType>OUTPUT</TaxType>\r\n </SalesDetails>\r\n </Item>\r\n
64
+ \ </Items>\r\n</Response>"
65
+ http_version: '1.1'
66
+ recorded_at: Wed, 31 Oct 2012 22:25:04 GMT
67
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.xero.com/api.xro/2.0/Invoices
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ accept:
11
+ - ! '*/*'
12
+ user-agent:
13
+ - OAuth gem v0.4.7
14
+ authorization:
15
+ - OAuth oauth_consumer_key="TYMATGTPO5QEAWP8I307AOMBHSOJI2", oauth_nonce="9i3qSOxueUMxVHVtQNfFzcO30XJfQaMp4micswOA64",
16
+ oauth_signature="hRKXYSNYtW7JdoV9ls5XmLMj4y7OF68e1%2F%2BjwBIBnNLCPWEBYCURpL8orhntH%2FSQwrDSqjUG5igV2WijidCOcEs%2FmMpBt5SjgHVHsv7lPfPqlLaF3dePKOPYLLL8%2BhqzAxmLTicHboKzcm%2FUopUzm%2BFrpovov0GLuHeKH2Kkefg%3D",
17
+ oauth_signature_method="RSA-SHA1", oauth_timestamp="1351930677", oauth_token="TYMATGTPO5QEAWP8I307AOMBHSOJI2",
18
+ oauth_version="1.0"
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ cache-control:
25
+ - private
26
+ content-type:
27
+ - text/xml; charset=utf-8
28
+ server:
29
+ - Microsoft-IIS/7.0
30
+ x-aspnetmvc-version:
31
+ - '2.0'
32
+ www-authenticate:
33
+ - OAuth Realm="api.xero.com"
34
+ x-aspnet-version:
35
+ - 4.0.30319
36
+ x-s:
37
+ - api1
38
+ x-powered-by:
39
+ - ASP.NET
40
+ date:
41
+ - Sat, 03 Nov 2012 08:17:58 GMT
42
+ connection:
43
+ - close
44
+ content-length:
45
+ - '1128'
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ! "<Response xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n
49
+ \ <Id>c2e9a9bf-9e4c-4720-81cb-fa6c80a4ae6d</Id>\r\n <Status>OK</Status>\r\n
50
+ \ <ProviderName>GoHiring</ProviderName>\r\n <DateTimeUTC>2012-11-03T08:17:58.8617518Z</DateTimeUTC>\r\n
51
+ \ <Invoices>\r\n <Invoice>\r\n <Contact>\r\n <ContactID>9685e9b2-2219-4257-9a50-2f91f240b165</ContactID>\r\n
52
+ \ <Name>Just Testing</Name>\r\n </Contact>\r\n <Date>2012-12-01T00:00:00</Date>\r\n
53
+ \ <DueDate>2012-12-03T00:00:00</DueDate>\r\n <Status>AUTHORISED</Status>\r\n
54
+ \ <LineAmountTypes>Exclusive</LineAmountTypes>\r\n <SubTotal>995.00</SubTotal>\r\n
55
+ \ <TotalTax>0.00</TotalTax>\r\n <Total>995.00</Total>\r\n <UpdatedDateUTC>2012-10-30T13:58:46.433</UpdatedDateUTC>\r\n
56
+ \ <CurrencyCode>EUR</CurrencyCode>\r\n <Type>ACCREC</Type>\r\n <InvoiceID>7f9e9823-f6d7-4302-90a1-ba59f6884ce9</InvoiceID>\r\n
57
+ \ <InvoiceNumber>INV-0001</InvoiceNumber>\r\n <AmountDue>995.00</AmountDue>\r\n
58
+ \ <AmountPaid>0.00</AmountPaid>\r\n <HasAttachments>false</HasAttachments>\r\n
59
+ \ </Invoice>\r\n </Invoices>\r\n</Response>"
60
+ http_version: '1.1'
61
+ recorded_at: Sat, 03 Nov 2012 08:17:59 GMT
62
+ recorded_with: VCR 2.2.5
data/xero.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'xero/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'xero'
8
+ gem.version = Xero::VERSION
9
+ gem.authors = ['Matt Beedle']
10
+ gem.email = ['mattbeedle@googlemail.com']
11
+ gem.description = %q{Library for communicating with the xero API}
12
+ gem.summary = %q{Library for communicating with the xero API}
13
+ gem.homepage = 'https://github.com/mattbeedle/xero'
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ['lib']
19
+
20
+ gem.add_dependency('active_attr')
21
+ gem.add_dependency('oauth')
22
+
23
+ gem.add_development_dependency('fakeweb')
24
+ gem.add_development_dependency('guard')
25
+ gem.add_development_dependency('guard-rspec')
26
+ gem.add_development_dependency('rb-fsevent')
27
+ gem.add_development_dependency('rspec')
28
+ gem.add_development_dependency('shoulda-matchers')
29
+ gem.add_development_dependency('vcr')
30
+ end