octobat 2.0.3 → 2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d461ed3dbe7d31080d96fad8935f59a0f40bb53
4
- data.tar.gz: e108ef50406aed9515710901e6141e83f5e3519f
3
+ metadata.gz: 5747bf388972cd59177703b40d5b6131a06bd322
4
+ data.tar.gz: 5ce860b623beff2db652e4c64a79cd5696ff0dd9
5
5
  SHA512:
6
- metadata.gz: 89a1f2482e1b670ef5a3eee824cbcab0115a7d88cfd1498dcf0283d3c0f487219c8e548297575fd096687e1823b64e650a90a6d92690b79af753f510e4de8d91
7
- data.tar.gz: 9429b4126252cb78ac0865a085d2b52539bc26119404afa686c8a5f4dd236dd4b4a3045dc034cfad06736043e919c1159514f259d6f02e1740f4aab7698a1e55
6
+ metadata.gz: 146ec6a8f21a62fc9d5032037e3572e9a49dae003c93629ef3839b77c1bcb56576476e82100fad9b7fb17dde588c124841f62102aa5dd2495f7dac9fe995cd78
7
+ data.tar.gz: 0279683da36f1b01de5b1d65c8336aa91130589b47814fbfdc6645a7a061bed8cf28c4839b907e54d591f42f335b76fdfd21f6ffe913b36a9ea06b238165530b
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- octobat (2.0.3)
4
+ octobat (2.0.4)
5
5
  rest-client (>= 1.4, < 4.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- domain_name (0.5.20170223)
10
+ domain_name (0.5.20170404)
11
11
  unf (>= 0.0.5, < 1.0.0)
12
12
  http-cookie (1.0.3)
13
13
  domain_name (~> 0.5)
@@ -15,13 +15,13 @@ GEM
15
15
  mime-types-data (~> 3.2015)
16
16
  mime-types-data (3.2016.0521)
17
17
  netrc (0.11.0)
18
- rest-client (2.0.1)
18
+ rest-client (2.0.2)
19
19
  http-cookie (>= 1.0.2, < 2.0)
20
20
  mime-types (>= 1.16, < 4.0)
21
21
  netrc (~> 0.8)
22
22
  unf (0.1.4)
23
23
  unf_ext
24
- unf_ext (0.0.7.2)
24
+ unf_ext (0.0.7.4)
25
25
 
26
26
  PLATFORMS
27
27
  ruby
@@ -1,3 +1,8 @@
1
+ === 2.0.4 2017-05-26
2
+ * 2 minor enhancement:
3
+ * Manage different API versions
4
+ * Add endpoint for payouts & balance transactions
5
+
1
6
  === 2.0.3 2017-04-12
2
7
  * 1 minor enhancement:
3
8
  * Delete customers
@@ -32,12 +37,6 @@
32
37
  === 0.0.5 2015-07-21
33
38
  * 1 minor enhancement:
34
39
  * Add invoices#all customer filter and Customer.invoices method
35
-
36
- === 0.0.1 2015-02-06
37
-
38
- * 1 major enhancement:
39
- * Initial release
40
-
41
40
 
42
41
  === 0.0.12 2016-04-13
43
42
  * 1 minor enhancement:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.4
@@ -32,6 +32,8 @@ require 'octobat/credit_note'
32
32
  require 'octobat/payment_recipient'
33
33
  require 'octobat/payment_recipient_reference'
34
34
  require 'octobat/payment_source'
35
+ require 'octobat/payout'
36
+ require 'octobat/balance_transaction'
35
37
  require 'octobat/invoice_numbering_sequence'
36
38
  require 'octobat/credit_note_numbering_sequence'
37
39
  require 'octobat/document_template'
@@ -19,13 +19,15 @@ module Octobat
19
19
  end
20
20
 
21
21
  def refresh
22
- response, api_key = Octobat.request(:get, url, @api_key, @retrieve_options)
22
+ response, api_key = Octobat.request(:get, url, @api_key, @retrieve_options, @headers)
23
23
  refresh_from(response, api_key)
24
24
  end
25
25
 
26
26
  def self.retrieve(id, opts={})
27
27
  api_key, headers = Util.parse_opts(opts)
28
28
  opts[:api_key] ||= @api_key
29
+
30
+ puts opts.inspect
29
31
 
30
32
  instance = self.new(id, opts)
31
33
  instance.refresh
@@ -0,0 +1,5 @@
1
+ module Octobat
2
+ class BalanceTransaction < APIResource
3
+ extend Octobat::APIOperations::List
4
+ end
5
+ end
@@ -19,10 +19,12 @@ module Octobat
19
19
  else
20
20
  @retrieve_options = {}
21
21
  end
22
-
22
+
23
+ @headers = {}
23
24
  @api_key = opts[:api_key]
24
25
 
25
26
  @retrieve_options.merge!(opts.clone).delete(:api_key)
27
+ @headers['Octobat-Version'] = @retrieve_options.delete('Octobat-Version') if @retrieve_options.has_key?('Octobat-Version')
26
28
 
27
29
  @values = {}
28
30
  # This really belongs in APIResource, but not putting it there allows us
@@ -0,0 +1,5 @@
1
+ module Octobat
2
+ class Payout < APIResource
3
+ extend Octobat::APIOperations::List
4
+ end
5
+ end
@@ -48,6 +48,8 @@ module Octobat
48
48
  'credit_note' => CreditNote,
49
49
  'item' => Item,
50
50
  'customer' => Customer,
51
+ 'payout' => Payout,
52
+ 'balance_transaction' => BalanceTransaction,
51
53
  'document_template' => DocumentTemplate,
52
54
  'document_language' => DocumentLanguage,
53
55
  'checkout' => Checkout,
@@ -1,3 +1,3 @@
1
1
  module Octobat
2
- VERSION = '2.0.3'
2
+ VERSION = '2.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octobat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaultier Laperche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-12 00:00:00.000000000 Z
11
+ date: 2017-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -60,6 +60,7 @@ files:
60
60
  - lib/octobat/api_operations/list.rb
61
61
  - lib/octobat/api_operations/update.rb
62
62
  - lib/octobat/api_resource.rb
63
+ - lib/octobat/balance_transaction.rb
63
64
  - lib/octobat/certificate_blacklist.rb
64
65
  - lib/octobat/checkout.rb
65
66
  - lib/octobat/coupon.rb
@@ -87,6 +88,7 @@ files:
87
88
  - lib/octobat/payment_recipient.rb
88
89
  - lib/octobat/payment_recipient_reference.rb
89
90
  - lib/octobat/payment_source.rb
91
+ - lib/octobat/payout.rb
90
92
  - lib/octobat/singleton_api_resource.rb
91
93
  - lib/octobat/tax_evidence.rb
92
94
  - lib/octobat/tax_evidence_request.rb