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 +4 -4
- data/.travis.yml +2 -0
- data/README.md +61 -1
- data/lib/killbill_client/models/transaction.rb +29 -4
- data/lib/killbill_client/version.rb +1 -1
- metadata +32 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7b9310db3e2077873d4782699d17a7b842095d
|
4
|
+
data.tar.gz: 6265f9b80356fd96ed2c8d68b42eb55a33963683
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67abf97671a18f027a2df4761201f0181627787af8f12e2e5a45fe4c02f5f58f4c1f7fee9d0508c8f7352348ce3133c6496c8a2a97863b1e986e676c1751da67
|
7
|
+
data.tar.gz: 54680415c950f005332ba9d161ee6a0f8c42091faf495c64cd3eabccbf92b9ed5fe4b692a2f9a3c90e4f2543b5907da649847b90b558217f14c501074006fba5
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -4,11 +4,69 @@
|
|
4
4
|
killbill-client-ruby
|
5
5
|
====================
|
6
6
|
|
7
|
-
Kill Bill
|
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?
|
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.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:
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
-
|
62
|
-
-
|
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
|
-
-
|
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.
|
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: []
|