octobat 2.0.9 → 2.0.15
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 +4 -4
- data/Gemfile.lock +5 -5
- data/History.txt +20 -0
- data/VERSION +1 -1
- data/lib/octobat.rb +3 -0
- data/lib/octobat/balance_transaction.rb +0 -1
- data/lib/octobat/octobat_object.rb +10 -9
- data/lib/octobat/order.rb +38 -0
- data/lib/octobat/payout.rb +11 -0
- data/lib/octobat/product.rb +8 -0
- data/lib/octobat/proforma_invoice.rb +6 -0
- data/lib/octobat/tax_evidence_request.rb +12 -0
- data/lib/octobat/util.rb +3 -0
- data/lib/octobat/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398fb5a2fdfffa2fbf3070966ec6c80f1f90d857
|
4
|
+
data.tar.gz: 3313c4fc5d1795c294e32734413e078dc3da037b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adcf04a1cc3be3a330eae051dc5f1b5c4704989d35bc99ffb3fc7439d106acd2e1de136708416c5499fd5839f724dec8ed6675cc0cb0f3721dd1e6ee9d2b373f
|
7
|
+
data.tar.gz: 9276bda438fcf9e9e1505fdaec5e9cddc8cfa2896920872b1b228d5ae697834952aa8f279419e8a30e5eb599f2384ae87b462c753e3bf04d7e2c00bf567e1eaf
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
octobat (2.0.
|
4
|
+
octobat (2.0.15)
|
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.
|
10
|
+
domain_name (0.5.20190701)
|
11
11
|
unf (>= 0.0.5, < 1.0.0)
|
12
12
|
http-cookie (1.0.3)
|
13
13
|
domain_name (~> 0.5)
|
14
|
-
mime-types (3.
|
14
|
+
mime-types (3.2.2)
|
15
15
|
mime-types-data (~> 3.2015)
|
16
|
-
mime-types-data (3.
|
16
|
+
mime-types-data (3.2019.0331)
|
17
17
|
netrc (0.11.0)
|
18
18
|
rest-client (2.0.2)
|
19
19
|
http-cookie (>= 1.0.2, < 2.0)
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
netrc (~> 0.8)
|
22
22
|
unf (0.1.4)
|
23
23
|
unf_ext
|
24
|
-
unf_ext (0.0.7.
|
24
|
+
unf_ext (0.0.7.6)
|
25
25
|
|
26
26
|
PLATFORMS
|
27
27
|
ruby
|
data/History.txt
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
=== 2.0.15 2019-09-10
|
2
|
+
* 1 minor enhancement:
|
3
|
+
* Add Setup Intent statuses support for Orders
|
4
|
+
|
5
|
+
=== 2.0.14 2019-07-24
|
6
|
+
* 1 minor enhancement:
|
7
|
+
* Add Order
|
8
|
+
|
9
|
+
=== 2.0.13 2019-05-20
|
10
|
+
* 1 minor enhancement:
|
11
|
+
* Add ProformaInvoices
|
12
|
+
|
13
|
+
=== 2.0.11 2018-04-10
|
14
|
+
* 1 minor enhancement:
|
15
|
+
* Add CSV exports for payouts
|
16
|
+
|
17
|
+
=== 2.0.10 2018-03-08
|
18
|
+
* 1 minor enhancement:
|
19
|
+
* Add Tax Evidences Requests for supplier & customer data
|
20
|
+
|
1
21
|
=== 2.0.9 2017-10-02
|
2
22
|
* 1 minor enhancement:
|
3
23
|
* Add PDF exports for credit notes
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.15
|
data/lib/octobat.rb
CHANGED
@@ -29,6 +29,7 @@ require 'octobat/item'
|
|
29
29
|
require 'octobat/document'
|
30
30
|
require 'octobat/invoice'
|
31
31
|
require 'octobat/credit_note'
|
32
|
+
require 'octobat/proforma_invoice'
|
32
33
|
require 'octobat/payment_recipient'
|
33
34
|
require 'octobat/payment_recipient_reference'
|
34
35
|
require 'octobat/payment_source'
|
@@ -40,6 +41,8 @@ require 'octobat/document_template'
|
|
40
41
|
require 'octobat/document_language'
|
41
42
|
require 'octobat/checkout'
|
42
43
|
require 'octobat/coupon'
|
44
|
+
require 'octobat/order'
|
45
|
+
require 'octobat/product'
|
43
46
|
require 'octobat/tax_region_setting'
|
44
47
|
require 'octobat/tax_evidence'
|
45
48
|
require 'octobat/tax_evidence_request'
|
@@ -57,10 +57,11 @@ module Octobat
|
|
57
57
|
# customer, where there is no persistent card parameter. Mark those values
|
58
58
|
# which don't persist as transient
|
59
59
|
|
60
|
-
instance_eval do
|
61
|
-
|
62
|
-
|
63
|
-
end
|
60
|
+
#instance_eval do
|
61
|
+
remove_accessors(removed)
|
62
|
+
add_accessors(added)
|
63
|
+
#end
|
64
|
+
|
64
65
|
removed.each do |k|
|
65
66
|
@values.delete(k)
|
66
67
|
@transient_values.add(k)
|
@@ -141,9 +142,10 @@ module Octobat
|
|
141
142
|
metaclass.instance_eval do
|
142
143
|
keys.each do |k|
|
143
144
|
next if @@permanent_attributes.include?(k)
|
144
|
-
|
145
|
-
|
146
|
-
|
145
|
+
|
146
|
+
[k, :"#{k}="].each do |method_name|
|
147
|
+
remove_method(method_name) if method_defined?(method_name)
|
148
|
+
end
|
147
149
|
end
|
148
150
|
end
|
149
151
|
end
|
@@ -152,9 +154,8 @@ module Octobat
|
|
152
154
|
metaclass.instance_eval do
|
153
155
|
keys.each do |k|
|
154
156
|
next if @@permanent_attributes.include?(k)
|
155
|
-
k_eq = :"#{k}="
|
156
157
|
define_method(k) { @values[k] }
|
157
|
-
define_method(
|
158
|
+
define_method(:"#{k}=") do |v|
|
158
159
|
=begin
|
159
160
|
if v == ""
|
160
161
|
raise ArgumentError.new(
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Octobat
|
2
|
+
class Order < APIResource
|
3
|
+
extend Octobat::APIOperations::List
|
4
|
+
|
5
|
+
def expire
|
6
|
+
response, api_key = Octobat.request(:patch, expire_url, @api_key)
|
7
|
+
refresh_from(response, api_key)
|
8
|
+
end
|
9
|
+
|
10
|
+
def update_payment_intent_status(payment_intent_status_data = {})
|
11
|
+
response, api_key = Octobat.request(:patch, update_payment_intent_status_url, @api_key, payment_intent_status_data)
|
12
|
+
refresh_from(response, api_key)
|
13
|
+
end
|
14
|
+
|
15
|
+
def update_setup_intent_status(setup_intent_status_data = {})
|
16
|
+
response, api_key = Octobat.request(:patch, update_setup_intent_status_url, @api_key, setup_intent_status_data)
|
17
|
+
refresh_from(response, api_key)
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
private
|
22
|
+
def expire_url
|
23
|
+
url + '/expire'
|
24
|
+
end
|
25
|
+
|
26
|
+
def update_payment_intent_status_url
|
27
|
+
url + '/payment_intent_status'
|
28
|
+
end
|
29
|
+
|
30
|
+
def update_setup_intent_status_url
|
31
|
+
url + '/setup_intent_status'
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
end
|
data/lib/octobat/payout.rb
CHANGED
@@ -5,5 +5,16 @@ module Octobat
|
|
5
5
|
def balance_transactions(params = {})
|
6
6
|
BalanceTransaction.list(params.merge({ payout: id }), @api_key)
|
7
7
|
end
|
8
|
+
|
9
|
+
def self.csv_export(params = {}, opts={})
|
10
|
+
api_key, headers = Util.parse_opts(opts)
|
11
|
+
api_key ||= @api_key
|
12
|
+
opts[:api_key] = api_key
|
13
|
+
|
14
|
+
instance = self.new(nil, opts)
|
15
|
+
|
16
|
+
response, api_key = Octobat.request(:post, url + '/csv_export', api_key, params)
|
17
|
+
return true
|
18
|
+
end
|
8
19
|
end
|
9
20
|
end
|
@@ -1,5 +1,17 @@
|
|
1
1
|
module Octobat
|
2
2
|
class TaxEvidenceRequest < APIResource
|
3
3
|
include Octobat::APIOperations::Create
|
4
|
+
|
5
|
+
def self.for_supplier(params = {}, opts={})
|
6
|
+
api_key, headers = Util.parse_opts(opts)
|
7
|
+
api_key ||= @api_key
|
8
|
+
opts[:api_key] = api_key
|
9
|
+
|
10
|
+
instance = self.new(nil, opts)
|
11
|
+
|
12
|
+
response, api_key = Octobat.request(:post, url + '/for_supplier', api_key, params)
|
13
|
+
instance.refresh_from(response, api_key)
|
14
|
+
instance
|
15
|
+
end
|
4
16
|
end
|
5
17
|
end
|
data/lib/octobat/util.rb
CHANGED
@@ -54,6 +54,9 @@ module Octobat
|
|
54
54
|
'document_language' => DocumentLanguage,
|
55
55
|
'checkout' => Checkout,
|
56
56
|
'coupon' => Coupon,
|
57
|
+
'order' => Order,
|
58
|
+
'product' => Product,
|
59
|
+
'proforma_invoice' => ProformaInvoice,
|
57
60
|
'tax_region_setting' => TaxRegionSetting,
|
58
61
|
'transaction' => Transaction,
|
59
62
|
'tax_evidence' => TaxEvidence,
|
data/lib/octobat/version.rb
CHANGED
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.
|
4
|
+
version: 2.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaultier Laperche
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -84,10 +84,13 @@ files:
|
|
84
84
|
- lib/octobat/item.rb
|
85
85
|
- lib/octobat/list_object.rb
|
86
86
|
- lib/octobat/octobat_object.rb
|
87
|
+
- lib/octobat/order.rb
|
87
88
|
- lib/octobat/payment_recipient.rb
|
88
89
|
- lib/octobat/payment_recipient_reference.rb
|
89
90
|
- lib/octobat/payment_source.rb
|
90
91
|
- lib/octobat/payout.rb
|
92
|
+
- lib/octobat/product.rb
|
93
|
+
- lib/octobat/proforma_invoice.rb
|
91
94
|
- lib/octobat/singleton_api_resource.rb
|
92
95
|
- lib/octobat/tax_evidence.rb
|
93
96
|
- lib/octobat/tax_evidence_request.rb
|