killbill-client 0.9.0 → 0.10.0
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/lib/killbill_client/api/net_http_adapter.rb +1 -1
- data/lib/killbill_client/models/catalog.rb +32 -0
- data/lib/killbill_client/models/models.rb +1 -0
- data/lib/killbill_client/models/overdue.rb +34 -0
- data/lib/killbill_client/models/resource.rb +22 -16
- data/lib/killbill_client/version.rb +1 -1
- metadata +16 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75bf7d59e96e17a390cffc8edfb8ab7f90065d45
|
4
|
+
data.tar.gz: e7c652361b59eec8d6652fff1e9121791e00399d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57412421f060377af41b315788714decf20a9c76fcbe2aa3222fd784ad03d848371ca72e0e846887523d147f2021fb46d0a4f8322296101bfd9cc5f56aec7726
|
7
|
+
data.tar.gz: 862723977d20540820b53c2d3c26ad3665cdac65d133b53850d8b8868cafdea5c0993cdc83a8989635d57f8534b99bccc9a1b98f6fcca3c5c7c2999f7425eb04
|
@@ -89,7 +89,7 @@ module KillBillClient
|
|
89
89
|
request['Accept'] = options[:accept]
|
90
90
|
end
|
91
91
|
if options[:body]
|
92
|
-
request['Content-Type'] = content_type
|
92
|
+
request['Content-Type'] = options[:content_type] || content_type
|
93
93
|
request.body = options[:body]
|
94
94
|
end
|
95
95
|
if options[:etag]
|
@@ -28,6 +28,38 @@ module KillBillClient
|
|
28
28
|
options,
|
29
29
|
PlanDetail
|
30
30
|
end
|
31
|
+
|
32
|
+
def get_tenant_catalog(options = {})
|
33
|
+
if options[:api_key].nil? || options[:api_secret].nil?
|
34
|
+
raise ArgumentError, "Retrieving a catalog is only supported in multi-tenant mode"
|
35
|
+
end
|
36
|
+
|
37
|
+
get KILLBILL_API_CATALOG_PREFIX,
|
38
|
+
{},
|
39
|
+
{
|
40
|
+
:head => {'Accept' => 'application/xml'},
|
41
|
+
}.merge(options)
|
42
|
+
end
|
43
|
+
|
44
|
+
def upload_tenant_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {})
|
45
|
+
if options[:api_key].nil? || options[:api_secret].nil?
|
46
|
+
raise ArgumentError, "Uploading a catalog is only supported in multi-tenant mode"
|
47
|
+
end
|
48
|
+
|
49
|
+
post KILLBILL_API_CATALOG_PREFIX,
|
50
|
+
catalog_xml,
|
51
|
+
{
|
52
|
+
},
|
53
|
+
{
|
54
|
+
:head => {'Accept' => 'application/xml'},
|
55
|
+
:content_type => 'application/xml',
|
56
|
+
:user => user,
|
57
|
+
:reason => reason,
|
58
|
+
:comment => comment,
|
59
|
+
}.merge(options)
|
60
|
+
get_tenant_catalog(options)
|
61
|
+
end
|
62
|
+
|
31
63
|
end
|
32
64
|
end
|
33
65
|
end
|
@@ -20,6 +20,7 @@ require 'killbill_client/models/subscription'
|
|
20
20
|
require 'killbill_client/models/bundle'
|
21
21
|
require 'killbill_client/models/account'
|
22
22
|
require 'killbill_client/models/invoice'
|
23
|
+
require 'killbill_client/models/overdue'
|
23
24
|
require 'killbill_client/models/transaction'
|
24
25
|
require 'killbill_client/models/invoice_payment'
|
25
26
|
require 'killbill_client/models/payment'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module KillBillClient
|
2
|
+
module Model
|
3
|
+
class Overdue < OverdueStateAttributes
|
4
|
+
|
5
|
+
KILLBILL_API_OVERDUE_PREFIX = "#{KILLBILL_API_PREFIX}/overdue"
|
6
|
+
|
7
|
+
class << self
|
8
|
+
def get_tenant_overdue_config(options = {})
|
9
|
+
get KILLBILL_API_OVERDUE_PREFIX,
|
10
|
+
{},
|
11
|
+
{
|
12
|
+
:head => {'Accept' => 'application/xml'},
|
13
|
+
}.merge(options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def upload_tenant_overdue_config(overdue_config_xml, user = nil, reason = nil, comment = nil, options = {})
|
17
|
+
post KILLBILL_API_OVERDUE_PREFIX,
|
18
|
+
overdue_config_xml,
|
19
|
+
{
|
20
|
+
},
|
21
|
+
{
|
22
|
+
:head => {'Accept' => 'application/xml'},
|
23
|
+
:content_type => 'application/xml',
|
24
|
+
:user => user,
|
25
|
+
:reason => reason,
|
26
|
+
:comment => comment,
|
27
|
+
}.merge(options)
|
28
|
+
get_tenant_overdue_config(options)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
@@ -57,19 +57,25 @@ module KillBillClient
|
|
57
57
|
# @param response [Net::HTTPResponse]
|
58
58
|
def from_response(resource_class, response)
|
59
59
|
case response['Content-Type']
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
60
|
+
when %r{application/pdf}
|
61
|
+
when %r{text/html}
|
62
|
+
when %r{text/plain}
|
63
|
+
response.body
|
64
|
+
when %r{application/xml}
|
65
|
+
if response.header['location']
|
66
|
+
response.header['location']
|
67
|
+
else
|
68
|
+
response.body
|
69
|
+
end
|
70
|
+
when %r{application/json}
|
71
|
+
record = from_json resource_class, response.body
|
72
|
+
if record.nil?
|
73
|
+
record = resource_class.new
|
74
|
+
record.uri = response.header['location']
|
75
|
+
end
|
70
76
|
|
71
|
-
|
72
|
-
|
77
|
+
session_id = extract_session_id(response)
|
78
|
+
record.instance_eval {
|
73
79
|
@clazz = resource_class
|
74
80
|
@etag = response['ETag']
|
75
81
|
@session_id = session_id
|
@@ -77,10 +83,10 @@ module KillBillClient
|
|
77
83
|
@pagination_total_nb_records = response['X-Killbill-Pagination-TotalNbRecords'].to_i unless response['X-Killbill-Pagination-TotalNbRecords'].nil?
|
78
84
|
@pagination_next_page = response['X-Killbill-Pagination-NextPageUri']
|
79
85
|
@response = response
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
86
|
+
}
|
87
|
+
record
|
88
|
+
else
|
89
|
+
raise ArgumentError, "#{response['Content-Type']} is not supported by the library"
|
84
90
|
end
|
85
91
|
end
|
86
92
|
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Killbill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 10.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 10.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.12.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.12.0
|
55
55
|
description: An API client library for Kill Bill.
|
@@ -58,8 +58,8 @@ executables: []
|
|
58
58
|
extensions: []
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
|
-
- .gitignore
|
62
|
-
- .travis.yml
|
61
|
+
- ".gitignore"
|
62
|
+
- ".travis.yml"
|
63
63
|
- Gemfile
|
64
64
|
- README.md
|
65
65
|
- Rakefile
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/killbill_client/models/invoice_item.rb
|
136
136
|
- lib/killbill_client/models/invoice_payment.rb
|
137
137
|
- lib/killbill_client/models/models.rb
|
138
|
+
- lib/killbill_client/models/overdue.rb
|
138
139
|
- lib/killbill_client/models/payment.rb
|
139
140
|
- lib/killbill_client/models/payment_method.rb
|
140
141
|
- lib/killbill_client/models/phase.rb
|
@@ -167,23 +168,23 @@ licenses:
|
|
167
168
|
metadata: {}
|
168
169
|
post_install_message:
|
169
170
|
rdoc_options:
|
170
|
-
- --exclude
|
171
|
-
- .
|
171
|
+
- "--exclude"
|
172
|
+
- "."
|
172
173
|
require_paths:
|
173
174
|
- lib
|
174
175
|
required_ruby_version: !ruby/object:Gem::Requirement
|
175
176
|
requirements:
|
176
|
-
- -
|
177
|
+
- - ">="
|
177
178
|
- !ruby/object:Gem::Version
|
178
179
|
version: 1.8.6
|
179
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
181
|
requirements:
|
181
|
-
- -
|
182
|
+
- - ">="
|
182
183
|
- !ruby/object:Gem::Version
|
183
184
|
version: '0'
|
184
185
|
requirements: []
|
185
186
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.2.2
|
187
188
|
signing_key:
|
188
189
|
specification_version: 4
|
189
190
|
summary: Kill Bill client library.
|