killbill-client 2.4.0 → 3.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 +24 -118
- data/.github/CONTRIBUTING.md +20 -0
- data/.github/FUNDING.yml +3 -0
- data/.github/workflows/ci.yml +145 -0
- data/.github/workflows/release.yml +46 -0
- data/README.md +2 -1
- data/bin/retry +21 -0
- data/docker/docker-compose.ci.mysql.yml +21 -0
- data/docker/docker-compose.ci.postgresql.yml +21 -0
- data/killbill_client.gemspec +2 -1
- data/lib/killbill_client.rb +2 -0
- data/lib/killbill_client/api/api.rb +1 -1
- data/lib/killbill_client/api/net_http_adapter.rb +30 -16
- data/lib/killbill_client/models/account.rb +12 -24
- data/lib/killbill_client/models/admin.rb +131 -0
- data/lib/killbill_client/models/bundle.rb +2 -0
- data/lib/killbill_client/models/credit.rb +5 -5
- data/lib/killbill_client/models/custom_field.rb +17 -0
- data/lib/killbill_client/models/gen/account_attributes.rb +0 -1
- data/lib/killbill_client/models/gen/{block_price_override_attributes.rb → block_price_attributes.rb} +1 -1
- data/lib/killbill_client/models/gen/invoice_attributes.rb +1 -0
- data/lib/killbill_client/models/gen/invoice_item_attributes.rb +1 -0
- data/lib/killbill_client/models/gen/overdue_state_attributes.rb +0 -1
- data/lib/killbill_client/models/gen/{phase_price_override_attributes.rb → phase_price_attributes.rb} +2 -2
- data/lib/killbill_client/models/gen/require_gen.rb +52 -53
- data/lib/killbill_client/models/gen/subscription_attributes.rb +2 -0
- data/lib/killbill_client/models/gen/{tier_price_override_attributes.rb → tier_price_attributes.rb} +2 -2
- data/lib/killbill_client/models/gen/{usage_price_override_attributes.rb → usage_price_attributes.rb} +2 -2
- data/lib/killbill_client/models/helpers/custom_field_helper.rb +1 -1
- data/lib/killbill_client/models/invoice.rb +7 -7
- data/lib/killbill_client/models/invoice_item.rb +4 -1
- data/lib/killbill_client/models/invoice_payment.rb +3 -0
- data/lib/killbill_client/models/models.rb +1 -0
- data/lib/killbill_client/models/resource.rb +1 -1
- data/lib/killbill_client/models/subscription.rb +23 -1
- data/lib/killbill_client/version.rb +1 -16
- data/spec/killbill_client/http_adapter_spec.rb +38 -0
- data/spec/killbill_client/remote/model_spec.rb +15 -12
- metadata +30 -9
- data/lib/killbill_client/models/gen/credit_attributes.rb +0 -43
- data/lib/killbill_client/models/gen/invoice_email_attributes.rb +0 -35
@@ -37,7 +37,6 @@ describe KillBillClient::Model do
|
|
37
37
|
account.state = 'Awesome'
|
38
38
|
account.country = 'LalaLand'
|
39
39
|
account.locale = 'fr_FR'
|
40
|
-
account.is_notified_for_invoices = false
|
41
40
|
expect(account.account_id).to be_nil
|
42
41
|
|
43
42
|
# Create and verify the account
|
@@ -102,13 +101,17 @@ describe KillBillClient::Model do
|
|
102
101
|
custom_field = KillBillClient::Model::CustomField.new
|
103
102
|
custom_field.name = SecureRandom.uuid.to_s
|
104
103
|
custom_field.value = SecureRandom.uuid.to_s
|
104
|
+
custom_field_other = KillBillClient::Model::CustomField.new
|
105
|
+
custom_field_other.name = SecureRandom.uuid.to_s
|
106
|
+
custom_field_other.value = SecureRandom.uuid.to_s
|
105
107
|
account.add_custom_field(custom_field, 'KillBill Spec test')
|
108
|
+
account.add_custom_field(custom_field_other, 'KillBill Spec test other')
|
106
109
|
custom_fields = account.custom_fields
|
107
|
-
expect(custom_fields.size).to eq(
|
110
|
+
expect(custom_fields.size).to eq(2)
|
108
111
|
expect(custom_fields.first.name).to eq(custom_field.name)
|
109
112
|
expect(custom_fields.first.value).to eq(custom_field.value)
|
110
113
|
account.remove_custom_field(custom_fields.first.custom_field_id, 'KillBill Spec test')
|
111
|
-
expect(account.custom_fields.size).to eq(
|
114
|
+
expect(account.custom_fields.size).to eq(1)
|
112
115
|
|
113
116
|
# Add a payment method
|
114
117
|
pm = KillBillClient::Model::PaymentMethod.new
|
@@ -164,13 +167,13 @@ describe KillBillClient::Model do
|
|
164
167
|
invoice.commit 'KillBill Spec test'
|
165
168
|
|
166
169
|
# Add/Remove a invoice item tag
|
167
|
-
expect(
|
168
|
-
|
169
|
-
tags =
|
170
|
+
expect(invoice.tags.size).to eq(0)
|
171
|
+
invoice.add_tag('WRITTEN_OFF', 'KillBill Spec test')
|
172
|
+
tags = invoice.tags
|
170
173
|
expect(tags.size).to eq(1)
|
171
|
-
expect(tags.first.tag_definition_name).to eq('
|
172
|
-
|
173
|
-
expect(
|
174
|
+
expect(tags.first.tag_definition_name).to eq('WRITTEN_OFF')
|
175
|
+
invoice.remove_tag('WRITTEN_OFF', 'KillBill Spec test')
|
176
|
+
expect(invoice.tags.size).to eq(0)
|
174
177
|
|
175
178
|
# Add/Remove a invoice item custom field
|
176
179
|
expect(invoice_item.custom_fields.size).to eq(0)
|
@@ -286,7 +289,7 @@ describe KillBillClient::Model do
|
|
286
289
|
expect(invoice_payment.credited_amount).to eq(0)
|
287
290
|
|
288
291
|
# Refund the payment (with item adjustment)
|
289
|
-
invoice_item = KillBillClient::Model::Invoice.find_by_number(invoice_number
|
292
|
+
invoice_item = KillBillClient::Model::Invoice.find_by_number(invoice_number).items.first
|
290
293
|
item = KillBillClient::Model::InvoiceItem.new
|
291
294
|
item.invoice_item_id = invoice_item.invoice_item_id
|
292
295
|
item.amount = invoice_item.amount
|
@@ -300,9 +303,9 @@ describe KillBillClient::Model do
|
|
300
303
|
|
301
304
|
# Create a credit for invoice
|
302
305
|
new_credit = KillBillClient::Model::Credit.new
|
303
|
-
new_credit.
|
306
|
+
new_credit.amount = 10.1
|
304
307
|
new_credit.invoice_id = invoice_id
|
305
|
-
new_credit.
|
308
|
+
new_credit.start_date = "2013-09-30"
|
306
309
|
new_credit.account_id = account.account_id
|
307
310
|
|
308
311
|
expect { new_credit.create(true, 'KillBill Spec test') }.to raise_error(KillBillClient::API::BadRequest)
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.3.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:
|
11
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: gem-release
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.2'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rake
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,15 +60,23 @@ dependencies:
|
|
46
60
|
version: '3.4'
|
47
61
|
description: An API client library for Kill Bill.
|
48
62
|
email: killbilling-users@googlegroups.com
|
49
|
-
executables:
|
63
|
+
executables:
|
64
|
+
- retry
|
50
65
|
extensions: []
|
51
66
|
extra_rdoc_files: []
|
52
67
|
files:
|
53
68
|
- ".circleci/config.yml"
|
69
|
+
- ".github/CONTRIBUTING.md"
|
70
|
+
- ".github/FUNDING.yml"
|
71
|
+
- ".github/workflows/ci.yml"
|
72
|
+
- ".github/workflows/release.yml"
|
54
73
|
- ".gitignore"
|
55
74
|
- Gemfile
|
56
75
|
- README.md
|
57
76
|
- Rakefile
|
77
|
+
- bin/retry
|
78
|
+
- docker/docker-compose.ci.mysql.yml
|
79
|
+
- docker/docker-compose.ci.postgresql.yml
|
58
80
|
- gen_config/model.conf
|
59
81
|
- killbill_client.gemspec
|
60
82
|
- lib/killbill_client.rb
|
@@ -63,6 +85,7 @@ files:
|
|
63
85
|
- lib/killbill_client/api/net_http_adapter.rb
|
64
86
|
- lib/killbill_client/models/account.rb
|
65
87
|
- lib/killbill_client/models/account_timeline.rb
|
88
|
+
- lib/killbill_client/models/admin.rb
|
66
89
|
- lib/killbill_client/models/audit_log.rb
|
67
90
|
- lib/killbill_client/models/bulk_subscription.rb
|
68
91
|
- lib/killbill_client/models/bundle.rb
|
@@ -79,7 +102,7 @@ files:
|
|
79
102
|
- lib/killbill_client/models/gen/admin_payment_attributes.rb
|
80
103
|
- lib/killbill_client/models/gen/audit_log_attributes.rb
|
81
104
|
- lib/killbill_client/models/gen/billing_exception_attributes.rb
|
82
|
-
- lib/killbill_client/models/gen/
|
105
|
+
- lib/killbill_client/models/gen/block_price_attributes.rb
|
83
106
|
- lib/killbill_client/models/gen/blocking_state_attributes.rb
|
84
107
|
- lib/killbill_client/models/gen/bulk_subscriptions_bundle_attributes.rb
|
85
108
|
- lib/killbill_client/models/gen/bundle_attributes.rb
|
@@ -87,7 +110,6 @@ files:
|
|
87
110
|
- lib/killbill_client/models/gen/catalog_attributes.rb
|
88
111
|
- lib/killbill_client/models/gen/combo_hosted_payment_page_attributes.rb
|
89
112
|
- lib/killbill_client/models/gen/combo_payment_transaction_attributes.rb
|
90
|
-
- lib/killbill_client/models/gen/credit_attributes.rb
|
91
113
|
- lib/killbill_client/models/gen/custom_field_attributes.rb
|
92
114
|
- lib/killbill_client/models/gen/duration_attributes.rb
|
93
115
|
- lib/killbill_client/models/gen/event_subscription_attributes.rb
|
@@ -98,7 +120,6 @@ files:
|
|
98
120
|
- lib/killbill_client/models/gen/hosted_payment_page_form_descriptor_attributes.rb
|
99
121
|
- lib/killbill_client/models/gen/invoice_attributes.rb
|
100
122
|
- lib/killbill_client/models/gen/invoice_dry_run_attributes.rb
|
101
|
-
- lib/killbill_client/models/gen/invoice_email_attributes.rb
|
102
123
|
- lib/killbill_client/models/gen/invoice_item_attributes.rb
|
103
124
|
- lib/killbill_client/models/gen/invoice_payment_attributes.rb
|
104
125
|
- lib/killbill_client/models/gen/invoice_payment_transaction_attributes.rb
|
@@ -117,7 +138,7 @@ files:
|
|
117
138
|
- lib/killbill_client/models/gen/payment_method_plugin_detail_attributes.rb
|
118
139
|
- lib/killbill_client/models/gen/payment_transaction_attributes.rb
|
119
140
|
- lib/killbill_client/models/gen/phase_attributes.rb
|
120
|
-
- lib/killbill_client/models/gen/
|
141
|
+
- lib/killbill_client/models/gen/phase_price_attributes.rb
|
121
142
|
- lib/killbill_client/models/gen/plan_attributes.rb
|
122
143
|
- lib/killbill_client/models/gen/plan_detail_attributes.rb
|
123
144
|
- lib/killbill_client/models/gen/plugin_info_attributes.rb
|
@@ -143,12 +164,12 @@ files:
|
|
143
164
|
- lib/killbill_client/models/gen/tenant_attributes.rb
|
144
165
|
- lib/killbill_client/models/gen/tenant_key_value_attributes.rb
|
145
166
|
- lib/killbill_client/models/gen/tier_attributes.rb
|
146
|
-
- lib/killbill_client/models/gen/
|
167
|
+
- lib/killbill_client/models/gen/tier_price_attributes.rb
|
147
168
|
- lib/killbill_client/models/gen/tiered_block_attributes.rb
|
148
169
|
- lib/killbill_client/models/gen/unit_attributes.rb
|
149
170
|
- lib/killbill_client/models/gen/unit_usage_record_attributes.rb
|
150
171
|
- lib/killbill_client/models/gen/usage_attributes.rb
|
151
|
-
- lib/killbill_client/models/gen/
|
172
|
+
- lib/killbill_client/models/gen/usage_price_attributes.rb
|
152
173
|
- lib/killbill_client/models/gen/usage_record_attributes.rb
|
153
174
|
- lib/killbill_client/models/gen/user_roles_attributes.rb
|
154
175
|
- lib/killbill_client/models/helpers/audit_log_with_history_helper.rb
|
@@ -1,43 +0,0 @@
|
|
1
|
-
#############################################################################################
|
2
|
-
# #
|
3
|
-
# Copyright 2010-2013 Ning, Inc. #
|
4
|
-
# Copyright 2014 Groupon, Inc. #
|
5
|
-
# Copyright 2014 The Billing Project, LLC #
|
6
|
-
# #
|
7
|
-
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
-
# (the "License"); you may not use this file except in compliance with the #
|
9
|
-
# License. You may obtain a copy of the License at: #
|
10
|
-
# #
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
-
# #
|
13
|
-
# Unless required by applicable law or agreed to in writing, software #
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
-
# License for the specific language governing permissions and limitations #
|
17
|
-
# under the License. #
|
18
|
-
# #
|
19
|
-
#############################################################################################
|
20
|
-
|
21
|
-
|
22
|
-
#
|
23
|
-
# DO NOT EDIT!!!
|
24
|
-
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
module KillBillClient
|
29
|
-
module Model
|
30
|
-
class CreditAttributes < Resource
|
31
|
-
attribute :credit_id
|
32
|
-
attribute :credit_amount
|
33
|
-
attribute :currency
|
34
|
-
attribute :invoice_id
|
35
|
-
attribute :invoice_number
|
36
|
-
attribute :effective_date
|
37
|
-
attribute :account_id
|
38
|
-
attribute :description
|
39
|
-
attribute :item_details
|
40
|
-
attribute :audit_logs
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
#############################################################################################
|
2
|
-
# #
|
3
|
-
# Copyright 2010-2013 Ning, Inc. #
|
4
|
-
# Copyright 2014 Groupon, Inc. #
|
5
|
-
# Copyright 2014 The Billing Project, LLC #
|
6
|
-
# #
|
7
|
-
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
-
# (the "License"); you may not use this file except in compliance with the #
|
9
|
-
# License. You may obtain a copy of the License at: #
|
10
|
-
# #
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
-
# #
|
13
|
-
# Unless required by applicable law or agreed to in writing, software #
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
-
# License for the specific language governing permissions and limitations #
|
17
|
-
# under the License. #
|
18
|
-
# #
|
19
|
-
#############################################################################################
|
20
|
-
|
21
|
-
|
22
|
-
#
|
23
|
-
# DO NOT EDIT!!!
|
24
|
-
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
module KillBillClient
|
29
|
-
module Model
|
30
|
-
class InvoiceEmailAttributes < Resource
|
31
|
-
attribute :account_id
|
32
|
-
attribute :is_notified_for_invoices
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|