killbill-client 0.22.0 → 0.23.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34b37123519c3054a175647dbd0f5ae34ec0bc61
4
- data.tar.gz: f7370410c38b3140cbce3e4369f5adbe5dc210a2
3
+ metadata.gz: 028feae22f058fdb465ae1b0cd7b65bb959a0aa3
4
+ data.tar.gz: 094761b85d0139e21f42c69f3ecfbd6e57fc6467
5
5
  SHA512:
6
- metadata.gz: ae3496fe3cd9df265e8ef25b5cde0d3e72ba4cf692bd6c7e6520383a2320da4812a8b5b568b60050476cd1a82d83c90064b49b7d529ab0b58fe5fcb0808e84e7
7
- data.tar.gz: d124946e01657b2e3d2b20016e824815ab6e40e2b88f33fd47a6afbdcbe539c7d367902d139bf985ff4529a49e46145a975fe5f46182d38f61ac973bce5ad2b2
6
+ metadata.gz: 37a97ec81984bb947aec3d1b980467e858cb38ed98ae5c3f758709d39424e15626a5a910125224d53046c0ce5a2dd9ace68979df70746c647d9b7101e2d9f510
7
+ data.tar.gz: 0b9602bea90b5f99a44633380de022c4672834d9bb50161fc5bf7b26b0f7285bbd20f0d8619ce2eaeb8875ed19224ede342b7fdfc368fed3b0980d1a75278907
@@ -40,7 +40,11 @@ module KillBillClient
40
40
  head.update options[:head] if options[:head]
41
41
  head.delete_if { |_, value| value.nil? }
42
42
 
43
- uri = (options[:base_uri] || base_uri) + URI.escape(relative_uri)
43
+ uri = (options[:base_uri] || base_uri)
44
+ # Note: make sure to keep the full path (if any) from URI::HTTP, for non-ROOT deployments
45
+ # See https://github.com/killbill/killbill/issues/221#issuecomment-151980263
46
+ base_path = uri.request_uri == '/' ? '' : uri.request_uri
47
+ uri += (base_path + URI.escape(relative_uri))
44
48
 
45
49
  # Plugin properties are passed in the options but we want to send them as query parameters,
46
50
  # so remove with from global hash and insert them under :params
@@ -49,7 +53,6 @@ module KillBillClient
49
53
  options[:params][:pluginProperty] = plugin_properties.map { |p| "#{p.key}=#{p.value}" }
50
54
  end
51
55
 
52
-
53
56
  if options[:params] && !options[:params].empty?
54
57
  pairs = options[:params].map { |key, value|
55
58
  # If the value is an array, we 'demultiplex' into several
@@ -100,6 +100,30 @@ module KillBillClient
100
100
  :comment => comment,
101
101
  }.merge(options)
102
102
  end
103
+
104
+
105
+
106
+ # Low level api to block/unblock a given subscription/bundle/account
107
+ def set_blocking_state(state_name, service, block_change, block_entitlement, block_billing, requested_date = nil, user = nil, reason = nil, comment = nil, options = {})
108
+
109
+ body = KillBillClient::Model::BlockingStateAttributes.new
110
+ body.state_name = state_name
111
+ body.service = service
112
+ body.block_change = block_change
113
+ body.block_entitlement = block_entitlement
114
+ body.block_billing = block_billing
115
+ body.effective_date = requested_date
116
+
117
+ self.class.put "#{KILLBILL_API_BUNDLES_PREFIX}/#{@bundle_id}/block",
118
+ body.to_json,
119
+ {},
120
+ {
121
+ :user => user,
122
+ :reason => reason,
123
+ :comment => comment,
124
+ }.merge(options)
125
+ end
126
+
103
127
  end
104
128
  end
105
129
  end
@@ -0,0 +1,42 @@
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 BlockingStateAttributes < Resource
31
+ attribute :blocked_id
32
+ attribute :state_name
33
+ attribute :service
34
+ attribute :block_change
35
+ attribute :block_entitlement
36
+ attribute :block_billing
37
+ attribute :effective_date
38
+ attribute :type
39
+ attribute :audit_logs
40
+ end
41
+ end
42
+ end
@@ -32,6 +32,7 @@ require 'killbill_client/models/gen/admin_payment_attributes'
32
32
  require 'killbill_client/models/gen/audit_log_attributes'
33
33
  require 'killbill_client/models/gen/stack_trace_element_attributes'
34
34
  require 'killbill_client/models/gen/billing_exception_attributes'
35
+ require 'killbill_client/models/gen/blocking_state_attributes'
35
36
  require 'killbill_client/models/gen/bundle_attributes'
36
37
  require 'killbill_client/models/gen/bundle_timeline_attributes'
37
38
  require 'killbill_client/models/gen/product_attributes'
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 22
4
+ MINOR = 23
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
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.22.0
4
+ version: 0.23.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-10-23 00:00:00.000000000 Z
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
- version_requirements: !ruby/object:Gem::Requirement
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.2.0
20
- requirement: !ruby/object:Gem::Requirement
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
- version_requirements: !ruby/object:Gem::Requirement
29
+ requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 10.0.0
34
- requirement: !ruby/object:Gem::Requirement
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
- version_requirements: !ruby/object:Gem::Requirement
43
+ requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.12.0
48
- requirement: !ruby/object:Gem::Requirement
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
@@ -85,6 +85,7 @@ files:
85
85
  - lib/killbill_client/models/gen/admin_payment_attributes.rb
86
86
  - lib/killbill_client/models/gen/audit_log_attributes.rb
87
87
  - lib/killbill_client/models/gen/billing_exception_attributes.rb
88
+ - lib/killbill_client/models/gen/blocking_state_attributes.rb
88
89
  - lib/killbill_client/models/gen/bundle_attributes.rb
89
90
  - lib/killbill_client/models/gen/bundle_timeline_attributes.rb
90
91
  - lib/killbill_client/models/gen/catalog_attributes_simple.rb
@@ -179,26 +180,33 @@ homepage: http://www.killbilling.org
179
180
  licenses:
180
181
  - Apache License (2.0)
181
182
  metadata: {}
182
- post_install_message:
183
+ post_install_message:
183
184
  rdoc_options:
184
- - --exclude
185
- - .
185
+ - "--exclude"
186
+ - "."
186
187
  require_paths:
187
188
  - lib
188
189
  required_ruby_version: !ruby/object:Gem::Requirement
189
190
  requirements:
190
- - - '>='
191
+ - - ">="
191
192
  - !ruby/object:Gem::Version
192
193
  version: 1.8.6
193
194
  required_rubygems_version: !ruby/object:Gem::Requirement
194
195
  requirements:
195
- - - '>='
196
+ - - ">="
196
197
  - !ruby/object:Gem::Version
197
198
  version: '0'
198
199
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.1.9
201
- signing_key:
200
+ rubyforge_project:
201
+ rubygems_version: 2.2.2
202
+ signing_key:
202
203
  specification_version: 4
203
204
  summary: Kill Bill client library.
204
- test_files: []
205
+ test_files:
206
+ - spec/killbill_client/base_uri_spec.rb
207
+ - spec/killbill_client/model_relation_spec.rb
208
+ - spec/killbill_client/remote/api_spec.rb
209
+ - spec/killbill_client/remote/model_spec.rb
210
+ - spec/killbill_client/resource_spec.rb
211
+ - spec/killbill_client/resources_spec.rb
212
+ - spec/spec_helper.rb