killbill 3.2.3 → 3.2.4

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: 81fd77593c6707e51b7365481f0796b8df77cd6c
4
- data.tar.gz: 78da91e758f7cc14cf63ebe0b5581220dd52545f
3
+ metadata.gz: 5d80b160cae829b2ae91a6b4f855c1c9ba32c245
4
+ data.tar.gz: 82d8f22ef535dc276de788d2cd1824855ea8d394
5
5
  SHA512:
6
- metadata.gz: d36c0fd012d95ea600cc317a8b7c23e1355987989d66b564e5ce54dd8d75c457f4d3ef757787c2db5f0bd3179464865e9235e42abb53c455e6eb583d13e0c263
7
- data.tar.gz: 5510fa30a9acc0cc9ca5fc6cd15b0aef3f22d7cad6d7ba4385007a1ff88c20633a55466fdcc9bae41fe40b8896636179fa7d9c106116be88524e5250a47461e0
6
+ metadata.gz: 657b255d6384163a553f11fbd08587c30e32f4c661d2b825ffa343d00cb9ef2cf032803a074c7462c6fb39ec75ce508eb4ae9d74fcbafb4a5de7eea9a94296e2
7
+ data.tar.gz: f03c8efa2fceb92d1f27eba7b9fca205549ec7e2b00b483e75288938d75c4ab1bb92533ddd5889e0f11fa2b7af83b47b4ac3bd0ca0d8c5e833efdcc8c4d2dbff
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.3
1
+ 3.2.4
data/killbill.gemspec CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'sinatra', '~> 1.3.4'
26
26
  s.add_dependency 'typhoeus', '~> 0.6.9'
27
27
  s.add_dependency 'tzinfo', '~> 1.1.0'
28
- s.add_dependency 'thread_safe', '~> 0.3.4'
29
28
 
30
29
  s.add_development_dependency 'activerecord', '~> 4.1.0'
30
+ s.add_development_dependency 'thread_safe', '~> 0.3.4'
31
31
  if defined?(JRUBY_VERSION)
32
32
  s.add_development_dependency 'activerecord-jdbcmysql-adapter', '~> 1.3.7'
33
33
  s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', '~> 1.3.7'
@@ -2,7 +2,7 @@ require 'killbill/plugin'
2
2
 
3
3
  module Killbill
4
4
  module Plugin
5
- class Currency < PluginBase
5
+ class Currency < Notification
6
6
 
7
7
  class OperationUnsupportedError < NotImplementedError
8
8
  end
@@ -27,11 +27,6 @@ module Killbill
27
27
  raise OperationUnsupportedError
28
28
  end
29
29
 
30
- # Override this method in your plugin to act upon received events
31
- def on_event(event)
32
- # No-op by default
33
- end
34
-
35
30
 
36
31
  end
37
32
  end
@@ -25,12 +25,13 @@
25
25
  #
26
26
 
27
27
 
28
+ require 'killbill/gen/plugin-api/notification_plugin_api'
28
29
  module Killbill
29
30
  module Plugin
30
31
  module Api
31
32
 
32
33
  java_package 'org.killbill.billing.currency.plugin.api'
33
- class CurrencyPluginApi < JPlugin
34
+ class CurrencyPluginApi < NotificationPluginApi
34
35
 
35
36
  include org.killbill.billing.currency.plugin.api.CurrencyPluginApi
36
37
 
@@ -25,12 +25,13 @@
25
25
  #
26
26
 
27
27
 
28
+ require 'killbill/gen/plugin-api/notification_plugin_api'
28
29
  module Killbill
29
30
  module Plugin
30
31
  module Api
31
32
 
32
33
  java_package 'org.killbill.billing.invoice.plugin.api'
33
- class InvoicePluginApi < JPlugin
34
+ class InvoicePluginApi < NotificationPluginApi
34
35
 
35
36
  include org.killbill.billing.invoice.plugin.api.InvoicePluginApi
36
37
 
@@ -25,12 +25,13 @@
25
25
  #
26
26
 
27
27
 
28
+ require 'killbill/gen/plugin-api/notification_plugin_api'
28
29
  module Killbill
29
30
  module Plugin
30
31
  module Api
31
32
 
32
33
  java_package 'org.killbill.billing.payment.plugin.api'
33
- class PaymentPluginApi < JPlugin
34
+ class PaymentPluginApi < NotificationPluginApi
34
35
 
35
36
  include org.killbill.billing.payment.plugin.api.PaymentPluginApi
36
37
 
@@ -28,13 +28,10 @@
28
28
  require 'killbill/gen/plugin-api/payment_method_info_plugin'
29
29
  require 'killbill/gen/plugin-api/payment_plugin_api'
30
30
  require 'killbill/gen/plugin-api/payment_plugin_api_exception'
31
- require 'killbill/gen/plugin-api/payment_plugin_with_events_api'
32
31
  require 'killbill/gen/plugin-api/ext_bus_event'
33
32
  require 'killbill/gen/plugin-api/notification_plugin_api'
34
33
  require 'killbill/gen/plugin-api/invoice_plugin_api'
35
- require 'killbill/gen/plugin-api/invoice_plugin_with_events_api'
36
34
  require 'killbill/gen/plugin-api/currency_plugin_api'
37
- require 'killbill/gen/plugin-api/currency_plugin_with_events_api'
38
35
  require 'killbill/gen/plugin-api/gateway_notification'
39
36
  require 'killbill/gen/plugin-api/hosted_payment_page_form_descriptor'
40
37
  require 'killbill/gen/plugin-api/payment_transaction_info_plugin'
@@ -3,17 +3,12 @@ require 'securerandom'
3
3
 
4
4
  module Killbill
5
5
  module Plugin
6
- class Invoice < PluginBase
6
+ class Invoice < Notification
7
7
 
8
8
  def get_additional_invoice_items(invoice, properties, context)
9
9
  []
10
10
  end
11
11
 
12
- # Override this method in your plugin to act upon received events
13
- def on_event(event)
14
- # No-op by default
15
- end
16
-
17
12
 
18
13
  # Helper method to build a new item from an existing one
19
14
  def build_item(item_model, amount, description = nil, type = :EXTERNAL_CHARGE)
@@ -2,7 +2,7 @@ require 'killbill/plugin'
2
2
 
3
3
  module Killbill
4
4
  module Plugin
5
- class Payment < PluginBase
5
+ class Payment < Notification
6
6
 
7
7
  class OperationUnsupportedByGatewayError < NotImplementedError
8
8
  end
@@ -75,11 +75,6 @@ module Killbill
75
75
  raise OperationUnsupportedByGatewayError
76
76
  end
77
77
 
78
- # Override this method in your plugin to act upon received events
79
- def on_event(event)
80
- # No-op by default
81
- end
82
-
83
78
  end
84
79
  end
85
80
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-07 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -53,31 +53,31 @@ dependencies:
53
53
  prerelease: false
54
54
  type: :runtime
55
55
  - !ruby/object:Gem::Dependency
56
- name: thread_safe
56
+ name: activerecord
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.3.4
61
+ version: 4.1.0
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ~>
65
65
  - !ruby/object:Gem::Version
66
- version: 0.3.4
66
+ version: 4.1.0
67
67
  prerelease: false
68
- type: :runtime
68
+ type: :development
69
69
  - !ruby/object:Gem::Dependency
70
- name: activerecord
70
+ name: thread_safe
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 4.1.0
75
+ version: 0.3.4
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ~>
79
79
  - !ruby/object:Gem::Version
80
- version: 4.1.0
80
+ version: 0.3.4
81
81
  prerelease: false
82
82
  type: :development
83
83
  - !ruby/object:Gem::Dependency
@@ -425,17 +425,14 @@ files:
425
425
  - lib/killbill/gen/api/usage_record.rb
426
426
  - lib/killbill/gen/api/usage_user_api.rb
427
427
  - lib/killbill/gen/plugin-api/currency_plugin_api.rb
428
- - lib/killbill/gen/plugin-api/currency_plugin_with_events_api.rb
429
428
  - lib/killbill/gen/plugin-api/ext_bus_event.rb
430
429
  - lib/killbill/gen/plugin-api/gateway_notification.rb
431
430
  - lib/killbill/gen/plugin-api/hosted_payment_page_form_descriptor.rb
432
431
  - lib/killbill/gen/plugin-api/invoice_plugin_api.rb
433
- - lib/killbill/gen/plugin-api/invoice_plugin_with_events_api.rb
434
432
  - lib/killbill/gen/plugin-api/notification_plugin_api.rb
435
433
  - lib/killbill/gen/plugin-api/payment_method_info_plugin.rb
436
434
  - lib/killbill/gen/plugin-api/payment_plugin_api.rb
437
435
  - lib/killbill/gen/plugin-api/payment_plugin_api_exception.rb
438
- - lib/killbill/gen/plugin-api/payment_plugin_with_events_api.rb
439
436
  - lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb
440
437
  - lib/killbill/gen/plugin-api/require_gen.rb
441
438
  - lib/killbill/helpers/active_merchant.rb
@@ -1,207 +0,0 @@
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 Killbill
29
- module Plugin
30
- module Api
31
-
32
- java_package 'org.killbill.billing.currency.plugin.api'
33
- class CurrencyPluginWithEventsApi < JPlugin
34
-
35
- include org.killbill.billing.currency.plugin.api.CurrencyPluginWithEventsApi
36
-
37
- def initialize(real_class_name, services = {})
38
- super(real_class_name, services)
39
- end
40
-
41
-
42
- java_signature 'Java::void onEvent(Java::org.killbill.billing.notification.plugin.api.ExtBusEvent)'
43
- def on_event(killbillEvent)
44
-
45
- # conversion for killbillEvent [type = org.killbill.billing.notification.plugin.api.ExtBusEvent]
46
- killbillEvent = Killbill::Plugin::Model::ExtBusEvent.new.to_ruby(killbillEvent) unless killbillEvent.nil?
47
- begin
48
- @delegate_plugin.on_event(killbillEvent)
49
- rescue Exception => e
50
- message = "Failure in on_event: #{e}"
51
- unless e.backtrace.nil?
52
- message = "#{message}\n#{e.backtrace.join("\n")}"
53
- end
54
- logger.warn message
55
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("on_event failure", e.message)
56
- ensure
57
- @delegate_plugin.after_request
58
- end
59
- end
60
-
61
- java_signature 'Java::java.util.Set getBaseCurrencies()'
62
- def get_base_currencies()
63
- begin
64
- res = @delegate_plugin.get_base_currencies()
65
- # conversion for res [type = java.util.Set]
66
- tmp = java.util.TreeSet.new
67
- (res || []).each do |m|
68
- # conversion for m [type = org.killbill.billing.catalog.api.Currency]
69
- m = Java::org.killbill.billing.catalog.api.Currency.value_of("#{m.to_s}") unless m.nil?
70
- tmp.add(m)
71
- end
72
- res = tmp
73
- return res
74
- rescue Exception => e
75
- message = "Failure in get_base_currencies: #{e}"
76
- unless e.backtrace.nil?
77
- message = "#{message}\n#{e.backtrace.join("\n")}"
78
- end
79
- logger.warn message
80
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_base_currencies failure", e.message)
81
- ensure
82
- @delegate_plugin.after_request
83
- end
84
- end
85
-
86
- java_signature 'Java::org.joda.time.DateTime getLatestConversionDate(Java::org.killbill.billing.catalog.api.Currency)'
87
- def get_latest_conversion_date(baseCurrency)
88
-
89
- # conversion for baseCurrency [type = org.killbill.billing.catalog.api.Currency]
90
- baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
91
- begin
92
- res = @delegate_plugin.get_latest_conversion_date(baseCurrency)
93
- # conversion for res [type = org.joda.time.DateTime]
94
- if !res.nil?
95
- res = (res.kind_of? Time) ? DateTime.parse(res.to_s) : res
96
- res = Java::org.joda.time.DateTime.new(res.to_s, Java::org.joda.time.DateTimeZone::UTC)
97
- end
98
- return res
99
- rescue Exception => e
100
- message = "Failure in get_latest_conversion_date: #{e}"
101
- unless e.backtrace.nil?
102
- message = "#{message}\n#{e.backtrace.join("\n")}"
103
- end
104
- logger.warn message
105
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_latest_conversion_date failure", e.message)
106
- ensure
107
- @delegate_plugin.after_request
108
- end
109
- end
110
-
111
- java_signature 'Java::java.util.SortedSet getConversionDates(Java::org.killbill.billing.catalog.api.Currency)'
112
- def get_conversion_dates(baseCurrency)
113
-
114
- # conversion for baseCurrency [type = org.killbill.billing.catalog.api.Currency]
115
- baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
116
- begin
117
- res = @delegate_plugin.get_conversion_dates(baseCurrency)
118
- # conversion for res [type = java.util.SortedSet]
119
- tmp = java.util.TreeSet.new
120
- (res || []).each do |m|
121
- # conversion for m [type = org.joda.time.DateTime]
122
- if !m.nil?
123
- m = (m.kind_of? Time) ? DateTime.parse(m.to_s) : m
124
- m = Java::org.joda.time.DateTime.new(m.to_s, Java::org.joda.time.DateTimeZone::UTC)
125
- end
126
- tmp.add(m)
127
- end
128
- res = tmp
129
- return res
130
- rescue Exception => e
131
- message = "Failure in get_conversion_dates: #{e}"
132
- unless e.backtrace.nil?
133
- message = "#{message}\n#{e.backtrace.join("\n")}"
134
- end
135
- logger.warn message
136
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_conversion_dates failure", e.message)
137
- ensure
138
- @delegate_plugin.after_request
139
- end
140
- end
141
-
142
- java_signature 'Java::java.util.Set getCurrentRates(Java::org.killbill.billing.catalog.api.Currency)'
143
- def get_current_rates(baseCurrency)
144
-
145
- # conversion for baseCurrency [type = org.killbill.billing.catalog.api.Currency]
146
- baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
147
- begin
148
- res = @delegate_plugin.get_current_rates(baseCurrency)
149
- # conversion for res [type = java.util.Set]
150
- tmp = java.util.TreeSet.new
151
- (res || []).each do |m|
152
- # conversion for m [type = org.killbill.billing.currency.api.Rate]
153
- m = m.to_java unless m.nil?
154
- tmp.add(m)
155
- end
156
- res = tmp
157
- return res
158
- rescue Exception => e
159
- message = "Failure in get_current_rates: #{e}"
160
- unless e.backtrace.nil?
161
- message = "#{message}\n#{e.backtrace.join("\n")}"
162
- end
163
- logger.warn message
164
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_current_rates failure", e.message)
165
- ensure
166
- @delegate_plugin.after_request
167
- end
168
- end
169
-
170
- java_signature 'Java::java.util.Set getRates(Java::org.killbill.billing.catalog.api.Currency, Java::org.joda.time.DateTime)'
171
- def get_rates(baseCurrency, conversionDate)
172
-
173
- # conversion for baseCurrency [type = org.killbill.billing.catalog.api.Currency]
174
- baseCurrency = baseCurrency.to_s.to_sym unless baseCurrency.nil?
175
-
176
- # conversion for conversionDate [type = org.joda.time.DateTime]
177
- if !conversionDate.nil?
178
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
179
- str = fmt.print(conversionDate)
180
- conversionDate = DateTime.iso8601(str)
181
- end
182
- begin
183
- res = @delegate_plugin.get_rates(baseCurrency, conversionDate)
184
- # conversion for res [type = java.util.Set]
185
- tmp = java.util.TreeSet.new
186
- (res || []).each do |m|
187
- # conversion for m [type = org.killbill.billing.currency.api.Rate]
188
- m = m.to_java unless m.nil?
189
- tmp.add(m)
190
- end
191
- res = tmp
192
- return res
193
- rescue Exception => e
194
- message = "Failure in get_rates: #{e}"
195
- unless e.backtrace.nil?
196
- message = "#{message}\n#{e.backtrace.join("\n")}"
197
- end
198
- logger.warn message
199
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_rates failure", e.message)
200
- ensure
201
- @delegate_plugin.after_request
202
- end
203
- end
204
- end
205
- end
206
- end
207
- end
@@ -1,103 +0,0 @@
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 Killbill
29
- module Plugin
30
- module Api
31
-
32
- java_package 'org.killbill.billing.invoice.plugin.api'
33
- class InvoicePluginWithEventsApi < JPlugin
34
-
35
- include org.killbill.billing.invoice.plugin.api.InvoicePluginWithEventsApi
36
-
37
- def initialize(real_class_name, services = {})
38
- super(real_class_name, services)
39
- end
40
-
41
-
42
- java_signature 'Java::void onEvent(Java::org.killbill.billing.notification.plugin.api.ExtBusEvent)'
43
- def on_event(killbillEvent)
44
-
45
- # conversion for killbillEvent [type = org.killbill.billing.notification.plugin.api.ExtBusEvent]
46
- killbillEvent = Killbill::Plugin::Model::ExtBusEvent.new.to_ruby(killbillEvent) unless killbillEvent.nil?
47
- begin
48
- @delegate_plugin.on_event(killbillEvent)
49
- rescue Exception => e
50
- message = "Failure in on_event: #{e}"
51
- unless e.backtrace.nil?
52
- message = "#{message}\n#{e.backtrace.join("\n")}"
53
- end
54
- logger.warn message
55
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("on_event failure", e.message)
56
- ensure
57
- @delegate_plugin.after_request
58
- end
59
- end
60
-
61
- java_signature 'Java::java.util.List getAdditionalInvoiceItems(Java::org.killbill.billing.invoice.api.Invoice, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
62
- def get_additional_invoice_items(invoice, properties, context)
63
-
64
- # conversion for invoice [type = org.killbill.billing.invoice.api.Invoice]
65
- invoice = Killbill::Plugin::Model::Invoice.new.to_ruby(invoice) unless invoice.nil?
66
-
67
- # conversion for properties [type = java.lang.Iterable]
68
- tmp = []
69
- (properties.nil? ? [] : properties.iterator).each do |m|
70
- # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
71
- m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
72
- tmp << m
73
- end
74
- properties = tmp
75
-
76
- # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
77
- context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
78
- begin
79
- res = @delegate_plugin.get_additional_invoice_items(invoice, properties, context)
80
- # conversion for res [type = java.util.List]
81
- tmp = java.util.ArrayList.new
82
- (res || []).each do |m|
83
- # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
84
- m = m.to_java unless m.nil?
85
- tmp.add(m)
86
- end
87
- res = tmp
88
- return res
89
- rescue Exception => e
90
- message = "Failure in get_additional_invoice_items: #{e}"
91
- unless e.backtrace.nil?
92
- message = "#{message}\n#{e.backtrace.join("\n")}"
93
- end
94
- logger.warn message
95
- raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_additional_invoice_items failure", e.message)
96
- ensure
97
- @delegate_plugin.after_request
98
- end
99
- end
100
- end
101
- end
102
- end
103
- end