killbill 3.2.2 → 3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -2
- data/Jarfile +7 -7
- data/README.md +16 -4
- data/VERSION +1 -1
- data/gen_config/api.conf +48 -47
- data/gen_config/plugin_api.conf +17 -16
- data/generators/active_merchant/templates/.gitignore.rb +2 -2
- data/generators/active_merchant/templates/lib/api.rb +8 -0
- data/generators/active_merchant/templates/plugin.gemspec.rb +1 -0
- data/generators/active_merchant/templates/spec/base_plugin_spec.rb +1 -0
- data/generators/active_merchant/templates/spec/integration_spec.rb +5 -1
- data/killbill.gemspec +1 -0
- data/lib/killbill/creator.rb +9 -0
- data/lib/killbill/currency.rb +6 -0
- data/lib/killbill/gen/api/account_audit_logs_for_object_type.rb +9 -7
- data/lib/killbill/gen/api/catalog_user_api.rb +37 -4
- data/lib/killbill/gen/api/payment_api.rb +104 -0
- data/lib/killbill/gen/api/payment_gateway_api.rb +6 -3
- data/lib/killbill/gen/api/plan_phase.rb +1 -8
- data/lib/killbill/gen/api/price_list_set.rb +9 -7
- data/lib/killbill/gen/api/subscription.rb +20 -1
- data/lib/killbill/gen/api/tenant_user_api.rb +3 -3
- data/lib/killbill/gen/plugin-api/currency_plugin_with_events_api.rb +207 -0
- data/lib/killbill/gen/plugin-api/ext_bus_event.rb +7 -1
- data/lib/killbill/gen/plugin-api/invoice_plugin_with_events_api.rb +103 -0
- data/lib/killbill/gen/plugin-api/payment_plugin_with_events_api.rb +782 -0
- data/lib/killbill/gen/plugin-api/require_gen.rb +3 -0
- data/lib/killbill/helpers/active_merchant/configuration.rb +116 -46
- data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +49 -32
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +18 -6
- data/lib/killbill/helpers/active_merchant/private_payment_plugin.rb +3 -3
- data/lib/killbill/helpers/active_merchant/utils.rb +37 -70
- data/lib/killbill/invoice.rb +6 -0
- data/lib/killbill/payment.rb +6 -0
- data/lib/killbill/plugin.rb +1 -1
- data/lib/killbill/rake_task.rb +1 -1
- data/spec/killbill/helpers/configuration_spec.rb +41 -5
- data/spec/killbill/helpers/payment_plugin_spec.rb +4 -1
- data/spec/killbill/helpers/private_payment_plugin_spec.rb +4 -2
- data/spec/killbill/helpers/utils_spec.rb +6 -6
- data/spec/killbill/invoice_plugin_api_spec.rb +1 -1
- data/spec/killbill/notification_plugin_api_spec.rb +1 -1
- data/spec/killbill/payment_plugin_api_spec.rb +1 -1
- metadata +19 -3
- data/lib/killbill/jnotification.rb +0 -31
@@ -0,0 +1,782 @@
|
|
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.payment.plugin.api'
|
33
|
+
class PaymentPluginWithEventsApi < JPlugin
|
34
|
+
|
35
|
+
include org.killbill.billing.payment.plugin.api.PaymentPluginWithEventsApi
|
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::org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin authorizePayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
62
|
+
def authorize_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
63
|
+
|
64
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
65
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
66
|
+
|
67
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
68
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
69
|
+
|
70
|
+
# conversion for kbTransactionId [type = java.util.UUID]
|
71
|
+
kbTransactionId = kbTransactionId.nil? ? nil : kbTransactionId.to_s
|
72
|
+
|
73
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
74
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
75
|
+
|
76
|
+
# conversion for amount [type = java.math.BigDecimal]
|
77
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
78
|
+
|
79
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
80
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
81
|
+
|
82
|
+
# conversion for properties [type = java.lang.Iterable]
|
83
|
+
tmp = []
|
84
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
85
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
86
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
87
|
+
tmp << m
|
88
|
+
end
|
89
|
+
properties = tmp
|
90
|
+
|
91
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
92
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
93
|
+
begin
|
94
|
+
res = @delegate_plugin.authorize_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
95
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
96
|
+
res = res.to_java unless res.nil?
|
97
|
+
return res
|
98
|
+
rescue Exception => e
|
99
|
+
message = "Failure in authorize_payment: #{e}"
|
100
|
+
unless e.backtrace.nil?
|
101
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
102
|
+
end
|
103
|
+
logger.warn message
|
104
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("authorize_payment failure", e.message)
|
105
|
+
ensure
|
106
|
+
@delegate_plugin.after_request
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin capturePayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
111
|
+
def capture_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
112
|
+
|
113
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
114
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
115
|
+
|
116
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
117
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
118
|
+
|
119
|
+
# conversion for kbTransactionId [type = java.util.UUID]
|
120
|
+
kbTransactionId = kbTransactionId.nil? ? nil : kbTransactionId.to_s
|
121
|
+
|
122
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
123
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
124
|
+
|
125
|
+
# conversion for amount [type = java.math.BigDecimal]
|
126
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
127
|
+
|
128
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
129
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
130
|
+
|
131
|
+
# conversion for properties [type = java.lang.Iterable]
|
132
|
+
tmp = []
|
133
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
134
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
135
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
136
|
+
tmp << m
|
137
|
+
end
|
138
|
+
properties = tmp
|
139
|
+
|
140
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
141
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
142
|
+
begin
|
143
|
+
res = @delegate_plugin.capture_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
144
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
145
|
+
res = res.to_java unless res.nil?
|
146
|
+
return res
|
147
|
+
rescue Exception => e
|
148
|
+
message = "Failure in capture_payment: #{e}"
|
149
|
+
unless e.backtrace.nil?
|
150
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
151
|
+
end
|
152
|
+
logger.warn message
|
153
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("capture_payment failure", e.message)
|
154
|
+
ensure
|
155
|
+
@delegate_plugin.after_request
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin purchasePayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
160
|
+
def purchase_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
161
|
+
|
162
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
163
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
164
|
+
|
165
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
166
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
167
|
+
|
168
|
+
# conversion for kbTransactionId [type = java.util.UUID]
|
169
|
+
kbTransactionId = kbTransactionId.nil? ? nil : kbTransactionId.to_s
|
170
|
+
|
171
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
172
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
173
|
+
|
174
|
+
# conversion for amount [type = java.math.BigDecimal]
|
175
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
176
|
+
|
177
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
178
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
179
|
+
|
180
|
+
# conversion for properties [type = java.lang.Iterable]
|
181
|
+
tmp = []
|
182
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
183
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
184
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
185
|
+
tmp << m
|
186
|
+
end
|
187
|
+
properties = tmp
|
188
|
+
|
189
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
190
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
191
|
+
begin
|
192
|
+
res = @delegate_plugin.purchase_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
193
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
194
|
+
res = res.to_java unless res.nil?
|
195
|
+
return res
|
196
|
+
rescue Exception => e
|
197
|
+
message = "Failure in purchase_payment: #{e}"
|
198
|
+
unless e.backtrace.nil?
|
199
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
200
|
+
end
|
201
|
+
logger.warn message
|
202
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("purchase_payment failure", e.message)
|
203
|
+
ensure
|
204
|
+
@delegate_plugin.after_request
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin voidPayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
209
|
+
def void_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, properties, context)
|
210
|
+
|
211
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
212
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
213
|
+
|
214
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
215
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
216
|
+
|
217
|
+
# conversion for kbTransactionId [type = java.util.UUID]
|
218
|
+
kbTransactionId = kbTransactionId.nil? ? nil : kbTransactionId.to_s
|
219
|
+
|
220
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
221
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
222
|
+
|
223
|
+
# conversion for properties [type = java.lang.Iterable]
|
224
|
+
tmp = []
|
225
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
226
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
227
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
228
|
+
tmp << m
|
229
|
+
end
|
230
|
+
properties = tmp
|
231
|
+
|
232
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
233
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
234
|
+
begin
|
235
|
+
res = @delegate_plugin.void_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, properties, context)
|
236
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
237
|
+
res = res.to_java unless res.nil?
|
238
|
+
return res
|
239
|
+
rescue Exception => e
|
240
|
+
message = "Failure in void_payment: #{e}"
|
241
|
+
unless e.backtrace.nil?
|
242
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
243
|
+
end
|
244
|
+
logger.warn message
|
245
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("void_payment failure", e.message)
|
246
|
+
ensure
|
247
|
+
@delegate_plugin.after_request
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin creditPayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
252
|
+
def credit_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
253
|
+
|
254
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
255
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
256
|
+
|
257
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
258
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
259
|
+
|
260
|
+
# conversion for kbTransactionId [type = java.util.UUID]
|
261
|
+
kbTransactionId = kbTransactionId.nil? ? nil : kbTransactionId.to_s
|
262
|
+
|
263
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
264
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
265
|
+
|
266
|
+
# conversion for amount [type = java.math.BigDecimal]
|
267
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
268
|
+
|
269
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
270
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
271
|
+
|
272
|
+
# conversion for properties [type = java.lang.Iterable]
|
273
|
+
tmp = []
|
274
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
275
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
276
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
277
|
+
tmp << m
|
278
|
+
end
|
279
|
+
properties = tmp
|
280
|
+
|
281
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
282
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
283
|
+
begin
|
284
|
+
res = @delegate_plugin.credit_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
285
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
286
|
+
res = res.to_java unless res.nil?
|
287
|
+
return res
|
288
|
+
rescue Exception => e
|
289
|
+
message = "Failure in credit_payment: #{e}"
|
290
|
+
unless e.backtrace.nil?
|
291
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
292
|
+
end
|
293
|
+
logger.warn message
|
294
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("credit_payment failure", e.message)
|
295
|
+
ensure
|
296
|
+
@delegate_plugin.after_request
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin refundPayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
301
|
+
def refund_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
302
|
+
|
303
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
304
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
305
|
+
|
306
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
307
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
308
|
+
|
309
|
+
# conversion for kbTransactionId [type = java.util.UUID]
|
310
|
+
kbTransactionId = kbTransactionId.nil? ? nil : kbTransactionId.to_s
|
311
|
+
|
312
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
313
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
314
|
+
|
315
|
+
# conversion for amount [type = java.math.BigDecimal]
|
316
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
317
|
+
|
318
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
319
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
320
|
+
|
321
|
+
# conversion for properties [type = java.lang.Iterable]
|
322
|
+
tmp = []
|
323
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
324
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
325
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
326
|
+
tmp << m
|
327
|
+
end
|
328
|
+
properties = tmp
|
329
|
+
|
330
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
331
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
332
|
+
begin
|
333
|
+
res = @delegate_plugin.refund_payment(kbAccountId, kbPaymentId, kbTransactionId, kbPaymentMethodId, amount, currency, properties, context)
|
334
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
335
|
+
res = res.to_java unless res.nil?
|
336
|
+
return res
|
337
|
+
rescue Exception => e
|
338
|
+
message = "Failure in refund_payment: #{e}"
|
339
|
+
unless e.backtrace.nil?
|
340
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
341
|
+
end
|
342
|
+
logger.warn message
|
343
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("refund_payment failure", e.message)
|
344
|
+
ensure
|
345
|
+
@delegate_plugin.after_request
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
349
|
+
java_signature 'Java::java.util.List getPaymentInfo(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
350
|
+
def get_payment_info(kbAccountId, kbPaymentId, properties, context)
|
351
|
+
|
352
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
353
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
354
|
+
|
355
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
356
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
357
|
+
|
358
|
+
# conversion for properties [type = java.lang.Iterable]
|
359
|
+
tmp = []
|
360
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
361
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
362
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
363
|
+
tmp << m
|
364
|
+
end
|
365
|
+
properties = tmp
|
366
|
+
|
367
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
368
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
369
|
+
begin
|
370
|
+
res = @delegate_plugin.get_payment_info(kbAccountId, kbPaymentId, properties, context)
|
371
|
+
# conversion for res [type = java.util.List]
|
372
|
+
tmp = java.util.ArrayList.new
|
373
|
+
(res || []).each do |m|
|
374
|
+
# conversion for m [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
|
375
|
+
m = m.to_java unless m.nil?
|
376
|
+
tmp.add(m)
|
377
|
+
end
|
378
|
+
res = tmp
|
379
|
+
return res
|
380
|
+
rescue Exception => e
|
381
|
+
message = "Failure in get_payment_info: #{e}"
|
382
|
+
unless e.backtrace.nil?
|
383
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
384
|
+
end
|
385
|
+
logger.warn message
|
386
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_payment_info failure", e.message)
|
387
|
+
ensure
|
388
|
+
@delegate_plugin.after_request
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPayments(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
393
|
+
def search_payments(searchKey, offset, limit, properties, context)
|
394
|
+
|
395
|
+
# conversion for searchKey [type = java.lang.String]
|
396
|
+
|
397
|
+
# conversion for offset [type = java.lang.Long]
|
398
|
+
|
399
|
+
# conversion for limit [type = java.lang.Long]
|
400
|
+
|
401
|
+
# conversion for properties [type = java.lang.Iterable]
|
402
|
+
tmp = []
|
403
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
404
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
405
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
406
|
+
tmp << m
|
407
|
+
end
|
408
|
+
properties = tmp
|
409
|
+
|
410
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
411
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
412
|
+
begin
|
413
|
+
res = @delegate_plugin.search_payments(searchKey, offset, limit, properties, context)
|
414
|
+
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
415
|
+
res = res.to_java unless res.nil?
|
416
|
+
return res
|
417
|
+
rescue Exception => e
|
418
|
+
message = "Failure in search_payments: #{e}"
|
419
|
+
unless e.backtrace.nil?
|
420
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
421
|
+
end
|
422
|
+
logger.warn message
|
423
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("search_payments failure", e.message)
|
424
|
+
ensure
|
425
|
+
@delegate_plugin.after_request
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
429
|
+
java_signature 'Java::void addPaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::org.killbill.billing.payment.api.PaymentMethodPlugin, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
430
|
+
def add_payment_method(kbAccountId, kbPaymentMethodId, paymentMethodProps, setDefault, properties, context)
|
431
|
+
|
432
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
433
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
434
|
+
|
435
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
436
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
437
|
+
|
438
|
+
# conversion for paymentMethodProps [type = org.killbill.billing.payment.api.PaymentMethodPlugin]
|
439
|
+
paymentMethodProps = Killbill::Plugin::Model::PaymentMethodPlugin.new.to_ruby(paymentMethodProps) unless paymentMethodProps.nil?
|
440
|
+
|
441
|
+
# conversion for setDefault [type = boolean]
|
442
|
+
if setDefault.nil?
|
443
|
+
setDefault = false
|
444
|
+
else
|
445
|
+
tmp_bool = (setDefault.java_kind_of? java.lang.Boolean) ? setDefault.boolean_value : setDefault
|
446
|
+
setDefault = tmp_bool ? true : false
|
447
|
+
end
|
448
|
+
|
449
|
+
# conversion for properties [type = java.lang.Iterable]
|
450
|
+
tmp = []
|
451
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
452
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
453
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
454
|
+
tmp << m
|
455
|
+
end
|
456
|
+
properties = tmp
|
457
|
+
|
458
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
459
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
460
|
+
begin
|
461
|
+
@delegate_plugin.add_payment_method(kbAccountId, kbPaymentMethodId, paymentMethodProps, setDefault, properties, context)
|
462
|
+
rescue Exception => e
|
463
|
+
message = "Failure in add_payment_method: #{e}"
|
464
|
+
unless e.backtrace.nil?
|
465
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
466
|
+
end
|
467
|
+
logger.warn message
|
468
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("add_payment_method failure", e.message)
|
469
|
+
ensure
|
470
|
+
@delegate_plugin.after_request
|
471
|
+
end
|
472
|
+
end
|
473
|
+
|
474
|
+
java_signature 'Java::void deletePaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
475
|
+
def delete_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
476
|
+
|
477
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
478
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
479
|
+
|
480
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
481
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
482
|
+
|
483
|
+
# conversion for properties [type = java.lang.Iterable]
|
484
|
+
tmp = []
|
485
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
486
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
487
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
488
|
+
tmp << m
|
489
|
+
end
|
490
|
+
properties = tmp
|
491
|
+
|
492
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
493
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
494
|
+
begin
|
495
|
+
@delegate_plugin.delete_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
496
|
+
rescue Exception => e
|
497
|
+
message = "Failure in delete_payment_method: #{e}"
|
498
|
+
unless e.backtrace.nil?
|
499
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
500
|
+
end
|
501
|
+
logger.warn message
|
502
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("delete_payment_method failure", e.message)
|
503
|
+
ensure
|
504
|
+
@delegate_plugin.after_request
|
505
|
+
end
|
506
|
+
end
|
507
|
+
|
508
|
+
java_signature 'Java::org.killbill.billing.payment.api.PaymentMethodPlugin getPaymentMethodDetail(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
509
|
+
def get_payment_method_detail(kbAccountId, kbPaymentMethodId, properties, context)
|
510
|
+
|
511
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
512
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
513
|
+
|
514
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
515
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
516
|
+
|
517
|
+
# conversion for properties [type = java.lang.Iterable]
|
518
|
+
tmp = []
|
519
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
520
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
521
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
522
|
+
tmp << m
|
523
|
+
end
|
524
|
+
properties = tmp
|
525
|
+
|
526
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
527
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
528
|
+
begin
|
529
|
+
res = @delegate_plugin.get_payment_method_detail(kbAccountId, kbPaymentMethodId, properties, context)
|
530
|
+
# conversion for res [type = org.killbill.billing.payment.api.PaymentMethodPlugin]
|
531
|
+
res = res.to_java unless res.nil?
|
532
|
+
return res
|
533
|
+
rescue Exception => e
|
534
|
+
message = "Failure in get_payment_method_detail: #{e}"
|
535
|
+
unless e.backtrace.nil?
|
536
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
537
|
+
end
|
538
|
+
logger.warn message
|
539
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_payment_method_detail failure", e.message)
|
540
|
+
ensure
|
541
|
+
@delegate_plugin.after_request
|
542
|
+
end
|
543
|
+
end
|
544
|
+
|
545
|
+
java_signature 'Java::void setDefaultPaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
546
|
+
def set_default_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
547
|
+
|
548
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
549
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
550
|
+
|
551
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
552
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
553
|
+
|
554
|
+
# conversion for properties [type = java.lang.Iterable]
|
555
|
+
tmp = []
|
556
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
557
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
558
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
559
|
+
tmp << m
|
560
|
+
end
|
561
|
+
properties = tmp
|
562
|
+
|
563
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
564
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
565
|
+
begin
|
566
|
+
@delegate_plugin.set_default_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
567
|
+
rescue Exception => e
|
568
|
+
message = "Failure in set_default_payment_method: #{e}"
|
569
|
+
unless e.backtrace.nil?
|
570
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
571
|
+
end
|
572
|
+
logger.warn message
|
573
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("set_default_payment_method failure", e.message)
|
574
|
+
ensure
|
575
|
+
@delegate_plugin.after_request
|
576
|
+
end
|
577
|
+
end
|
578
|
+
|
579
|
+
java_signature 'Java::java.util.List getPaymentMethods(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
580
|
+
def get_payment_methods(kbAccountId, refreshFromGateway, properties, context)
|
581
|
+
|
582
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
583
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
584
|
+
|
585
|
+
# conversion for refreshFromGateway [type = boolean]
|
586
|
+
if refreshFromGateway.nil?
|
587
|
+
refreshFromGateway = false
|
588
|
+
else
|
589
|
+
tmp_bool = (refreshFromGateway.java_kind_of? java.lang.Boolean) ? refreshFromGateway.boolean_value : refreshFromGateway
|
590
|
+
refreshFromGateway = tmp_bool ? true : false
|
591
|
+
end
|
592
|
+
|
593
|
+
# conversion for properties [type = java.lang.Iterable]
|
594
|
+
tmp = []
|
595
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
596
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
597
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
598
|
+
tmp << m
|
599
|
+
end
|
600
|
+
properties = tmp
|
601
|
+
|
602
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
603
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
604
|
+
begin
|
605
|
+
res = @delegate_plugin.get_payment_methods(kbAccountId, refreshFromGateway, properties, context)
|
606
|
+
# conversion for res [type = java.util.List]
|
607
|
+
tmp = java.util.ArrayList.new
|
608
|
+
(res || []).each do |m|
|
609
|
+
# conversion for m [type = org.killbill.billing.payment.plugin.api.PaymentMethodInfoPlugin]
|
610
|
+
m = m.to_java unless m.nil?
|
611
|
+
tmp.add(m)
|
612
|
+
end
|
613
|
+
res = tmp
|
614
|
+
return res
|
615
|
+
rescue Exception => e
|
616
|
+
message = "Failure in get_payment_methods: #{e}"
|
617
|
+
unless e.backtrace.nil?
|
618
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
619
|
+
end
|
620
|
+
logger.warn message
|
621
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_payment_methods failure", e.message)
|
622
|
+
ensure
|
623
|
+
@delegate_plugin.after_request
|
624
|
+
end
|
625
|
+
end
|
626
|
+
|
627
|
+
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPaymentMethods(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
628
|
+
def search_payment_methods(searchKey, offset, limit, properties, context)
|
629
|
+
|
630
|
+
# conversion for searchKey [type = java.lang.String]
|
631
|
+
|
632
|
+
# conversion for offset [type = java.lang.Long]
|
633
|
+
|
634
|
+
# conversion for limit [type = java.lang.Long]
|
635
|
+
|
636
|
+
# conversion for properties [type = java.lang.Iterable]
|
637
|
+
tmp = []
|
638
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
639
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
640
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
641
|
+
tmp << m
|
642
|
+
end
|
643
|
+
properties = tmp
|
644
|
+
|
645
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
646
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
647
|
+
begin
|
648
|
+
res = @delegate_plugin.search_payment_methods(searchKey, offset, limit, properties, context)
|
649
|
+
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
650
|
+
res = res.to_java unless res.nil?
|
651
|
+
return res
|
652
|
+
rescue Exception => e
|
653
|
+
message = "Failure in search_payment_methods: #{e}"
|
654
|
+
unless e.backtrace.nil?
|
655
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
656
|
+
end
|
657
|
+
logger.warn message
|
658
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("search_payment_methods failure", e.message)
|
659
|
+
ensure
|
660
|
+
@delegate_plugin.after_request
|
661
|
+
end
|
662
|
+
end
|
663
|
+
|
664
|
+
java_signature 'Java::void resetPaymentMethods(Java::java.util.UUID, Java::java.util.List, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
665
|
+
def reset_payment_methods(kbAccountId, paymentMethods, properties, context)
|
666
|
+
|
667
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
668
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
669
|
+
|
670
|
+
# conversion for paymentMethods [type = java.util.List]
|
671
|
+
tmp = []
|
672
|
+
(paymentMethods || []).each do |m|
|
673
|
+
# conversion for m [type = org.killbill.billing.payment.plugin.api.PaymentMethodInfoPlugin]
|
674
|
+
m = Killbill::Plugin::Model::PaymentMethodInfoPlugin.new.to_ruby(m) unless m.nil?
|
675
|
+
tmp << m
|
676
|
+
end
|
677
|
+
paymentMethods = tmp
|
678
|
+
|
679
|
+
# conversion for properties [type = java.lang.Iterable]
|
680
|
+
tmp = []
|
681
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
682
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
683
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
684
|
+
tmp << m
|
685
|
+
end
|
686
|
+
properties = tmp
|
687
|
+
|
688
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
689
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
690
|
+
begin
|
691
|
+
@delegate_plugin.reset_payment_methods(kbAccountId, paymentMethods, properties, context)
|
692
|
+
rescue Exception => e
|
693
|
+
message = "Failure in reset_payment_methods: #{e}"
|
694
|
+
unless e.backtrace.nil?
|
695
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
696
|
+
end
|
697
|
+
logger.warn message
|
698
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("reset_payment_methods failure", e.message)
|
699
|
+
ensure
|
700
|
+
@delegate_plugin.after_request
|
701
|
+
end
|
702
|
+
end
|
703
|
+
|
704
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor buildFormDescriptor(Java::java.util.UUID, Java::java.lang.Iterable, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
705
|
+
def build_form_descriptor(kbAccountId, customFields, properties, context)
|
706
|
+
|
707
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
708
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
709
|
+
|
710
|
+
# conversion for customFields [type = java.lang.Iterable]
|
711
|
+
tmp = []
|
712
|
+
(customFields.nil? ? [] : customFields.iterator).each do |m|
|
713
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
714
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
715
|
+
tmp << m
|
716
|
+
end
|
717
|
+
customFields = tmp
|
718
|
+
|
719
|
+
# conversion for properties [type = java.lang.Iterable]
|
720
|
+
tmp = []
|
721
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
722
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
723
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
724
|
+
tmp << m
|
725
|
+
end
|
726
|
+
properties = tmp
|
727
|
+
|
728
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
729
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
730
|
+
begin
|
731
|
+
res = @delegate_plugin.build_form_descriptor(kbAccountId, customFields, properties, context)
|
732
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor]
|
733
|
+
res = res.to_java unless res.nil?
|
734
|
+
return res
|
735
|
+
rescue Exception => e
|
736
|
+
message = "Failure in build_form_descriptor: #{e}"
|
737
|
+
unless e.backtrace.nil?
|
738
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
739
|
+
end
|
740
|
+
logger.warn message
|
741
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("build_form_descriptor failure", e.message)
|
742
|
+
ensure
|
743
|
+
@delegate_plugin.after_request
|
744
|
+
end
|
745
|
+
end
|
746
|
+
|
747
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.GatewayNotification processNotification(Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
748
|
+
def process_notification(notification, properties, context)
|
749
|
+
|
750
|
+
# conversion for notification [type = java.lang.String]
|
751
|
+
|
752
|
+
# conversion for properties [type = java.lang.Iterable]
|
753
|
+
tmp = []
|
754
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
755
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
756
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
757
|
+
tmp << m
|
758
|
+
end
|
759
|
+
properties = tmp
|
760
|
+
|
761
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
762
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
763
|
+
begin
|
764
|
+
res = @delegate_plugin.process_notification(notification, properties, context)
|
765
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.GatewayNotification]
|
766
|
+
res = res.to_java unless res.nil?
|
767
|
+
return res
|
768
|
+
rescue Exception => e
|
769
|
+
message = "Failure in process_notification: #{e}"
|
770
|
+
unless e.backtrace.nil?
|
771
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
772
|
+
end
|
773
|
+
logger.warn message
|
774
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("process_notification failure", e.message)
|
775
|
+
ensure
|
776
|
+
@delegate_plugin.after_request
|
777
|
+
end
|
778
|
+
end
|
779
|
+
end
|
780
|
+
end
|
781
|
+
end
|
782
|
+
end
|