killbill 1.7.1 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/Jarfile CHANGED
@@ -1,5 +1,6 @@
1
- jar 'com.ning.billing:killbill-api', '0.7.1'
2
- jar 'com.ning.billing.plugin:killbill-plugin-api-notification', '0.5.0'
3
- jar 'com.ning.billing.plugin:killbill-plugin-api-payment', '0.5.0'
4
- jar 'com.ning.billing:killbill-util:tests', '0.6.17'
1
+ jar 'com.ning.billing:killbill-api', '0.7.2'
2
+ jar 'com.ning.billing.plugin:killbill-plugin-api-notification', '0.6.0'
3
+ jar 'com.ning.billing.plugin:killbill-plugin-api-payment', '0.6.0'
4
+ jar 'com.ning.billing.plugin:killbill-plugin-api-currency', '0.6.0'
5
+ jar 'com.ning.billing:killbill-util:tests', '0.7.0'
5
6
  jar 'javax.servlet:javax.servlet-api', '3.0.1'
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 1.8.0
2
+ Currency plugin support
3
+
1
4
  1.7.1
2
5
  Bug fix in enumerator_iterator
3
6
  Make log level adjustable
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.1
1
+ 1.8.0
@@ -1,6 +1,7 @@
1
1
  -i
2
2
  file:///PATH_TO_REPO/killbill-plugin-api/payment/src/main/java,
3
3
  file:///PATH_TO_REPO/killbill-plugin-api/notification/src/main/java,
4
+ file:///PATH_TO_REPO/killbill-plugin-api/currency/src/main/java,
4
5
  file:///PATH_TO_REPO/killbill-api/src/main/java/
5
6
  -o
6
7
  /tmp/output
@@ -8,7 +9,8 @@ file:///PATH_TO_REPO/killbill-api/src/main/java/
8
9
  JRUBY_PLUGIN
9
10
  -q
10
11
  com.ning.billing.payment.plugin.api,
11
- com.ning.billing.notification.plugin.api
12
+ com.ning.billing.notification.plugin.api,
13
+ com.ning.billing.currency.plugin.api
12
14
  -m
13
15
  JRUBY_PLUGIN_API
14
16
 
@@ -0,0 +1,32 @@
1
+ require 'killbill/plugin'
2
+
3
+ module Killbill
4
+ module Plugin
5
+ class Currency < PluginBase
6
+
7
+ class OperationUnsupportedError < NotImplementedError
8
+ end
9
+
10
+ def get_base_currencies(options = {})
11
+ raise OperationUnsupportedError
12
+ end
13
+
14
+ def get_latest_conversion_date(base_currency, options = {})
15
+ raise OperationUnsupportedError
16
+ end
17
+
18
+ def get_conversion_dates(base_currency, options = {})
19
+ raise OperationUnsupportedError
20
+ end
21
+
22
+ def get_current_rates(base_currency, options = {})
23
+ raise OperationUnsupportedError
24
+ end
25
+
26
+ def get_rates(base_currency, conversion_date, options = {})
27
+ raise OperationUnsupportedError
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,185 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Api
29
+
30
+ java_package 'com.ning.billing.currency.plugin.api'
31
+ class CurrencyPluginApi < JPlugin
32
+
33
+ include com.ning.billing.currency.plugin.api.CurrencyPluginApi
34
+
35
+ def initialize(real_class_name, services = {})
36
+ super(real_class_name, services)
37
+ end
38
+
39
+ java_signature 'Java::java.util.Set getBaseCurrencies()'
40
+ def get_base_currencies()
41
+ begin
42
+ res = @delegate_plugin.get_base_currencies()
43
+ # conversion for res [type = java.util.Set]
44
+ tmp = java.util.TreeSet.new
45
+ (res || []).each do |m|
46
+ # conversion for m [type = com.ning.billing.catalog.api.Currency]
47
+ m = Java::com.ning.billing.catalog.api.Currency.value_of("#{m.to_s}") unless m.nil?
48
+ tmp.add(m)
49
+ end
50
+ res = tmp
51
+ return res
52
+ rescue Exception => e
53
+ message = "Failure in get_base_currencies: #{e}"
54
+ unless e.backtrace.nil?
55
+ message = "#{message}\n#{e.backtrace.join("\n")}"
56
+ end
57
+ logger.warn message
58
+ raise Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException.new("get_base_currencies failure", e.message)
59
+ ensure
60
+ @delegate_plugin.after_request
61
+ end
62
+ end
63
+
64
+ java_signature 'Java::org.joda.time.DateTime getLatestConversionDate(Java::com.ning.billing.catalog.api.Currency)'
65
+ def get_latest_conversion_date(baseCurrency)
66
+
67
+ # conversion for baseCurrency [type = com.ning.billing.catalog.api.Currency]
68
+ baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
69
+ begin
70
+ res = @delegate_plugin.get_latest_conversion_date(baseCurrency)
71
+ # conversion for res [type = org.joda.time.DateTime]
72
+ if !res.nil?
73
+ res = (res.kind_of? Time) ? DateTime.parse(res.to_s) : res
74
+ res = Java::org.joda.time.DateTime.new(res.to_s, Java::org.joda.time.DateTimeZone::UTC)
75
+ end
76
+ return res
77
+ rescue Exception => e
78
+ message = "Failure in get_latest_conversion_date: #{e}"
79
+ unless e.backtrace.nil?
80
+ message = "#{message}\n#{e.backtrace.join("\n")}"
81
+ end
82
+ logger.warn message
83
+ raise Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException.new("get_latest_conversion_date failure", e.message)
84
+ ensure
85
+ @delegate_plugin.after_request
86
+ end
87
+ end
88
+
89
+ java_signature 'Java::java.util.SortedSet getConversionDates(Java::com.ning.billing.catalog.api.Currency)'
90
+ def get_conversion_dates(baseCurrency)
91
+
92
+ # conversion for baseCurrency [type = com.ning.billing.catalog.api.Currency]
93
+ baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
94
+ begin
95
+ res = @delegate_plugin.get_conversion_dates(baseCurrency)
96
+ # conversion for res [type = java.util.SortedSet]
97
+ tmp = java.util.TreeSet.new
98
+ (res || []).each do |m|
99
+ # conversion for m [type = org.joda.time.DateTime]
100
+ if !m.nil?
101
+ m = (m.kind_of? Time) ? DateTime.parse(m.to_s) : m
102
+ m = Java::org.joda.time.DateTime.new(m.to_s, Java::org.joda.time.DateTimeZone::UTC)
103
+ end
104
+ tmp.add(m)
105
+ end
106
+ res = tmp
107
+ return res
108
+ rescue Exception => e
109
+ message = "Failure in get_conversion_dates: #{e}"
110
+ unless e.backtrace.nil?
111
+ message = "#{message}\n#{e.backtrace.join("\n")}"
112
+ end
113
+ logger.warn message
114
+ raise Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException.new("get_conversion_dates failure", e.message)
115
+ ensure
116
+ @delegate_plugin.after_request
117
+ end
118
+ end
119
+
120
+ java_signature 'Java::java.util.Set getCurrentRates(Java::com.ning.billing.catalog.api.Currency)'
121
+ def get_current_rates(baseCurrency)
122
+
123
+ # conversion for baseCurrency [type = com.ning.billing.catalog.api.Currency]
124
+ baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
125
+ begin
126
+ res = @delegate_plugin.get_current_rates(baseCurrency)
127
+ # conversion for res [type = java.util.Set]
128
+ tmp = java.util.TreeSet.new
129
+ (res || []).each do |m|
130
+ # conversion for m [type = com.ning.billing.currency.plugin.api.Rate]
131
+ m = m.to_java unless m.nil?
132
+ tmp.add(m)
133
+ end
134
+ res = tmp
135
+ return res
136
+ rescue Exception => e
137
+ message = "Failure in get_current_rates: #{e}"
138
+ unless e.backtrace.nil?
139
+ message = "#{message}\n#{e.backtrace.join("\n")}"
140
+ end
141
+ logger.warn message
142
+ raise Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException.new("get_current_rates failure", e.message)
143
+ ensure
144
+ @delegate_plugin.after_request
145
+ end
146
+ end
147
+
148
+ java_signature 'Java::java.util.Set getRates(Java::com.ning.billing.catalog.api.Currency, Java::org.joda.time.DateTime)'
149
+ def get_rates(baseCurrency, conversionDate)
150
+
151
+ # conversion for baseCurrency [type = com.ning.billing.catalog.api.Currency]
152
+ baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
153
+
154
+ # conversion for conversionDate [type = org.joda.time.DateTime]
155
+ if !conversionDate.nil?
156
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
157
+ str = fmt.print(conversionDate)
158
+ conversionDate = DateTime.iso8601(str)
159
+ end
160
+ begin
161
+ res = @delegate_plugin.get_rates(baseCurrency, conversionDate)
162
+ # conversion for res [type = java.util.Set]
163
+ tmp = java.util.TreeSet.new
164
+ (res || []).each do |m|
165
+ # conversion for m [type = com.ning.billing.currency.plugin.api.Rate]
166
+ m = m.to_java unless m.nil?
167
+ tmp.add(m)
168
+ end
169
+ res = tmp
170
+ return res
171
+ rescue Exception => e
172
+ message = "Failure in get_rates: #{e}"
173
+ unless e.backtrace.nil?
174
+ message = "#{message}\n#{e.backtrace.join("\n")}"
175
+ end
176
+ logger.warn message
177
+ raise Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException.new("get_rates failure", e.message)
178
+ ensure
179
+ @delegate_plugin.after_request
180
+ end
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,88 @@
1
+ ###################################################################################
2
+ # #
3
+ # Copyright 2010-2013 Ning, Inc. #
4
+ # #
5
+ # Ning licenses this file to you under the Apache License, version 2.0 #
6
+ # (the "License"); you may not use this file except in compliance with the #
7
+ # License. You may obtain a copy of the License at: #
8
+ # #
9
+ # http://www.apache.org/licenses/LICENSE-2.0 #
10
+ # #
11
+ # Unless required by applicable law or agreed to in writing, software #
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
+ # License for the specific language governing permissions and limitations #
15
+ # under the License. #
16
+ # #
17
+ ###################################################################################
18
+
19
+
20
+ #
21
+ # DO NOT EDIT!!!
22
+ # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
+ #
24
+
25
+
26
+ module Killbill
27
+ module Plugin
28
+ module Model
29
+
30
+ java_package 'com.ning.billing.currency.plugin.api'
31
+ class Rate
32
+
33
+ include com.ning.billing.currency.plugin.api.Rate
34
+
35
+ attr_accessor :base_currency, :currency, :value, :conversion_date
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for base_currency [type = com.ning.billing.catalog.api.Currency]
42
+ @base_currency = Java::com.ning.billing.catalog.api.Currency.value_of("#{@base_currency.to_s}") unless @base_currency.nil?
43
+
44
+ # conversion for currency [type = com.ning.billing.catalog.api.Currency]
45
+ @currency = Java::com.ning.billing.catalog.api.Currency.value_of("#{@currency.to_s}") unless @currency.nil?
46
+
47
+ # conversion for value [type = java.math.BigDecimal]
48
+ if @value.nil?
49
+ @value = java.math.BigDecimal::ZERO
50
+ else
51
+ @value = java.math.BigDecimal.new(@value.to_s)
52
+ end
53
+
54
+ # conversion for conversion_date [type = org.joda.time.DateTime]
55
+ if !@conversion_date.nil?
56
+ @conversion_date = (@conversion_date.kind_of? Time) ? DateTime.parse(@conversion_date.to_s) : @conversion_date
57
+ @conversion_date = Java::org.joda.time.DateTime.new(@conversion_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
58
+ end
59
+ self
60
+ end
61
+
62
+ def to_ruby(j_obj)
63
+ # conversion for base_currency [type = com.ning.billing.catalog.api.Currency]
64
+ @base_currency = j_obj.base_currency
65
+ @base_currency = @base_currency.to_s.to_sym unless @base_currency.nil?
66
+
67
+ # conversion for currency [type = com.ning.billing.catalog.api.Currency]
68
+ @currency = j_obj.currency
69
+ @currency = @currency.to_s.to_sym unless @currency.nil?
70
+
71
+ # conversion for value [type = java.math.BigDecimal]
72
+ @value = j_obj.value
73
+ @value = @value.nil? ? 0 : BigDecimal.new(@value.to_s)
74
+
75
+ # conversion for conversion_date [type = org.joda.time.DateTime]
76
+ @conversion_date = j_obj.conversion_date
77
+ if !@conversion_date.nil?
78
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
79
+ str = fmt.print(@conversion_date)
80
+ @conversion_date = DateTime.iso8601(str)
81
+ end
82
+ self
83
+ end
84
+
85
+ end
86
+ end
87
+ end
88
+ end
@@ -28,5 +28,7 @@ require 'killbill/gen/plugin-api/payment_plugin_api'
28
28
  require 'killbill/gen/plugin-api/payment_plugin_api_exception'
29
29
  require 'killbill/gen/plugin-api/ext_bus_event'
30
30
  require 'killbill/gen/plugin-api/notification_plugin_api'
31
+ require 'killbill/gen/plugin-api/currency_plugin_api'
32
+ require 'killbill/gen/plugin-api/rate'
31
33
  require 'killbill/gen/plugin-api/payment_info_plugin'
32
34
  require 'killbill/gen/plugin-api/refund_info_plugin'
data/lib/killbill.rb CHANGED
@@ -59,3 +59,4 @@ require 'killbill/gen/api/require_gen'
59
59
  require 'killbill/gen/plugin-api/require_gen'
60
60
  require 'killbill/notification'
61
61
  require 'killbill/payment'
62
+ require 'killbill/currency'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-24 00:00:00.000000000 Z
12
+ date: 2013-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
16
  version_requirements: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.3.4
21
21
  none: false
22
22
  requirement: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.3.4
27
27
  none: false
@@ -31,13 +31,13 @@ dependencies:
31
31
  name: tzinfo
32
32
  version_requirements: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ~>
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 0.3.37
37
37
  none: false
38
38
  requirement: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ~>
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 0.3.37
43
43
  none: false
@@ -47,13 +47,13 @@ dependencies:
47
47
  name: jbundler
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ~>
50
+ - - "~>"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 0.4.3
53
53
  none: false
54
54
  requirement: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - ~>
56
+ - - "~>"
57
57
  - !ruby/object:Gem::Version
58
58
  version: 0.4.3
59
59
  none: false
@@ -63,13 +63,13 @@ dependencies:
63
63
  name: rack
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.5.2
69
69
  none: false
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 1.5.2
75
75
  none: false
@@ -79,13 +79,13 @@ dependencies:
79
79
  name: rake
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: 0.8.7
85
85
  none: false
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: 0.8.7
91
91
  none: false
@@ -95,13 +95,13 @@ dependencies:
95
95
  name: rspec
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - ~>
98
+ - - "~>"
99
99
  - !ruby/object:Gem::Version
100
100
  version: 2.12.0
101
101
  none: false
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ~>
104
+ - - "~>"
105
105
  - !ruby/object:Gem::Version
106
106
  version: 2.12.0
107
107
  none: false
@@ -113,8 +113,8 @@ executables: []
113
113
  extensions: []
114
114
  extra_rdoc_files: []
115
115
  files:
116
- - .gitignore
117
- - .travis.yml
116
+ - ".gitignore"
117
+ - ".travis.yml"
118
118
  - Gemfile
119
119
  - Jarfile
120
120
  - NEWS
@@ -126,6 +126,7 @@ files:
126
126
  - killbill.gemspec
127
127
  - lib/killbill.rb
128
128
  - lib/killbill/creator.rb
129
+ - lib/killbill/currency.rb
129
130
  - lib/killbill/gen/api/account.rb
130
131
  - lib/killbill/gen/api/account_api_exception.rb
131
132
  - lib/killbill/gen/api/account_data.rb
@@ -215,12 +216,14 @@ files:
215
216
  - lib/killbill/gen/api/tenant_user_api.rb
216
217
  - lib/killbill/gen/api/unit.rb
217
218
  - lib/killbill/gen/api/usage_user_api.rb
219
+ - lib/killbill/gen/plugin-api/currency_plugin_api.rb
218
220
  - lib/killbill/gen/plugin-api/ext_bus_event.rb
219
221
  - lib/killbill/gen/plugin-api/notification_plugin_api.rb
220
222
  - lib/killbill/gen/plugin-api/payment_info_plugin.rb
221
223
  - lib/killbill/gen/plugin-api/payment_method_info_plugin.rb
222
224
  - lib/killbill/gen/plugin-api/payment_plugin_api.rb
223
225
  - lib/killbill/gen/plugin-api/payment_plugin_api_exception.rb
226
+ - lib/killbill/gen/plugin-api/rate.rb
224
227
  - lib/killbill/gen/plugin-api/refund_info_plugin.rb
225
228
  - lib/killbill/gen/plugin-api/require_gen.rb
226
229
  - lib/killbill/http_servlet.rb
@@ -249,23 +252,24 @@ licenses:
249
252
  - Apache License (2.0)
250
253
  post_install_message:
251
254
  rdoc_options:
252
- - --exclude
253
- - .
255
+ - "--exclude"
256
+ - "."
254
257
  require_paths:
255
258
  - lib
256
259
  required_ruby_version: !ruby/object:Gem::Requirement
257
260
  requirements:
258
- - - '>='
261
+ - - ">="
259
262
  - !ruby/object:Gem::Version
260
263
  version: 1.9.3
261
264
  none: false
262
265
  required_rubygems_version: !ruby/object:Gem::Requirement
263
266
  requirements:
264
- - - '>='
267
+ - - ">="
265
268
  - !ruby/object:Gem::Version
266
269
  segments:
267
270
  - 0
268
- version: '0'
271
+ version: !binary |-
272
+ MA==
269
273
  hash: 2
270
274
  none: false
271
275
  requirements: