killbill 1.8.0 → 1.8.1

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.
data/Jarfile CHANGED
@@ -1,4 +1,4 @@
1
- jar 'com.ning.billing:killbill-api', '0.7.2'
1
+ jar 'com.ning.billing:killbill-api', '0.7.3'
2
2
  jar 'com.ning.billing.plugin:killbill-plugin-api-notification', '0.6.0'
3
3
  jar 'com.ning.billing.plugin:killbill-plugin-api-payment', '0.6.0'
4
4
  jar 'com.ning.billing.plugin:killbill-plugin-api-currency', '0.6.0'
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 1.8.1
2
+ Add currency api from Killbill for ruby plugins
3
+
1
4
  1.8.0
2
5
  Currency plugin support
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.8.1
data/gen_config/api.conf CHANGED
@@ -36,7 +36,8 @@ com.ning.billing.util.callcontext,
36
36
  com.ning.billing.util.customfield,
37
37
  com.ning.billing.util.entity,
38
38
  com.ning.billing.util.tag,
39
- com.ning.billing.security
39
+ com.ning.billing.security,
40
+ com.ning.billing.currency.api
40
41
  -x
41
42
  ExportUserApi,
42
43
  PluginConfig,
data/lib/killbill.rb CHANGED
@@ -32,6 +32,7 @@ begin
32
32
  com.ning.billing.payment.api.PaymentApi
33
33
  com.ning.billing.util.api.CustomFieldUserApi
34
34
  com.ning.billing.util.api.TagUserApi
35
+ com.ning.billing.currency.api.CurrencyConversionApi
35
36
  javax.servlet.http.HttpServlet
36
37
  )
37
38
 
@@ -0,0 +1,77 @@
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.api'
31
+ class CurrencyConversion
32
+
33
+ include com.ning.billing.currency.api.CurrencyConversion
34
+
35
+ attr_accessor :conversion_date, :base_currency, :rates
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for conversion_date [type = org.joda.time.DateTime]
42
+ if !@conversion_date.nil?
43
+ @conversion_date = (@conversion_date.kind_of? Time) ? DateTime.parse(@conversion_date.to_s) : @conversion_date
44
+ @conversion_date = Java::org.joda.time.DateTime.new(@conversion_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
45
+ end
46
+
47
+ # conversion for base_currency [type = com.ning.billing.catalog.api.Currency]
48
+ @base_currency = Java::com.ning.billing.catalog.api.Currency.value_of("#{@base_currency.to_s}") unless @base_currency.nil?
49
+
50
+ # conversion for rates [type = com.ning.billing.currency.api.Rates]
51
+ @rates = @rates.to_java unless @rates.nil?
52
+ self
53
+ end
54
+
55
+ def to_ruby(j_obj)
56
+ # conversion for conversion_date [type = org.joda.time.DateTime]
57
+ @conversion_date = j_obj.conversion_date
58
+ if !@conversion_date.nil?
59
+ fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time
60
+ str = fmt.print(@conversion_date)
61
+ @conversion_date = DateTime.iso8601(str)
62
+ end
63
+
64
+ # conversion for base_currency [type = com.ning.billing.catalog.api.Currency]
65
+ @base_currency = j_obj.base_currency
66
+ @base_currency = @base_currency.to_s.to_sym unless @base_currency.nil?
67
+
68
+ # conversion for rates [type = com.ning.billing.currency.api.Rates]
69
+ @rates = j_obj.rates
70
+ @rates = Killbill::Plugin::Model::Rates.new.to_ruby(@rates) unless @rates.nil?
71
+ self
72
+ end
73
+
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,96 @@
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.api'
31
+ class CurrencyConversionApi
32
+
33
+ include com.ning.billing.currency.api.CurrencyConversionApi
34
+
35
+ def initialize(real_java_api)
36
+ @real_java_api = real_java_api
37
+ end
38
+
39
+
40
+ java_signature 'Java::java.util.Set getBaseRates()'
41
+ def get_base_rates()
42
+ begin
43
+ res = @real_java_api.get_base_rates()
44
+ # conversion for res [type = java.util.Set]
45
+ tmp = []
46
+ (res || []).each do |m|
47
+ # conversion for m [type = com.ning.billing.catalog.api.Currency]
48
+ m = m.to_s.to_sym unless m.nil?
49
+ tmp << m
50
+ end
51
+ res = tmp
52
+ return res
53
+ rescue Java::com.ning.billing.currency.api.CurrencyConversionException => e
54
+ raise Killbill::Plugin::Model::CurrencyConversionException.new.to_ruby(e)
55
+ end
56
+ end
57
+
58
+ java_signature 'Java::com.ning.billing.currency.api.CurrencyConversion getCurrentCurrencyConversion(Java::com.ning.billing.catalog.api.Currency)'
59
+ def get_current_currency_conversion(baseCurrency)
60
+
61
+ # conversion for baseCurrency [type = com.ning.billing.catalog.api.Currency]
62
+ baseCurrency = Java::com.ning.billing.catalog.api.Currency.value_of("#{baseCurrency.to_s}") unless baseCurrency.nil?
63
+ begin
64
+ res = @real_java_api.get_current_currency_conversion(baseCurrency)
65
+ # conversion for res [type = com.ning.billing.currency.api.CurrencyConversion]
66
+ res = Killbill::Plugin::Model::CurrencyConversion.new.to_ruby(res) unless res.nil?
67
+ return res
68
+ rescue Java::com.ning.billing.currency.api.CurrencyConversionException => e
69
+ raise Killbill::Plugin::Model::CurrencyConversionException.new.to_ruby(e)
70
+ end
71
+ end
72
+
73
+ java_signature 'Java::com.ning.billing.currency.api.CurrencyConversion getCurrencyConversion(Java::com.ning.billing.catalog.api.Currency, Java::org.joda.time.DateTime)'
74
+ def get_currency_conversion(baseCurrency, dateConversion)
75
+
76
+ # conversion for baseCurrency [type = com.ning.billing.catalog.api.Currency]
77
+ baseCurrency = Java::com.ning.billing.catalog.api.Currency.value_of("#{baseCurrency.to_s}") unless baseCurrency.nil?
78
+
79
+ # conversion for dateConversion [type = org.joda.time.DateTime]
80
+ if !dateConversion.nil?
81
+ dateConversion = (dateConversion.kind_of? Time) ? DateTime.parse(dateConversion.to_s) : dateConversion
82
+ dateConversion = Java::org.joda.time.DateTime.new(dateConversion.to_s, Java::org.joda.time.DateTimeZone::UTC)
83
+ end
84
+ begin
85
+ res = @real_java_api.get_currency_conversion(baseCurrency, dateConversion)
86
+ # conversion for res [type = com.ning.billing.currency.api.CurrencyConversion]
87
+ res = Killbill::Plugin::Model::CurrencyConversion.new.to_ruby(res) unless res.nil?
88
+ return res
89
+ rescue Java::com.ning.billing.currency.api.CurrencyConversionException => e
90
+ raise Killbill::Plugin::Model::CurrencyConversionException.new.to_ruby(e)
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,66 @@
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
+ class CurrencyConversionException
31
+
32
+
33
+ attr_accessor :message, :cause, :code
34
+
35
+ def initialize()
36
+ end
37
+
38
+ def to_java()
39
+ # conversion for message [type = java.lang.String]
40
+ @message = @message.to_s unless @message.nil?
41
+
42
+ # conversion for cause [type = java.lang.Throwable]
43
+ @cause = @cause.to_s unless cause.nil?
44
+
45
+ # conversion for code [type = int]
46
+ @code = @code
47
+ Java::com.ning.billing.currency.api.CurrencyConversionException.new(@message, @cause, @code)
48
+ end
49
+
50
+ def to_ruby(j_obj)
51
+ # conversion for message [type = java.lang.String]
52
+ @message = j_obj.message
53
+
54
+ # conversion for cause [type = java.lang.Throwable]
55
+ @cause = j_obj.cause
56
+ @cause = @cause.to_s unless @cause.nil?
57
+
58
+ # conversion for code [type = int]
59
+ @code = j_obj.code
60
+ self
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -32,7 +32,7 @@ module Killbill
32
32
 
33
33
  include com.ning.billing.osgi.api.OSGIKillbill
34
34
 
35
- attr_accessor :account_user_api, :catalog_user_api, :subscription_api, :invoice_payment_api, :invoice_user_api, :payment_api, :tenant_user_api, :usage_user_api, :audit_user_api, :custom_field_user_api, :export_user_api, :tag_user_api, :entitlement_api, :record_id_api, :plugin_config_service_api
35
+ attr_accessor :account_user_api, :catalog_user_api, :subscription_api, :invoice_payment_api, :invoice_user_api, :payment_api, :tenant_user_api, :usage_user_api, :audit_user_api, :custom_field_user_api, :export_user_api, :tag_user_api, :entitlement_api, :record_id_api, :currency_conversion_api, :plugin_config_service_api
36
36
 
37
37
  def initialize()
38
38
  end
@@ -80,6 +80,9 @@ module Killbill
80
80
  # conversion for record_id_api [type = com.ning.billing.util.api.RecordIdApi]
81
81
  @record_id_api = @record_id_api.to_java unless @record_id_api.nil?
82
82
 
83
+ # conversion for currency_conversion_api [type = com.ning.billing.currency.api.CurrencyConversionApi]
84
+ @currency_conversion_api = @currency_conversion_api.to_java unless @currency_conversion_api.nil?
85
+
83
86
  # conversion for plugin_config_service_api [type = com.ning.billing.osgi.api.config.PluginConfigServiceApi]
84
87
  @plugin_config_service_api = @plugin_config_service_api.to_java unless @plugin_config_service_api.nil?
85
88
  self
@@ -142,6 +145,10 @@ module Killbill
142
145
  @record_id_api = j_obj.record_id_api
143
146
  @record_id_api = Killbill::Plugin::Model::RecordIdApi.new.to_ruby(@record_id_api) unless @record_id_api.nil?
144
147
 
148
+ # conversion for currency_conversion_api [type = com.ning.billing.currency.api.CurrencyConversionApi]
149
+ @currency_conversion_api = j_obj.currency_conversion_api
150
+ @currency_conversion_api = Killbill::Plugin::Model::CurrencyConversionApi.new.to_ruby(@currency_conversion_api) unless @currency_conversion_api.nil?
151
+
145
152
  # conversion for plugin_config_service_api [type = com.ning.billing.osgi.api.config.PluginConfigServiceApi]
146
153
  @plugin_config_service_api = j_obj.plugin_config_service_api
147
154
  @plugin_config_service_api = Killbill::Plugin::Model::PluginConfigServiceApi.new.to_ruby(@plugin_config_service_api) unless @plugin_config_service_api.nil?
@@ -201,7 +201,7 @@ module Killbill
201
201
  paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
202
202
 
203
203
  # conversion for invoiceItemIds [type = java.util.Set]
204
- tmp = java.util.ArrayList.new
204
+ tmp = java.util.TreeSet.new
205
205
  (invoiceItemIds || []).each do |m|
206
206
  # conversion for m [type = java.util.UUID]
207
207
  m = java.util.UUID.fromString(m.to_s) unless m.nil?
@@ -0,0 +1,79 @@
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.api'
31
+ class Rates
32
+
33
+ include com.ning.billing.currency.api.Rates
34
+
35
+ attr_accessor :currencies, :rate
36
+
37
+ def initialize()
38
+ end
39
+
40
+ def to_java()
41
+ # conversion for currencies [type = java.util.Set]
42
+ tmp = java.util.TreeSet.new
43
+ (@currencies || []).each do |m|
44
+ # conversion for m [type = com.ning.billing.catalog.api.Currency]
45
+ m = Java::com.ning.billing.catalog.api.Currency.value_of("#{m.to_s}") unless m.nil?
46
+ tmp.add(m)
47
+ end
48
+ @currencies = tmp
49
+
50
+ # conversion for rate [type = java.math.BigDecimal]
51
+ if @rate.nil?
52
+ @rate = java.math.BigDecimal::ZERO
53
+ else
54
+ @rate = java.math.BigDecimal.new(@rate.to_s)
55
+ end
56
+ self
57
+ end
58
+
59
+ def to_ruby(j_obj)
60
+ # conversion for currencies [type = java.util.Set]
61
+ @currencies = j_obj.currencies
62
+ tmp = []
63
+ (@currencies || []).each do |m|
64
+ # conversion for m [type = com.ning.billing.catalog.api.Currency]
65
+ m = m.to_s.to_sym unless m.nil?
66
+ tmp << m
67
+ end
68
+ @currencies = tmp
69
+
70
+ # conversion for rate [type = java.math.BigDecimal]
71
+ @rate = j_obj.rate
72
+ @rate = @rate.nil? ? 0 : BigDecimal.new(@rate.to_s)
73
+ self
74
+ end
75
+
76
+ end
77
+ end
78
+ end
79
+ end
@@ -52,6 +52,10 @@ require 'killbill/gen/api/price_list_set'
52
52
  require 'killbill/gen/api/product'
53
53
  require 'killbill/gen/api/static_catalog'
54
54
  require 'killbill/gen/api/unit'
55
+ require 'killbill/gen/api/currency_conversion'
56
+ require 'killbill/gen/api/currency_conversion_api'
57
+ require 'killbill/gen/api/currency_conversion_exception'
58
+ require 'killbill/gen/api/rates'
55
59
  require 'killbill/gen/api/blockable'
56
60
  require 'killbill/gen/api/blocking_api_exception'
57
61
  require 'killbill/gen/api/blocking_state'
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.8.0
4
+ version: 1.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-26 00:00:00.000000000 Z
12
+ date: 2013-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -143,6 +143,9 @@ files:
143
143
  - lib/killbill/gen/api/catalog_user_api.rb
144
144
  - lib/killbill/gen/api/column_info.rb
145
145
  - lib/killbill/gen/api/control_tag.rb
146
+ - lib/killbill/gen/api/currency_conversion.rb
147
+ - lib/killbill/gen/api/currency_conversion_api.rb
148
+ - lib/killbill/gen/api/currency_conversion_exception.rb
146
149
  - lib/killbill/gen/api/currency_value_null.rb
147
150
  - lib/killbill/gen/api/custom_field.rb
148
151
  - lib/killbill/gen/api/custom_field_api_exception.rb
@@ -191,6 +194,7 @@ files:
191
194
  - lib/killbill/gen/api/price_list.rb
192
195
  - lib/killbill/gen/api/price_list_set.rb
193
196
  - lib/killbill/gen/api/product.rb
197
+ - lib/killbill/gen/api/rates.rb
194
198
  - lib/killbill/gen/api/record_id_api.rb
195
199
  - lib/killbill/gen/api/refund.rb
196
200
  - lib/killbill/gen/api/require_gen.rb