killbill-client 0.14.0 → 0.15.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/README.md +2 -2
- data/lib/killbill_client/models/account.rb +7 -7
- data/lib/killbill_client/models/helpers/tag_helper.rb +7 -17
- data/lib/killbill_client/models/payment_method.rb +1 -0
- data/lib/killbill_client/version.rb +1 -1
- data/spec/killbill_client/remote/model_spec.rb +1 -1
- metadata +38 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 387b8be2ba133da76bc8ec821c2daac5698472da
|
4
|
+
data.tar.gz: 059c9a722277434e4fe97e367c6e3c61cff6e014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f6a28af56caa4cd8cd67079d8d5e7af482ba45d25de207914a3e78992973bb4fee062e454aafbdcf30b97735cc7bbe0997034009c2039039cf7a7a2244cc352
|
7
|
+
data.tar.gz: 7f9bdaab2f87fc4c8773b2123b0ccbcb40aea7d5e1f130a246252f62c59bae4f768c4b8a42b60950db332bff80c744f1cd645934e61c54734d5b37a57071705b
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Examples
|
|
11
11
|
|
12
12
|
The following script will tag a list of accounts with OVERDUE_ENFORCEMENT_OFF and AUTO_PAY_OFF:
|
13
13
|
|
14
|
-
```
|
14
|
+
```ruby
|
15
15
|
require 'killbill_client'
|
16
16
|
|
17
17
|
KillBillClient.url = 'http://127.0.0.1:8080'
|
@@ -34,7 +34,7 @@ Tests
|
|
34
34
|
|
35
35
|
To run the integration tests:
|
36
36
|
|
37
|
-
```
|
37
|
+
```bash
|
38
38
|
rake test:remote:spec
|
39
39
|
```
|
40
40
|
|
@@ -110,7 +110,7 @@ module KillBillClient
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def auto_pay_off?(options = {})
|
113
|
-
|
113
|
+
control_tag?(AUTO_PAY_OFF_ID, options)
|
114
114
|
end
|
115
115
|
|
116
116
|
def set_auto_pay_off(user = nil, reason = nil, comment = nil, options = {})
|
@@ -118,11 +118,11 @@ module KillBillClient
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def remove_auto_pay_off(user = nil, reason = nil, comment = nil, options = {})
|
121
|
-
remove_tag_from_definition_id(AUTO_PAY_OFF_ID
|
121
|
+
remove_tag_from_definition_id(AUTO_PAY_OFF_ID, user, reason, comment, options)
|
122
122
|
end
|
123
123
|
|
124
124
|
def auto_invoicing_off?(options = {})
|
125
|
-
|
125
|
+
control_tag?(AUTO_INVOICING_OFF_ID, options)
|
126
126
|
end
|
127
127
|
|
128
128
|
def set_auto_invoicing_off(user = nil, reason = nil, comment = nil, options = {})
|
@@ -134,7 +134,7 @@ module KillBillClient
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def overdue_enforcement_off?(options = {})
|
137
|
-
|
137
|
+
control_tag?(OVERDUE_ENFORCEMENT_OFF_ID, options)
|
138
138
|
end
|
139
139
|
|
140
140
|
def set_overdue_enforcement_off(user = nil, reason = nil, comment = nil, options = {})
|
@@ -146,7 +146,7 @@ module KillBillClient
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def written_off?(options = {})
|
149
|
-
|
149
|
+
control_tag?(WRITTEN_OFF_ID, options)
|
150
150
|
end
|
151
151
|
|
152
152
|
def set_written_off(user = nil, reason = nil, comment = nil, options = {})
|
@@ -158,7 +158,7 @@ module KillBillClient
|
|
158
158
|
end
|
159
159
|
|
160
160
|
def manual_pay?(options = {})
|
161
|
-
|
161
|
+
control_tag?(MANUAL_PAY_ID, options)
|
162
162
|
end
|
163
163
|
|
164
164
|
def set_manual_pay(user = nil, reason = nil, comment = nil, options = {})
|
@@ -170,7 +170,7 @@ module KillBillClient
|
|
170
170
|
end
|
171
171
|
|
172
172
|
def test?(options = {})
|
173
|
-
|
173
|
+
control_tag?(TEST_ID, options)
|
174
174
|
end
|
175
175
|
|
176
176
|
def set_test(user = nil, reason = nil, comment = nil, options = {})
|
@@ -31,20 +31,11 @@ module KillBillClient
|
|
31
31
|
def set_tags(tag_definition_ids, user = nil, reason = nil, comment = nil, options = {})
|
32
32
|
current_tag_definition_ids = tags(false, 'NONE', options).map { |tag| tag.tag_definition_id }
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
current_tag_definition_ids.each do |current_tag_definition_id|
|
37
|
-
tags_to_remove << current_tag_definition_id unless tag_definition_ids.include?(current_tag_definition_id)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Find tags to add
|
41
|
-
tags_to_add = Set.new
|
42
|
-
tag_definition_ids.each do |new_tag_definition_id|
|
43
|
-
tags_to_add << new_tag_definition_id unless current_tag_definition_ids.include?(new_tag_definition_id)
|
44
|
-
end
|
34
|
+
tags_to_remove = current_tag_definition_ids - tag_definition_ids
|
35
|
+
tags_to_add = tag_definition_ids - current_tag_definition_ids
|
45
36
|
|
46
|
-
remove_tags_from_definition_ids(tags_to_remove.
|
47
|
-
add_tags_from_definition_ids(tags_to_add.
|
37
|
+
remove_tags_from_definition_ids(tags_to_remove.uniq, user, reason, comment, options) unless tags_to_remove.empty?
|
38
|
+
add_tags_from_definition_ids(tags_to_add.uniq, user, reason, comment, options) unless tags_to_add.empty?
|
48
39
|
end
|
49
40
|
|
50
41
|
def add_tag_from_definition_id(tag_definition_id, user = nil, reason = nil, comment = nil, options = {})
|
@@ -55,11 +46,10 @@ module KillBillClient
|
|
55
46
|
remove_tags_from_definition_ids([tag_definition_id], user, reason, comment, options)
|
56
47
|
end
|
57
48
|
|
58
|
-
def
|
59
|
-
|
60
|
-
!((res || []).select do |t|
|
49
|
+
def control_tag?(control_tag_definition_id, options)
|
50
|
+
tags(false, 'NONE', options).any? do |t|
|
61
51
|
t.tag_definition_id == control_tag_definition_id
|
62
|
-
end
|
52
|
+
end
|
63
53
|
end
|
64
54
|
|
65
55
|
module ClassMethods
|
@@ -2,6 +2,7 @@ module KillBillClient
|
|
2
2
|
module Model
|
3
3
|
class PaymentMethod < PaymentMethodAttributes
|
4
4
|
KILLBILL_API_PAYMENT_METHODS_PREFIX = "#{KILLBILL_API_PREFIX}/paymentMethods"
|
5
|
+
EXTERNAL_PAYMENT = '__EXTERNAL_PAYMENT__'.freeze
|
5
6
|
|
6
7
|
has_many :audit_logs, KillBillClient::Model::AuditLog
|
7
8
|
|
@@ -94,7 +94,7 @@ describe KillBillClient::Model do
|
|
94
94
|
pm = KillBillClient::Model::PaymentMethod.new
|
95
95
|
pm.account_id = account.account_id
|
96
96
|
pm.is_default = true
|
97
|
-
pm.plugin_name =
|
97
|
+
pm.plugin_name = KillBillClient::Model::PaymentMethod::EXTERNAL_PAYMENT
|
98
98
|
pm.plugin_info = {}
|
99
99
|
pm.payment_method_id.should be_nil
|
100
100
|
|
metadata
CHANGED
@@ -1,65 +1,65 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Killbill core team
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-06 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
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
23
|
requirements:
|
22
|
-
- -
|
24
|
+
- - ">="
|
23
25
|
- !ruby/object:Gem::Version
|
24
26
|
version: 1.2.0
|
25
|
-
prerelease: false
|
26
|
-
type: :runtime
|
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
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
37
|
requirements:
|
36
|
-
- -
|
38
|
+
- - ">="
|
37
39
|
- !ruby/object:Gem::Version
|
38
40
|
version: 10.0.0
|
39
|
-
prerelease: false
|
40
|
-
type: :development
|
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
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
51
|
requirements:
|
50
|
-
- - ~>
|
52
|
+
- - "~>"
|
51
53
|
- !ruby/object:Gem::Version
|
52
54
|
version: 2.12.0
|
53
|
-
prerelease: false
|
54
|
-
type: :development
|
55
55
|
description: An API client library for Kill Bill.
|
56
56
|
email: killbilling-users@googlegroups.com
|
57
57
|
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
|
@@ -167,26 +167,32 @@ homepage: http://www.killbilling.org
|
|
167
167
|
licenses:
|
168
168
|
- Apache License (2.0)
|
169
169
|
metadata: {}
|
170
|
-
post_install_message:
|
170
|
+
post_install_message:
|
171
171
|
rdoc_options:
|
172
|
-
- --exclude
|
173
|
-
- .
|
172
|
+
- "--exclude"
|
173
|
+
- "."
|
174
174
|
require_paths:
|
175
175
|
- lib
|
176
176
|
required_ruby_version: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 1.8.6
|
181
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
|
-
- -
|
183
|
+
- - ">="
|
184
184
|
- !ruby/object:Gem::Version
|
185
185
|
version: '0'
|
186
186
|
requirements: []
|
187
|
-
rubyforge_project:
|
188
|
-
rubygems_version: 2.
|
189
|
-
signing_key:
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 2.4.6
|
189
|
+
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Kill Bill client library.
|
192
|
-
test_files:
|
192
|
+
test_files:
|
193
|
+
- spec/killbill_client/model_relation_spec.rb
|
194
|
+
- spec/killbill_client/remote/api_spec.rb
|
195
|
+
- spec/killbill_client/remote/model_spec.rb
|
196
|
+
- spec/killbill_client/resource_spec.rb
|
197
|
+
- spec/killbill_client/resources_spec.rb
|
198
|
+
- spec/spec_helper.rb
|