killbill 4.4.0 → 5.0.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/Gemfile.lock +2 -2
- data/Jarfile +8 -7
- data/Jarfile.lock +8 -7
- data/NEWS +4 -0
- data/gen_config/plugin_api.conf +4 -2
- data/generators/active_merchant/templates/Jarfile.rb +8 -7
- data/generators/active_merchant/templates/config.yml.rb +4 -1
- data/generators/active_merchant/templates/db/ddl.sql.rb +73 -73
- data/generators/active_merchant/templates/plugin.gemspec.rb +1 -0
- data/generators/active_merchant/templates/spec/integration_spec.rb +4 -3
- data/lib/killbill/entitlement.rb +23 -0
- data/lib/killbill/gen/api/entitlement_api.rb +72 -18
- data/lib/killbill/gen/plugin-api/control_result.rb +70 -0
- data/lib/killbill/gen/plugin-api/entitlement_context.rb +215 -0
- data/lib/killbill/gen/plugin-api/entitlement_plugin_api.rb +138 -0
- data/lib/killbill/gen/plugin-api/entitlement_plugin_api_exception.rb +51 -0
- data/lib/killbill/gen/plugin-api/{on_success_payment_routing_result.rb → on_failure_entitlement_result.rb} +3 -3
- data/lib/killbill/gen/plugin-api/{on_failure_payment_routing_result.rb → on_failure_payment_control_result.rb} +23 -4
- data/lib/killbill/gen/plugin-api/on_success_entitlement_result.rb +53 -0
- data/lib/killbill/gen/plugin-api/on_success_payment_control_result.rb +70 -0
- data/lib/killbill/gen/plugin-api/{payment_routing_api_exception.rb → payment_control_api_exception.rb} +2 -2
- data/lib/killbill/gen/plugin-api/{payment_routing_context.rb → payment_control_context.rb} +18 -23
- data/lib/killbill/gen/plugin-api/{payment_routing_plugin_api.rb → payment_control_plugin_api.rb} +15 -15
- data/lib/killbill/gen/plugin-api/prior_entitlement_result.rb +119 -0
- data/lib/killbill/gen/plugin-api/{prior_payment_routing_result.rb → prior_payment_control_result.rb} +21 -21
- data/lib/killbill/gen/plugin-api/require_gen.rb +13 -6
- data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +4 -5
- data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +15 -2
- data/lib/killbill/helpers/active_merchant/configuration.rb +1 -1
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +1 -1
- data/lib/killbill/killbill_logger.rb +2 -0
- data/lib/killbill/payment_control.rb +4 -4
- data/lib/killbill/version.rb +1 -1
- data/spec/killbill/helpers/payment_method_spec.rb +2 -2
- data/spec/killbill/helpers/payment_plugin_spec.rb +11 -0
- data/spec/killbill/helpers/response_spec.rb +2 -2
- data/spec/killbill/killbill_logger_spec.rb +2 -0
- metadata +17 -9
@@ -0,0 +1,70 @@
|
|
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 Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.control.plugin.api'
|
33
|
+
class ControlResult
|
34
|
+
|
35
|
+
include org.killbill.billing.control.plugin.api.ControlResult
|
36
|
+
|
37
|
+
attr_accessor :adjusted_plugin_properties
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
44
|
+
tmp = java.util.ArrayList.new
|
45
|
+
(@adjusted_plugin_properties || []).each do |m|
|
46
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
47
|
+
m = m.to_java unless m.nil?
|
48
|
+
tmp.add(m)
|
49
|
+
end
|
50
|
+
@adjusted_plugin_properties = tmp
|
51
|
+
self
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_ruby(j_obj)
|
55
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
56
|
+
@adjusted_plugin_properties = j_obj.adjusted_plugin_properties
|
57
|
+
tmp = []
|
58
|
+
(@adjusted_plugin_properties.nil? ? [] : @adjusted_plugin_properties.iterator).each do |m|
|
59
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
60
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
61
|
+
tmp << m
|
62
|
+
end
|
63
|
+
@adjusted_plugin_properties = tmp
|
64
|
+
self
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,215 @@
|
|
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 Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.entitlement.plugin.api'
|
33
|
+
class EntitlementContext
|
34
|
+
|
35
|
+
include org.killbill.billing.entitlement.plugin.api.EntitlementContext
|
36
|
+
|
37
|
+
attr_accessor :user_token, :user_name, :call_origin, :user_type, :reason_code, :comments, :created_date, :updated_date, :tenant_id, :operation_type, :account_id, :destination_account_id, :bundle_id, :plan_phase_specifier, :external_key, :plan_phase_price_override, :effective_date, :plugin_properties
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for user_token [type = java.util.UUID]
|
44
|
+
@user_token = java.util.UUID.fromString(@user_token.to_s) unless @user_token.nil?
|
45
|
+
|
46
|
+
# conversion for user_name [type = java.lang.String]
|
47
|
+
@user_name = @user_name.to_s unless @user_name.nil?
|
48
|
+
|
49
|
+
# conversion for call_origin [type = org.killbill.billing.util.callcontext.CallOrigin]
|
50
|
+
@call_origin = Java::org.killbill.billing.util.callcontext.CallOrigin.value_of( @call_origin.to_s ) unless @call_origin.nil?
|
51
|
+
|
52
|
+
# conversion for user_type [type = org.killbill.billing.util.callcontext.UserType]
|
53
|
+
@user_type = Java::org.killbill.billing.util.callcontext.UserType.value_of( @user_type.to_s ) unless @user_type.nil?
|
54
|
+
|
55
|
+
# conversion for reason_code [type = java.lang.String]
|
56
|
+
@reason_code = @reason_code.to_s unless @reason_code.nil?
|
57
|
+
|
58
|
+
# conversion for comments [type = java.lang.String]
|
59
|
+
@comments = @comments.to_s unless @comments.nil?
|
60
|
+
|
61
|
+
# conversion for created_date [type = org.joda.time.DateTime]
|
62
|
+
if !@created_date.nil?
|
63
|
+
@created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
|
64
|
+
@created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
|
65
|
+
end
|
66
|
+
|
67
|
+
# conversion for updated_date [type = org.joda.time.DateTime]
|
68
|
+
if !@updated_date.nil?
|
69
|
+
@updated_date = (@updated_date.kind_of? Time) ? DateTime.parse(@updated_date.to_s) : @updated_date
|
70
|
+
@updated_date = Java::org.joda.time.DateTime.new(@updated_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
|
71
|
+
end
|
72
|
+
|
73
|
+
# conversion for tenant_id [type = java.util.UUID]
|
74
|
+
@tenant_id = java.util.UUID.fromString(@tenant_id.to_s) unless @tenant_id.nil?
|
75
|
+
|
76
|
+
# conversion for operation_type [type = org.killbill.billing.entitlement.plugin.api.OperationType]
|
77
|
+
@operation_type = Java::org.killbill.billing.entitlement.plugin.api.OperationType.value_of( @operation_type.to_s ) unless @operation_type.nil?
|
78
|
+
|
79
|
+
# conversion for account_id [type = java.util.UUID]
|
80
|
+
@account_id = java.util.UUID.fromString(@account_id.to_s) unless @account_id.nil?
|
81
|
+
|
82
|
+
# conversion for destination_account_id [type = java.util.UUID]
|
83
|
+
@destination_account_id = java.util.UUID.fromString(@destination_account_id.to_s) unless @destination_account_id.nil?
|
84
|
+
|
85
|
+
# conversion for bundle_id [type = java.util.UUID]
|
86
|
+
@bundle_id = java.util.UUID.fromString(@bundle_id.to_s) unless @bundle_id.nil?
|
87
|
+
|
88
|
+
# conversion for plan_phase_specifier [type = org.killbill.billing.catalog.api.PlanPhaseSpecifier]
|
89
|
+
@plan_phase_specifier = @plan_phase_specifier.to_java unless @plan_phase_specifier.nil?
|
90
|
+
|
91
|
+
# conversion for external_key [type = java.lang.String]
|
92
|
+
@external_key = @external_key.to_s unless @external_key.nil?
|
93
|
+
|
94
|
+
# conversion for plan_phase_price_override [type = java.util.List]
|
95
|
+
tmp = java.util.ArrayList.new
|
96
|
+
(@plan_phase_price_override || []).each do |m|
|
97
|
+
# conversion for m [type = org.killbill.billing.catalog.api.PlanPhasePriceOverride]
|
98
|
+
m = m.to_java unless m.nil?
|
99
|
+
tmp.add(m)
|
100
|
+
end
|
101
|
+
@plan_phase_price_override = tmp
|
102
|
+
|
103
|
+
# conversion for effective_date [type = org.joda.time.LocalDate]
|
104
|
+
if !@effective_date.nil?
|
105
|
+
@effective_date = Java::org.joda.time.LocalDate.parse(@effective_date.to_s)
|
106
|
+
end
|
107
|
+
|
108
|
+
# conversion for plugin_properties [type = java.lang.Iterable]
|
109
|
+
tmp = java.util.ArrayList.new
|
110
|
+
(@plugin_properties || []).each do |m|
|
111
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
112
|
+
m = m.to_java unless m.nil?
|
113
|
+
tmp.add(m)
|
114
|
+
end
|
115
|
+
@plugin_properties = tmp
|
116
|
+
self
|
117
|
+
end
|
118
|
+
|
119
|
+
def to_ruby(j_obj)
|
120
|
+
# conversion for user_token [type = java.util.UUID]
|
121
|
+
@user_token = j_obj.user_token
|
122
|
+
@user_token = @user_token.nil? ? nil : @user_token.to_s
|
123
|
+
|
124
|
+
# conversion for user_name [type = java.lang.String]
|
125
|
+
@user_name = j_obj.user_name
|
126
|
+
|
127
|
+
# conversion for call_origin [type = org.killbill.billing.util.callcontext.CallOrigin]
|
128
|
+
@call_origin = j_obj.call_origin
|
129
|
+
@call_origin = @call_origin.to_s.to_sym unless @call_origin.nil?
|
130
|
+
|
131
|
+
# conversion for user_type [type = org.killbill.billing.util.callcontext.UserType]
|
132
|
+
@user_type = j_obj.user_type
|
133
|
+
@user_type = @user_type.to_s.to_sym unless @user_type.nil?
|
134
|
+
|
135
|
+
# conversion for reason_code [type = java.lang.String]
|
136
|
+
@reason_code = j_obj.reason_code
|
137
|
+
|
138
|
+
# conversion for comments [type = java.lang.String]
|
139
|
+
@comments = j_obj.comments
|
140
|
+
|
141
|
+
# conversion for created_date [type = org.joda.time.DateTime]
|
142
|
+
@created_date = j_obj.created_date
|
143
|
+
if !@created_date.nil?
|
144
|
+
fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
|
145
|
+
str = fmt.print(@created_date)
|
146
|
+
@created_date = DateTime.iso8601(str)
|
147
|
+
end
|
148
|
+
|
149
|
+
# conversion for updated_date [type = org.joda.time.DateTime]
|
150
|
+
@updated_date = j_obj.updated_date
|
151
|
+
if !@updated_date.nil?
|
152
|
+
fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
|
153
|
+
str = fmt.print(@updated_date)
|
154
|
+
@updated_date = DateTime.iso8601(str)
|
155
|
+
end
|
156
|
+
|
157
|
+
# conversion for tenant_id [type = java.util.UUID]
|
158
|
+
@tenant_id = j_obj.tenant_id
|
159
|
+
@tenant_id = @tenant_id.nil? ? nil : @tenant_id.to_s
|
160
|
+
|
161
|
+
# conversion for operation_type [type = org.killbill.billing.entitlement.plugin.api.OperationType]
|
162
|
+
@operation_type = j_obj.operation_type
|
163
|
+
@operation_type = @operation_type.to_s.to_sym unless @operation_type.nil?
|
164
|
+
|
165
|
+
# conversion for account_id [type = java.util.UUID]
|
166
|
+
@account_id = j_obj.account_id
|
167
|
+
@account_id = @account_id.nil? ? nil : @account_id.to_s
|
168
|
+
|
169
|
+
# conversion for destination_account_id [type = java.util.UUID]
|
170
|
+
@destination_account_id = j_obj.destination_account_id
|
171
|
+
@destination_account_id = @destination_account_id.nil? ? nil : @destination_account_id.to_s
|
172
|
+
|
173
|
+
# conversion for bundle_id [type = java.util.UUID]
|
174
|
+
@bundle_id = j_obj.bundle_id
|
175
|
+
@bundle_id = @bundle_id.nil? ? nil : @bundle_id.to_s
|
176
|
+
|
177
|
+
# conversion for plan_phase_specifier [type = org.killbill.billing.catalog.api.PlanPhaseSpecifier]
|
178
|
+
@plan_phase_specifier = j_obj.plan_phase_specifier
|
179
|
+
@plan_phase_specifier = Killbill::Plugin::Model::PlanPhaseSpecifier.new.to_ruby(@plan_phase_specifier) unless @plan_phase_specifier.nil?
|
180
|
+
|
181
|
+
# conversion for external_key [type = java.lang.String]
|
182
|
+
@external_key = j_obj.external_key
|
183
|
+
|
184
|
+
# conversion for plan_phase_price_override [type = java.util.List]
|
185
|
+
@plan_phase_price_override = j_obj.plan_phase_price_override
|
186
|
+
tmp = []
|
187
|
+
(@plan_phase_price_override || []).each do |m|
|
188
|
+
# conversion for m [type = org.killbill.billing.catalog.api.PlanPhasePriceOverride]
|
189
|
+
m = Killbill::Plugin::Model::PlanPhasePriceOverride.new.to_ruby(m) unless m.nil?
|
190
|
+
tmp << m
|
191
|
+
end
|
192
|
+
@plan_phase_price_override = tmp
|
193
|
+
|
194
|
+
# conversion for effective_date [type = org.joda.time.LocalDate]
|
195
|
+
@effective_date = j_obj.effective_date
|
196
|
+
if !@effective_date.nil?
|
197
|
+
@effective_date = @effective_date.to_s
|
198
|
+
end
|
199
|
+
|
200
|
+
# conversion for plugin_properties [type = java.lang.Iterable]
|
201
|
+
@plugin_properties = j_obj.plugin_properties
|
202
|
+
tmp = []
|
203
|
+
(@plugin_properties.nil? ? [] : @plugin_properties.iterator).each do |m|
|
204
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
205
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
206
|
+
tmp << m
|
207
|
+
end
|
208
|
+
@plugin_properties = tmp
|
209
|
+
self
|
210
|
+
end
|
211
|
+
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
@@ -0,0 +1,138 @@
|
|
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
|
+
require 'killbill/gen/plugin-api/notification_plugin_api'
|
29
|
+
module Killbill
|
30
|
+
module Plugin
|
31
|
+
module Api
|
32
|
+
|
33
|
+
java_package 'org.killbill.billing.entitlement.plugin.api'
|
34
|
+
class EntitlementPluginApi < NotificationPluginApi
|
35
|
+
|
36
|
+
include org.killbill.billing.entitlement.plugin.api.EntitlementPluginApi
|
37
|
+
|
38
|
+
def initialize(real_class_name, services = {})
|
39
|
+
super(real_class_name, services)
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
java_signature 'Java::org.killbill.billing.entitlement.plugin.api.PriorEntitlementResult priorCall(Java::org.killbill.billing.entitlement.plugin.api.EntitlementContext, Java::java.lang.Iterable)'
|
44
|
+
def prior_call(context, properties)
|
45
|
+
|
46
|
+
# conversion for context [type = org.killbill.billing.entitlement.plugin.api.EntitlementContext]
|
47
|
+
context = Killbill::Plugin::Model::EntitlementContext.new.to_ruby(context) unless context.nil?
|
48
|
+
|
49
|
+
# conversion for properties [type = java.lang.Iterable]
|
50
|
+
tmp = []
|
51
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
52
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
53
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
54
|
+
tmp << m
|
55
|
+
end
|
56
|
+
properties = tmp
|
57
|
+
begin
|
58
|
+
res = @delegate_plugin.prior_call(context, properties)
|
59
|
+
# conversion for res [type = org.killbill.billing.entitlement.plugin.api.PriorEntitlementResult]
|
60
|
+
res = res.to_java unless res.nil?
|
61
|
+
return res
|
62
|
+
rescue Exception => e
|
63
|
+
message = "Failure in prior_call: #{e}"
|
64
|
+
unless e.backtrace.nil?
|
65
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
66
|
+
end
|
67
|
+
logger.warn message
|
68
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("prior_call failure", e.message)
|
69
|
+
ensure
|
70
|
+
@delegate_plugin.after_request
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
java_signature 'Java::org.killbill.billing.entitlement.plugin.api.OnSuccessEntitlementResult onSuccessCall(Java::org.killbill.billing.entitlement.plugin.api.EntitlementContext, Java::java.lang.Iterable)'
|
75
|
+
def on_success_call(context, properties)
|
76
|
+
|
77
|
+
# conversion for context [type = org.killbill.billing.entitlement.plugin.api.EntitlementContext]
|
78
|
+
context = Killbill::Plugin::Model::EntitlementContext.new.to_ruby(context) unless context.nil?
|
79
|
+
|
80
|
+
# conversion for properties [type = java.lang.Iterable]
|
81
|
+
tmp = []
|
82
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
83
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
84
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
85
|
+
tmp << m
|
86
|
+
end
|
87
|
+
properties = tmp
|
88
|
+
begin
|
89
|
+
res = @delegate_plugin.on_success_call(context, properties)
|
90
|
+
# conversion for res [type = org.killbill.billing.entitlement.plugin.api.OnSuccessEntitlementResult]
|
91
|
+
res = res.to_java unless res.nil?
|
92
|
+
return res
|
93
|
+
rescue Exception => e
|
94
|
+
message = "Failure in on_success_call: #{e}"
|
95
|
+
unless e.backtrace.nil?
|
96
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
97
|
+
end
|
98
|
+
logger.warn message
|
99
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("on_success_call failure", e.message)
|
100
|
+
ensure
|
101
|
+
@delegate_plugin.after_request
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
java_signature 'Java::org.killbill.billing.entitlement.plugin.api.OnFailureEntitlementResult onFailureCall(Java::org.killbill.billing.entitlement.plugin.api.EntitlementContext, Java::java.lang.Iterable)'
|
106
|
+
def on_failure_call(context, properties)
|
107
|
+
|
108
|
+
# conversion for context [type = org.killbill.billing.entitlement.plugin.api.EntitlementContext]
|
109
|
+
context = Killbill::Plugin::Model::EntitlementContext.new.to_ruby(context) unless context.nil?
|
110
|
+
|
111
|
+
# conversion for properties [type = java.lang.Iterable]
|
112
|
+
tmp = []
|
113
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
114
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
115
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
116
|
+
tmp << m
|
117
|
+
end
|
118
|
+
properties = tmp
|
119
|
+
begin
|
120
|
+
res = @delegate_plugin.on_failure_call(context, properties)
|
121
|
+
# conversion for res [type = org.killbill.billing.entitlement.plugin.api.OnFailureEntitlementResult]
|
122
|
+
res = res.to_java unless res.nil?
|
123
|
+
return res
|
124
|
+
rescue Exception => e
|
125
|
+
message = "Failure in on_failure_call: #{e}"
|
126
|
+
unless e.backtrace.nil?
|
127
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
128
|
+
end
|
129
|
+
logger.warn message
|
130
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("on_failure_call failure", e.message)
|
131
|
+
ensure
|
132
|
+
@delegate_plugin.after_request
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,51 @@
|
|
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 Model
|
31
|
+
|
32
|
+
class EntitlementPluginApiException
|
33
|
+
|
34
|
+
|
35
|
+
attr_accessor
|
36
|
+
|
37
|
+
def initialize()
|
38
|
+
end
|
39
|
+
|
40
|
+
def to_java()
|
41
|
+
Java::org.killbill.billing.entitlement.plugin.api.EntitlementPluginApiException.new()
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_ruby(j_obj)
|
45
|
+
self
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|