killbill-client 0.29.0 → 0.30.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: bc0cb0821172a8b139995e9ce22d57c2e349ea5c
4
- data.tar.gz: 28cfe0861830615b3a03219191054047e10680e6
3
+ metadata.gz: fa7b9310db3e2077873d4782699d17a7b842095d
4
+ data.tar.gz: 6265f9b80356fd96ed2c8d68b42eb55a33963683
5
5
  SHA512:
6
- metadata.gz: d54c5903d5a5bf5a157d6798223d00d4b02aebd0d84be8121cd54898e13353cc290c4247613a44c1deed9b9dc8983f4703e222627dcd58401e68f101fdf1fd9d
7
- data.tar.gz: 7ffde046dcaf4f470b605cde726d583c0cb0fca9873a52d22f7f09f5a95cf399e7f20593fd19656e66c843a171b269d9da240386657b9a370c4a77f9d91fde9e
6
+ metadata.gz: 67abf97671a18f027a2df4761201f0181627787af8f12e2e5a45fe4c02f5f58f4c1f7fee9d0508c8f7352348ce3133c6496c8a2a97863b1e986e676c1751da67
7
+ data.tar.gz: 54680415c950f005332ba9d161ee6a0f8c42091faf495c64cd3eabccbf92b9ed5fe4b692a2f9a3c90e4f2543b5907da649847b90b558217f14c501074006fba5
data/.travis.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  language: ruby
2
2
 
3
+ sudo: false
4
+
3
5
  notifications:
4
6
  email:
5
7
  - kill-bill-commits@googlegroups.com
data/README.md CHANGED
@@ -4,11 +4,69 @@
4
4
  killbill-client-ruby
5
5
  ====================
6
6
 
7
- Kill Bill ruby library.
7
+ Kill Bill Ruby client library.
8
+
9
+ Installation
10
+ ------------
11
+
12
+ Get the [killbill-client](https://rubygems.org/gems/killbill-client) gem:
13
+
14
+ ```
15
+ gem install killbill-client
16
+ ```
17
+
18
+ Alternatively, add the dependency in your Gemfile:
19
+
20
+ ```
21
+ gem 'killbill-client', '~> 0.24'
22
+ ```
8
23
 
9
24
  Examples
10
25
  --------
11
26
 
27
+ Here is a snippet creating your first account and subscription:
28
+
29
+ ```ruby
30
+ require 'killbill_client'
31
+
32
+ KillBillClient.url = 'http://127.0.0.1:8080'
33
+
34
+ # Multi-tenancy and RBAC credentials
35
+ options = {
36
+ :username => 'admin',
37
+ :password => 'password',
38
+ :api_key => 'bob',
39
+ :api_secret => 'lazar'
40
+ }
41
+
42
+ # Audit log data
43
+ user = 'me'
44
+ reason = 'Going through my first tutorial'
45
+ comment = 'I like it!'
46
+
47
+ # Create an account
48
+ account = KillBillClient::Model::Account.new
49
+ account.name = 'John Doe'
50
+ account.first_name_length = 4
51
+ account.external_key = 'john-doe'
52
+ account.currency = 'USD'
53
+ account = account.create(user, reason, comment, options)
54
+
55
+ # Add a subscription
56
+ subscription = KillBillClient::Model::Subscription.new
57
+ subscription.account_id = account.account_id
58
+ subscription.product_name = 'Sports'
59
+ subscription.product_category = 'BASE'
60
+ subscription.billing_period = 'MONTHLY'
61
+ subscription.price_list = 'DEFAULT'
62
+ subscription = subscription.create(user, reason, comment, nil, true, options)
63
+
64
+ # List invoices
65
+ account.invoices(true, options).each do |invoice|
66
+ puts invoice.inspect
67
+ end
68
+ ```
69
+
12
70
  The following script will tag a list of accounts with OVERDUE_ENFORCEMENT_OFF and AUTO_PAY_OFF:
13
71
 
14
72
  ```ruby
@@ -29,6 +87,8 @@ File.open(File.dirname(__FILE__) + '/accounts.txt').readlines.map(&:chomp).each
29
87
  end
30
88
  ```
31
89
 
90
+ We have lots of examples in our [integration tests](https://github.com/killbill/killbill-integration-tests).
91
+
32
92
  Tests
33
93
  -----
34
94
 
@@ -56,9 +56,15 @@ module KillBillClient
56
56
  end
57
57
 
58
58
  def capture(user = nil, reason = nil, comment = nil, options = {})
59
+ query_map = {
60
+ }
61
+ if options.include? :controlPluginNames
62
+ query_map[:controlPluginName] = options.delete(:controlPluginNames)
63
+ end
64
+
59
65
  created_transaction = self.class.post "#{follow_up_path(payment_id)}",
60
66
  to_json,
61
- {},
67
+ query_map,
62
68
  {
63
69
  :user => user,
64
70
  :reason => reason,
@@ -68,9 +74,15 @@ module KillBillClient
68
74
  end
69
75
 
70
76
  def refund(user = nil, reason = nil, comment = nil, options = {})
77
+
78
+ query_map = {
79
+ }
80
+ if options.include? :controlPluginNames
81
+ query_map[:controlPluginName] = options.delete(:controlPluginNames)
82
+ end
71
83
  created_transaction = self.class.post "#{follow_up_path(payment_id)}/refunds",
72
84
  to_json,
73
- {},
85
+ query_map,
74
86
  {
75
87
  :user => user,
76
88
  :reason => reason,
@@ -80,9 +92,15 @@ module KillBillClient
80
92
  end
81
93
 
82
94
  def void(user = nil, reason = nil, comment = nil, options = {})
95
+
96
+ query_map = {
97
+ }
98
+ if options.include? :controlPluginNames
99
+ query_map[:controlPluginName] = options.delete(:controlPluginNames)
100
+ end
83
101
  created_transaction = self.class.delete "#{follow_up_path(payment_id)}",
84
102
  to_json,
85
- {},
103
+ query_map,
86
104
  {
87
105
  :user => user,
88
106
  :reason => reason,
@@ -92,9 +110,15 @@ module KillBillClient
92
110
  end
93
111
 
94
112
  def chargeback(user = nil, reason = nil, comment = nil, options = {})
113
+
114
+ query_map = {
115
+ }
116
+ if options.include? :controlPluginNames
117
+ query_map[:controlPluginName] = options.delete(:controlPluginNames)
118
+ end
95
119
  created_transaction = self.class.post "#{follow_up_path(payment_id)}/chargebacks",
96
120
  to_json,
97
- {},
121
+ query_map,
98
122
  {
99
123
  :user => user,
100
124
  :reason => reason,
@@ -105,6 +129,7 @@ module KillBillClient
105
129
 
106
130
  private
107
131
 
132
+
108
133
  def follow_up_path(payment_id)
109
134
  path = Payment::KILLBILL_API_PAYMENTS_PREFIX
110
135
  path += "/#{payment_id}" unless payment_id.nil?
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 29
4
+ MINOR = 30
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.29.0
4
+ version: 0.30.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-12-29 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
- requirement: !ruby/object:Gem::Requirement
15
+ version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.2.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
20
+ requirement: !ruby/object:Gem::Requirement
23
21
  requirements:
24
- - - ">="
22
+ - - '>='
25
23
  - !ruby/object:Gem::Version
26
24
  version: 1.2.0
25
+ prerelease: false
26
+ type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
- requirement: !ruby/object:Gem::Requirement
29
+ version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 10.0.0
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
37
35
  requirements:
38
- - - ">="
36
+ - - '>='
39
37
  - !ruby/object:Gem::Version
40
38
  version: 10.0.0
39
+ prerelease: false
40
+ type: :development
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
- requirement: !ruby/object:Gem::Requirement
43
+ version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.12.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
51
49
  requirements:
52
- - - "~>"
50
+ - - ~>
53
51
  - !ruby/object:Gem::Version
54
52
  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
@@ -185,33 +185,26 @@ homepage: http://www.killbilling.org
185
185
  licenses:
186
186
  - Apache License (2.0)
187
187
  metadata: {}
188
- post_install_message:
188
+ post_install_message:
189
189
  rdoc_options:
190
- - "--exclude"
191
- - "."
190
+ - --exclude
191
+ - .
192
192
  require_paths:
193
193
  - lib
194
194
  required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - ">="
196
+ - - '>='
197
197
  - !ruby/object:Gem::Version
198
198
  version: 1.8.6
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - ">="
201
+ - - '>='
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubyforge_project:
206
- rubygems_version: 2.2.2
207
- signing_key:
205
+ rubyforge_project:
206
+ rubygems_version: 2.1.9
207
+ signing_key:
208
208
  specification_version: 4
209
209
  summary: Kill Bill client library.
210
- test_files:
211
- - spec/killbill_client/base_uri_spec.rb
212
- - spec/killbill_client/model_relation_spec.rb
213
- - spec/killbill_client/remote/api_spec.rb
214
- - spec/killbill_client/remote/model_spec.rb
215
- - spec/killbill_client/resource_spec.rb
216
- - spec/killbill_client/resources_spec.rb
217
- - spec/spec_helper.rb
210
+ test_files: []