killbill-client 2.2.3 → 2.3.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/.circleci/config.yml +12 -12
- data/lib/killbill_client/models/account.rb +44 -42
- data/lib/killbill_client/models/bulk_subscription.rb +1 -1
- data/lib/killbill_client/models/bundle.rb +18 -6
- data/lib/killbill_client/models/catalog.rb +77 -8
- data/lib/killbill_client/models/export.rb +1 -1
- data/lib/killbill_client/models/gen/blocking_state_attributes.rb +3 -3
- data/lib/killbill_client/models/gen/credit_attributes.rb +1 -0
- data/lib/killbill_client/models/gen/invoice_item_attributes.rb +2 -0
- data/lib/killbill_client/models/gen/node_command_attributes.rb +1 -1
- data/lib/killbill_client/models/gen/overdue_state_attributes.rb +3 -3
- data/lib/killbill_client/models/gen/overdue_state_config_attributes.rb +2 -2
- data/lib/killbill_client/models/gen/require_gen.rb +53 -54
- data/lib/killbill_client/models/gen/stack_trace_element_attributes.rb +1 -1
- data/lib/killbill_client/models/gen/{tenant_key_attributes.rb → tenant_key_value_attributes.rb} +1 -1
- data/lib/killbill_client/models/helpers/custom_field_helper.rb +21 -0
- data/lib/killbill_client/models/helpers/tag_helper.rb +2 -4
- data/lib/killbill_client/models/invoice.rb +63 -61
- data/lib/killbill_client/models/invoice_item.rb +1 -3
- data/lib/killbill_client/models/invoice_payment.rb +18 -3
- data/lib/killbill_client/models/nodes_info.rb +1 -1
- data/lib/killbill_client/models/overdue.rb +33 -13
- data/lib/killbill_client/models/payment_method.rb +1 -1
- data/lib/killbill_client/models/resource.rb +3 -1
- data/lib/killbill_client/models/subscription.rb +19 -17
- data/lib/killbill_client/models/tenant.rb +2 -2
- data/lib/killbill_client/models/transaction.rb +2 -0
- data/lib/killbill_client/version.rb +2 -2
- data/spec/killbill_client/remote/api_spec.rb +1 -1
- data/spec/killbill_client/remote/model_spec.rb +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83130edfd69e4755b2870008a499dffbf8018514
|
4
|
+
data.tar.gz: adc1f2acc20d39b5b360209ffc71141fe0863af9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c90240811ecbbc19b9ef1e390e2005d7fb2826d035490107d9f2d84335df929ed1d8451704169149dd1a21eccad2afb7c307294ed0b2ec6d76f980c833b59eb8
|
7
|
+
data.tar.gz: d71174faf6cb5493963550de3dd2dde1542e74a6bc53b85282242a02d14c5cdf61f546c52d163d72ec831fb31049a43dfea586e844c2f3050b13b191b3b0df3a
|
data/.circleci/config.yml
CHANGED
@@ -8,7 +8,7 @@ jobs:
|
|
8
8
|
build-jruby-1.7.26:
|
9
9
|
<<: *defaults
|
10
10
|
docker:
|
11
|
-
- image: killbill/kbbuild:0.
|
11
|
+
- image: killbill/kbbuild:0.5.0
|
12
12
|
steps:
|
13
13
|
- checkout
|
14
14
|
- restore_cache:
|
@@ -27,8 +27,8 @@ jobs:
|
|
27
27
|
test-mysql-jruby-1.7.26:
|
28
28
|
<<: *defaults
|
29
29
|
docker:
|
30
|
-
- image: killbill/kbbuild:0.
|
31
|
-
- image: killbill/killbill:0.19.
|
30
|
+
- image: killbill/kbbuild:0.5.0
|
31
|
+
- image: killbill/killbill:0.19.16
|
32
32
|
- image: killbill/mariadb:0.19
|
33
33
|
environment:
|
34
34
|
- MYSQL_ROOT_PASSWORD=root
|
@@ -88,7 +88,7 @@ jobs:
|
|
88
88
|
build-ruby-2.2.2:
|
89
89
|
<<: *defaults
|
90
90
|
docker:
|
91
|
-
- image: killbill/kbbuild:0.
|
91
|
+
- image: killbill/kbbuild:0.5.0
|
92
92
|
steps:
|
93
93
|
- checkout
|
94
94
|
- restore_cache:
|
@@ -109,8 +109,8 @@ jobs:
|
|
109
109
|
test-mysql-ruby-2.2.2:
|
110
110
|
<<: *defaults
|
111
111
|
docker:
|
112
|
-
- image: killbill/kbbuild:0.
|
113
|
-
- image: killbill/killbill:0.19.
|
112
|
+
- image: killbill/kbbuild:0.5.0
|
113
|
+
- image: killbill/killbill:0.19.16
|
114
114
|
- image: killbill/mariadb:0.19
|
115
115
|
environment:
|
116
116
|
- MYSQL_ROOT_PASSWORD=root
|
@@ -172,7 +172,7 @@ jobs:
|
|
172
172
|
build-ruby-2.4.2:
|
173
173
|
<<: *defaults
|
174
174
|
docker:
|
175
|
-
- image: killbill/kbbuild:0.
|
175
|
+
- image: killbill/kbbuild:0.5.0
|
176
176
|
steps:
|
177
177
|
- checkout
|
178
178
|
- restore_cache:
|
@@ -193,8 +193,8 @@ jobs:
|
|
193
193
|
test-mysql-ruby-2.4.2:
|
194
194
|
<<: *defaults
|
195
195
|
docker:
|
196
|
-
- image: killbill/kbbuild:0.
|
197
|
-
- image: killbill/killbill:0.19.
|
196
|
+
- image: killbill/kbbuild:0.5.0
|
197
|
+
- image: killbill/killbill:0.19.16
|
198
198
|
- image: killbill/mariadb:0.19
|
199
199
|
environment:
|
200
200
|
- MYSQL_ROOT_PASSWORD=root
|
@@ -256,7 +256,7 @@ jobs:
|
|
256
256
|
build-jruby-9.1.14.0:
|
257
257
|
<<: *defaults
|
258
258
|
docker:
|
259
|
-
- image: killbill/kbbuild:0.
|
259
|
+
- image: killbill/kbbuild:0.5.0
|
260
260
|
steps:
|
261
261
|
- checkout
|
262
262
|
- restore_cache:
|
@@ -277,8 +277,8 @@ jobs:
|
|
277
277
|
test-mysql-jruby-9.1.14.0:
|
278
278
|
<<: *defaults
|
279
279
|
docker:
|
280
|
-
- image: killbill/kbbuild:0.
|
281
|
-
- image: killbill/killbill:0.19.
|
280
|
+
- image: killbill/kbbuild:0.5.0
|
281
|
+
- image: killbill/killbill:0.19.16
|
282
282
|
- image: killbill/mariadb:0.19
|
283
283
|
environment:
|
284
284
|
- MYSQL_ROOT_PASSWORD=root
|
@@ -63,7 +63,7 @@ module KillBillClient
|
|
63
63
|
:accountWithBalance => with_balance,
|
64
64
|
:accountWithBalanceAndCBA => with_balance_and_cba
|
65
65
|
},
|
66
|
-
|
66
|
+
options
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -84,45 +84,47 @@ module KillBillClient
|
|
84
84
|
params = {}
|
85
85
|
params[:treatNullAsReset] = treat_null_as_reset
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
87
|
+
self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}",
|
88
|
+
to_json,
|
89
|
+
params,
|
90
|
+
{
|
91
|
+
:user => user,
|
92
|
+
:reason => reason,
|
93
|
+
:comment => comment,
|
94
|
+
}.merge(options)
|
95
|
+
|
96
|
+
self.class.find_by_id(account_id, nil, nil, options)
|
97
|
+
|
96
98
|
end
|
97
99
|
|
98
100
|
|
99
101
|
def close(cancel_subscriptions, writeoff_unpaid_invoices, item_adjust_unpaid_invoices, user = nil, reason = nil, comment = nil, options = {})
|
100
102
|
created_account = self.class.delete "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}",
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
103
|
+
{},
|
104
|
+
{
|
105
|
+
:cancelAllSubscriptions => cancel_subscriptions,
|
106
|
+
:writeOffUnpaidInvoices => writeoff_unpaid_invoices,
|
107
|
+
:itemAdjustUnpaidInvoices => item_adjust_unpaid_invoices
|
108
|
+
},
|
109
|
+
{
|
110
|
+
:user => user,
|
111
|
+
:reason => reason,
|
112
|
+
:comment => comment,
|
113
|
+
}.merge(options)
|
112
114
|
created_account.refresh(options)
|
113
115
|
end
|
114
116
|
|
115
117
|
|
116
118
|
|
117
119
|
def transfer_child_credit(user = nil, reason = nil, comment = nil, options = {})
|
118
|
-
self.class.
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
120
|
+
self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/transferCredit",
|
121
|
+
{},
|
122
|
+
{},
|
123
|
+
{
|
124
|
+
:user => user,
|
125
|
+
:reason => reason,
|
126
|
+
:comment => comment,
|
127
|
+
}.merge(options)
|
126
128
|
end
|
127
129
|
|
128
130
|
|
@@ -336,7 +338,7 @@ module KillBillClient
|
|
336
338
|
|
337
339
|
end
|
338
340
|
|
339
|
-
def set_blocking_state(state_name, service,
|
341
|
+
def set_blocking_state(state_name, service, is_block_change, is_block_entitlement, is_block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
|
340
342
|
|
341
343
|
params = {}
|
342
344
|
params[:requestedDate] = requested_date if requested_date
|
@@ -344,23 +346,23 @@ module KillBillClient
|
|
344
346
|
body = KillBillClient::Model::BlockingStateAttributes.new
|
345
347
|
body.state_name = state_name
|
346
348
|
body.service = service
|
347
|
-
body.
|
348
|
-
body.
|
349
|
-
body.
|
349
|
+
body.is_block_change = is_block_change
|
350
|
+
body.is_block_entitlement = is_block_entitlement
|
351
|
+
body.is_block_billing = is_block_billing
|
350
352
|
|
351
|
-
self.class.
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
353
|
+
self.class.post "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/block",
|
354
|
+
body.to_json,
|
355
|
+
params,
|
356
|
+
{
|
357
|
+
:user => user,
|
358
|
+
:reason => reason,
|
359
|
+
:comment => comment,
|
360
|
+
}.merge(options)
|
359
361
|
blocking_states(nil, nil, 'NONE', options)
|
360
362
|
end
|
361
363
|
|
362
364
|
def cba_rebalancing(user = nil, reason = nil, comment = nil, options = {})
|
363
|
-
self.class.
|
365
|
+
self.class.put "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/cbaRebalancing",
|
364
366
|
{},
|
365
367
|
{},
|
366
368
|
{
|
@@ -4,7 +4,7 @@ module KillBillClient
|
|
4
4
|
|
5
5
|
include KillBillClient::Model::CustomFieldHelper
|
6
6
|
|
7
|
-
KILLBILL_API_BULK_ENTITLEMENT_PREFIX = "#{KILLBILL_API_PREFIX}/subscriptions/
|
7
|
+
KILLBILL_API_BULK_ENTITLEMENT_PREFIX = "#{KILLBILL_API_PREFIX}/subscriptions/createSubscriptionsWithAddOns"
|
8
8
|
|
9
9
|
has_many :base_entitlement_and_add_ons, KillBillClient::Model::SubscriptionAttributes
|
10
10
|
|
@@ -65,7 +65,7 @@ module KillBillClient
|
|
65
65
|
params[:requestedDate] = requested_date unless requested_date.nil?
|
66
66
|
params[:billingPolicy] = billing_policy unless billing_policy.nil?
|
67
67
|
|
68
|
-
result = self.class.
|
68
|
+
result = self.class.post "#{KILLBILL_API_BUNDLES_PREFIX}/#{bundle_id}",
|
69
69
|
to_json,
|
70
70
|
params,
|
71
71
|
{
|
@@ -110,7 +110,7 @@ module KillBillClient
|
|
110
110
|
|
111
111
|
|
112
112
|
# Low level api to block/unblock a given subscription/bundle/account
|
113
|
-
def set_blocking_state(state_name, service,
|
113
|
+
def set_blocking_state(state_name, service, is_block_change, is_block_entitlement, is_block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
|
114
114
|
|
115
115
|
params = {}
|
116
116
|
params[:requestedDate] = requested_date unless requested_date.nil?
|
@@ -118,11 +118,11 @@ module KillBillClient
|
|
118
118
|
body = KillBillClient::Model::BlockingStateAttributes.new
|
119
119
|
body.state_name = state_name
|
120
120
|
body.service = service
|
121
|
-
body.
|
122
|
-
body.
|
123
|
-
body.
|
121
|
+
body.is_block_change = is_block_change
|
122
|
+
body.is_block_entitlement = is_block_entitlement
|
123
|
+
body.is_block_billing = is_block_billing
|
124
124
|
|
125
|
-
self.class.
|
125
|
+
self.class.post "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/block",
|
126
126
|
body.to_json,
|
127
127
|
params,
|
128
128
|
{
|
@@ -132,6 +132,18 @@ module KillBillClient
|
|
132
132
|
}.merge(options)
|
133
133
|
end
|
134
134
|
|
135
|
+
def rename_external_key(user = nil, reason = nil, comment = nil, options = {})
|
136
|
+
|
137
|
+
self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/renameKey",
|
138
|
+
to_json,
|
139
|
+
{},
|
140
|
+
{
|
141
|
+
:user => user,
|
142
|
+
:reason => reason,
|
143
|
+
:comment => comment,
|
144
|
+
}.merge(options)
|
145
|
+
end
|
146
|
+
|
135
147
|
end
|
136
148
|
end
|
137
149
|
end
|
@@ -38,39 +38,108 @@ module KillBillClient
|
|
38
38
|
options
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def get_tenant_catalog_xml(requested_date = nil, options = {})
|
42
42
|
|
43
43
|
require_multi_tenant_options!(options, "Retrieving a catalog is only supported in multi-tenant mode")
|
44
44
|
|
45
45
|
params = {}
|
46
46
|
params[:requestedDate] = requested_date if requested_date
|
47
47
|
|
48
|
-
get KILLBILL_API_CATALOG_PREFIX,
|
48
|
+
get "#{KILLBILL_API_CATALOG_PREFIX}/xml",
|
49
49
|
params,
|
50
50
|
{
|
51
|
-
:head => {'Accept' => "
|
52
|
-
:content_type => "
|
51
|
+
:head => {'Accept' => "text/xml"},
|
52
|
+
:content_type => "text/xml",
|
53
53
|
|
54
54
|
}.merge(options)
|
55
55
|
|
56
56
|
end
|
57
57
|
|
58
|
+
def get_tenant_catalog_json(requested_date = nil, options = {})
|
59
|
+
|
60
|
+
require_multi_tenant_options!(options, "Retrieving a catalog is only supported in multi-tenant mode")
|
61
|
+
|
62
|
+
params = {}
|
63
|
+
params[:requestedDate] = requested_date if requested_date
|
64
|
+
|
65
|
+
get KILLBILL_API_CATALOG_PREFIX,
|
66
|
+
params,
|
67
|
+
{
|
68
|
+
:head => {'Accept' => "application/json"},
|
69
|
+
:content_type => "application/json",
|
70
|
+
|
71
|
+
}.merge(options)
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
def get_catalog_phase(subscription_id, requested_date, options = {})
|
76
|
+
|
77
|
+
require_multi_tenant_options!(options, "Retrieving catalog phase is only supported in multi-tenant mode")
|
78
|
+
|
79
|
+
params = {}
|
80
|
+
params[:subscriptionId] = subscription_id if subscription_id
|
81
|
+
params[:requestedDate] = requested_date if requested_date
|
82
|
+
|
83
|
+
get "#{KILLBILL_API_CATALOG_PREFIX}/phase",
|
84
|
+
params,
|
85
|
+
options
|
86
|
+
end
|
87
|
+
|
88
|
+
def get_catalog_plan(subscription_id, requested_date, options = {})
|
89
|
+
|
90
|
+
require_multi_tenant_options!(options, "Retrieving catalog plan is only supported in multi-tenant mode")
|
91
|
+
|
92
|
+
params = {}
|
93
|
+
params[:subscriptionId] = subscription_id if subscription_id
|
94
|
+
params[:requestedDate] = requested_date if requested_date
|
95
|
+
|
96
|
+
get "#{KILLBILL_API_CATALOG_PREFIX}/plan",
|
97
|
+
params,
|
98
|
+
options
|
99
|
+
end
|
100
|
+
|
101
|
+
def get_catalog_price_list(subscription_id, requested_date, options = {})
|
102
|
+
|
103
|
+
require_multi_tenant_options!(options, "Retrieving catalog price list is only supported in multi-tenant mode")
|
104
|
+
|
105
|
+
params = {}
|
106
|
+
params[:subscriptionId] = subscription_id if subscription_id
|
107
|
+
params[:requestedDate] = requested_date if requested_date
|
108
|
+
|
109
|
+
get "#{KILLBILL_API_CATALOG_PREFIX}/priceList",
|
110
|
+
params,
|
111
|
+
options
|
112
|
+
end
|
113
|
+
|
114
|
+
def get_catalog_product(subscription_id, requested_date, options = {})
|
115
|
+
|
116
|
+
require_multi_tenant_options!(options, "Retrieving catalog product list is only supported in multi-tenant mode")
|
117
|
+
|
118
|
+
params = {}
|
119
|
+
params[:subscriptionId] = subscription_id if subscription_id
|
120
|
+
params[:requestedDate] = requested_date if requested_date
|
121
|
+
|
122
|
+
get "#{KILLBILL_API_CATALOG_PREFIX}/product",
|
123
|
+
params,
|
124
|
+
options
|
125
|
+
end
|
126
|
+
|
58
127
|
def upload_tenant_catalog(catalog_xml, user = nil, reason = nil, comment = nil, options = {})
|
59
128
|
|
60
129
|
require_multi_tenant_options!(options, "Uploading a catalog is only supported in multi-tenant mode")
|
61
130
|
|
62
|
-
post KILLBILL_API_CATALOG_PREFIX,
|
131
|
+
post "#{KILLBILL_API_CATALOG_PREFIX}/xml",
|
63
132
|
catalog_xml,
|
64
133
|
{
|
65
134
|
},
|
66
135
|
{
|
67
|
-
:head => {'Accept' => 'application/
|
68
|
-
:content_type => '
|
136
|
+
:head => {'Accept' => 'application/json'},
|
137
|
+
:content_type => 'text/xml',
|
69
138
|
:user => user,
|
70
139
|
:reason => reason,
|
71
140
|
:comment => comment,
|
72
141
|
}.merge(options)
|
73
|
-
|
142
|
+
get_tenant_catalog_json(nil, options)
|
74
143
|
end
|
75
144
|
|
76
145
|
|
@@ -31,9 +31,9 @@ module KillBillClient
|
|
31
31
|
attribute :blocked_id
|
32
32
|
attribute :state_name
|
33
33
|
attribute :service
|
34
|
-
attribute :
|
35
|
-
attribute :
|
36
|
-
attribute :
|
34
|
+
attribute :is_block_change
|
35
|
+
attribute :is_block_entitlement
|
36
|
+
attribute :is_block_billing
|
37
37
|
attribute :effective_date
|
38
38
|
attribute :type
|
39
39
|
attribute :audit_logs
|
@@ -35,9 +35,11 @@ module KillBillClient
|
|
35
35
|
attribute :child_account_id
|
36
36
|
attribute :bundle_id
|
37
37
|
attribute :subscription_id
|
38
|
+
attribute :product_name
|
38
39
|
attribute :plan_name
|
39
40
|
attribute :phase_name
|
40
41
|
attribute :usage_name
|
42
|
+
attribute :pretty_product_name
|
41
43
|
attribute :pretty_plan_name
|
42
44
|
attribute :pretty_phase_name
|
43
45
|
attribute :pretty_usage_name
|