killbill 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/killbill.gemspec +1 -1
- data/lib/killbill/currency.rb +1 -6
- data/lib/killbill/gen/plugin-api/currency_plugin_api.rb +2 -1
- data/lib/killbill/gen/plugin-api/invoice_plugin_api.rb +2 -1
- data/lib/killbill/gen/plugin-api/payment_plugin_api.rb +2 -1
- data/lib/killbill/gen/plugin-api/require_gen.rb +0 -3
- data/lib/killbill/invoice.rb +1 -6
- data/lib/killbill/payment.rb +1 -6
- metadata +9 -12
- data/lib/killbill/gen/plugin-api/currency_plugin_with_events_api.rb +0 -207
- data/lib/killbill/gen/plugin-api/invoice_plugin_with_events_api.rb +0 -103
- data/lib/killbill/gen/plugin-api/payment_plugin_with_events_api.rb +0 -782
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d80b160cae829b2ae91a6b4f855c1c9ba32c245
|
4
|
+
data.tar.gz: 82d8f22ef535dc276de788d2cd1824855ea8d394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 657b255d6384163a553f11fbd08587c30e32f4c661d2b825ffa343d00cb9ef2cf032803a074c7462c6fb39ec75ce508eb4ae9d74fcbafb4a5de7eea9a94296e2
|
7
|
+
data.tar.gz: f03c8efa2fceb92d1f27eba7b9fca205549ec7e2b00b483e75288938d75c4ab1bb92533ddd5889e0f11fa2b7af83b47b4ac3bd0ca0d8c5e833efdcc8c4d2dbff
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
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'
|
data/lib/killbill/currency.rb
CHANGED
@@ -2,7 +2,7 @@ require 'killbill/plugin'
|
|
2
2
|
|
3
3
|
module Killbill
|
4
4
|
module Plugin
|
5
|
-
class Currency <
|
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 <
|
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 <
|
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 <
|
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'
|
data/lib/killbill/invoice.rb
CHANGED
@@ -3,17 +3,12 @@ require 'securerandom'
|
|
3
3
|
|
4
4
|
module Killbill
|
5
5
|
module Plugin
|
6
|
-
class Invoice <
|
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)
|
data/lib/killbill/payment.rb
CHANGED
@@ -2,7 +2,7 @@ require 'killbill/plugin'
|
|
2
2
|
|
3
3
|
module Killbill
|
4
4
|
module Plugin
|
5
|
-
class Payment <
|
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.
|
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-
|
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:
|
56
|
+
name: activerecord
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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:
|
66
|
+
version: 4.1.0
|
67
67
|
prerelease: false
|
68
|
-
type: :
|
68
|
+
type: :development
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
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:
|
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:
|
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
|