killbill 3.0.0 → 3.1.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/.gitignore +1 -0
- data/Jarfile +5 -5
- data/NEWS +4 -0
- data/README.md +45 -8
- data/VERSION +1 -1
- data/generators/active_merchant/active_merchant_generator.rb +38 -0
- data/generators/active_merchant/templates/.gitignore.rb +36 -0
- data/generators/active_merchant/templates/.travis.yml.rb +19 -0
- data/generators/active_merchant/templates/Gemfile.rb +3 -0
- data/generators/active_merchant/templates/Jarfile.rb +6 -0
- data/generators/active_merchant/templates/LICENSE.rb +201 -0
- data/generators/active_merchant/templates/NEWS.rb +2 -0
- data/generators/active_merchant/templates/Rakefile.rb +30 -0
- data/generators/active_merchant/templates/VERSION.rb +1 -0
- data/generators/active_merchant/templates/config.ru.rb +4 -0
- data/generators/active_merchant/templates/config.yml.rb +13 -0
- data/generators/active_merchant/templates/db/ddl.sql.rb +64 -0
- data/generators/active_merchant/templates/db/schema.rb +64 -0
- data/generators/active_merchant/templates/killbill.properties.rb +3 -0
- data/generators/active_merchant/templates/lib/api.rb +119 -0
- data/generators/active_merchant/templates/lib/application.rb +84 -0
- data/generators/active_merchant/templates/lib/models/payment_method.rb +22 -0
- data/generators/active_merchant/templates/lib/models/response.rb +22 -0
- data/generators/active_merchant/templates/lib/models/transaction.rb +11 -0
- data/generators/active_merchant/templates/lib/plugin.rb +23 -0
- data/generators/active_merchant/templates/lib/private_api.rb +6 -0
- data/generators/active_merchant/templates/lib/views/form.erb +8 -0
- data/generators/active_merchant/templates/plugin.gemspec.rb +48 -0
- data/generators/active_merchant/templates/pom.xml.rb +44 -0
- data/generators/active_merchant/templates/release.sh.rb +41 -0
- data/generators/active_merchant/templates/spec/base_plugin_spec.rb +30 -0
- data/generators/active_merchant/templates/spec/integration_spec.rb +31 -0
- data/generators/active_merchant/templates/spec/spec_helper.rb +24 -0
- data/generators/killbill_generator.rb +38 -0
- data/killbill.gemspec +10 -2
- data/lib/killbill/gen/api/block.rb +82 -0
- data/lib/killbill/gen/api/direct_payment.rb +176 -0
- data/lib/killbill/gen/api/direct_payment_api.rb +329 -0
- data/lib/killbill/gen/api/direct_payment_transaction.rb +156 -0
- data/lib/killbill/gen/api/fixed.rb +63 -0
- data/lib/killbill/gen/api/invoice_item.rb +7 -1
- data/lib/killbill/gen/api/invoice_item_formatter.rb +7 -1
- data/lib/killbill/gen/api/invoice_user_api.rb +18 -136
- data/lib/killbill/gen/api/migration_plan.rb +6 -6
- data/lib/killbill/gen/api/payment_api.rb +216 -54
- data/lib/killbill/gen/api/payment_method_plugin.rb +3 -3
- data/lib/killbill/gen/api/plan.rb +6 -6
- data/lib/killbill/gen/api/plan_phase.rb +16 -23
- data/lib/killbill/gen/api/plugin_property.rb +71 -0
- data/lib/killbill/gen/api/recurring.rb +63 -0
- data/lib/killbill/gen/api/require_gen.rb +10 -1
- data/lib/killbill/gen/api/static_catalog.rb +8 -1
- data/lib/killbill/gen/api/tier.rb +77 -0
- data/lib/killbill/gen/api/tiered_block.rb +88 -0
- data/lib/killbill/gen/api/usage.rb +111 -0
- data/lib/killbill/gen/api/usage_user_api.rb +59 -3
- data/lib/killbill/gen/plugin-api/billing_address.rb +85 -0
- data/lib/killbill/gen/plugin-api/customer.rb +73 -0
- data/lib/killbill/gen/plugin-api/hosted_payment_page_descriptor_fields.rb +145 -0
- data/lib/killbill/gen/plugin-api/hosted_payment_page_form_descriptor.rb +80 -0
- data/lib/killbill/gen/plugin-api/hosted_payment_page_notification.rb +129 -0
- data/lib/killbill/gen/plugin-api/payment_info_plugin.rb +20 -1
- data/lib/killbill/gen/plugin-api/payment_plugin_api.rb +358 -39
- data/lib/killbill/gen/plugin-api/refund_info_plugin.rb +20 -1
- data/lib/killbill/gen/plugin-api/require_gen.rb +3 -0
- data/lib/killbill/helpers/active_merchant.rb +21 -0
- data/lib/killbill/helpers/active_merchant/active_record.rb +17 -0
- data/lib/killbill/helpers/active_merchant/active_record/models/helpers.rb +25 -0
- data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +195 -0
- data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +178 -0
- data/lib/killbill/helpers/active_merchant/active_record/models/streamy_result_set.rb +35 -0
- data/lib/killbill/helpers/active_merchant/active_record/models/transaction.rb +63 -0
- data/lib/killbill/helpers/active_merchant/configuration.rb +54 -0
- data/lib/killbill/helpers/active_merchant/core_ext.rb +41 -0
- data/lib/killbill/helpers/active_merchant/gateway.rb +35 -0
- data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +117 -0
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +365 -0
- data/lib/killbill/helpers/active_merchant/private_payment_plugin.rb +119 -0
- data/lib/killbill/helpers/active_merchant/properties.rb +20 -0
- data/lib/killbill/helpers/active_merchant/sinatra.rb +30 -0
- data/lib/killbill/helpers/active_merchant/utils.rb +23 -0
- data/lib/killbill/payment.rb +22 -10
- data/script/generate +15 -0
- data/spec/killbill/helpers/payment_method_spec.rb +101 -0
- data/spec/killbill/helpers/response_spec.rb +74 -0
- data/spec/killbill/helpers/test_schema.rb +57 -0
- data/spec/killbill/helpers/utils_spec.rb +22 -0
- data/spec/killbill/payment_plugin_api_spec.rb +23 -18
- data/spec/killbill/payment_plugin_spec.rb +11 -10
- data/spec/killbill/payment_test.rb +9 -9
- data/spec/spec_helper.rb +8 -3
- metadata +130 -5
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
###################################################################################
|
|
2
|
+
# #
|
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
|
4
|
+
# #
|
|
5
|
+
# Ning licenses this file to you under the Apache License, version 2.0 #
|
|
6
|
+
# (the "License"); you may not use this file except in compliance with the #
|
|
7
|
+
# License. You may obtain a copy of the License at: #
|
|
8
|
+
# #
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
10
|
+
# #
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
|
13
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
|
14
|
+
# License for the specific language governing permissions and limitations #
|
|
15
|
+
# under the License. #
|
|
16
|
+
# #
|
|
17
|
+
###################################################################################
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
#
|
|
21
|
+
# DO NOT EDIT!!!
|
|
22
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
|
23
|
+
#
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
module Killbill
|
|
27
|
+
module Plugin
|
|
28
|
+
module Model
|
|
29
|
+
|
|
30
|
+
java_package 'org.killbill.billing.payment.plugin.api'
|
|
31
|
+
class HostedPaymentPageFormDescriptor
|
|
32
|
+
|
|
33
|
+
include org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor
|
|
34
|
+
|
|
35
|
+
attr_accessor :form_method, :form_url, :form_fields
|
|
36
|
+
|
|
37
|
+
def initialize()
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def to_java()
|
|
41
|
+
# conversion for form_method [type = java.lang.String]
|
|
42
|
+
@form_method = @form_method.to_s unless @form_method.nil?
|
|
43
|
+
|
|
44
|
+
# conversion for form_url [type = java.lang.String]
|
|
45
|
+
@form_url = @form_url.to_s unless @form_url.nil?
|
|
46
|
+
|
|
47
|
+
# conversion for form_fields [type = java.util.List]
|
|
48
|
+
tmp = java.util.ArrayList.new
|
|
49
|
+
(@form_fields || []).each do |m|
|
|
50
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
51
|
+
m = m.to_java unless m.nil?
|
|
52
|
+
tmp.add(m)
|
|
53
|
+
end
|
|
54
|
+
@form_fields = tmp
|
|
55
|
+
self
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def to_ruby(j_obj)
|
|
59
|
+
# conversion for form_method [type = java.lang.String]
|
|
60
|
+
@form_method = j_obj.form_method
|
|
61
|
+
|
|
62
|
+
# conversion for form_url [type = java.lang.String]
|
|
63
|
+
@form_url = j_obj.form_url
|
|
64
|
+
|
|
65
|
+
# conversion for form_fields [type = java.util.List]
|
|
66
|
+
@form_fields = j_obj.form_fields
|
|
67
|
+
tmp = []
|
|
68
|
+
(@form_fields || []).each do |m|
|
|
69
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
70
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
71
|
+
tmp << m
|
|
72
|
+
end
|
|
73
|
+
@form_fields = tmp
|
|
74
|
+
self
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
###################################################################################
|
|
2
|
+
# #
|
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
|
4
|
+
# #
|
|
5
|
+
# Ning licenses this file to you under the Apache License, version 2.0 #
|
|
6
|
+
# (the "License"); you may not use this file except in compliance with the #
|
|
7
|
+
# License. You may obtain a copy of the License at: #
|
|
8
|
+
# #
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
10
|
+
# #
|
|
11
|
+
# Unless required by applicable law or agreed to in writing, software #
|
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
|
13
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
|
14
|
+
# License for the specific language governing permissions and limitations #
|
|
15
|
+
# under the License. #
|
|
16
|
+
# #
|
|
17
|
+
###################################################################################
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
#
|
|
21
|
+
# DO NOT EDIT!!!
|
|
22
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
|
23
|
+
#
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
module Killbill
|
|
27
|
+
module Plugin
|
|
28
|
+
module Model
|
|
29
|
+
|
|
30
|
+
java_package 'org.killbill.billing.payment.plugin.api'
|
|
31
|
+
class HostedPaymentPageNotification
|
|
32
|
+
|
|
33
|
+
include org.killbill.billing.payment.plugin.api.HostedPaymentPageNotification
|
|
34
|
+
|
|
35
|
+
attr_accessor :kb_payment_id, :is_complete, :item_id, :transaction_id, :received_at, :payer_email, :receiver_email, :security_key, :gross_amount, :status
|
|
36
|
+
|
|
37
|
+
def initialize()
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def to_java()
|
|
41
|
+
# conversion for kb_payment_id [type = java.util.UUID]
|
|
42
|
+
@kb_payment_id = java.util.UUID.fromString(@kb_payment_id.to_s) unless @kb_payment_id.nil?
|
|
43
|
+
|
|
44
|
+
# conversion for is_complete [type = boolean]
|
|
45
|
+
@is_complete = @is_complete.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_complete)
|
|
46
|
+
|
|
47
|
+
# conversion for item_id [type = java.lang.String]
|
|
48
|
+
@item_id = @item_id.to_s unless @item_id.nil?
|
|
49
|
+
|
|
50
|
+
# conversion for transaction_id [type = java.lang.String]
|
|
51
|
+
@transaction_id = @transaction_id.to_s unless @transaction_id.nil?
|
|
52
|
+
|
|
53
|
+
# conversion for received_at [type = org.joda.time.DateTime]
|
|
54
|
+
if !@received_at.nil?
|
|
55
|
+
@received_at = (@received_at.kind_of? Time) ? DateTime.parse(@received_at.to_s) : @received_at
|
|
56
|
+
@received_at = Java::org.joda.time.DateTime.new(@received_at.to_s, Java::org.joda.time.DateTimeZone::UTC)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# conversion for payer_email [type = java.lang.String]
|
|
60
|
+
@payer_email = @payer_email.to_s unless @payer_email.nil?
|
|
61
|
+
|
|
62
|
+
# conversion for receiver_email [type = java.lang.String]
|
|
63
|
+
@receiver_email = @receiver_email.to_s unless @receiver_email.nil?
|
|
64
|
+
|
|
65
|
+
# conversion for security_key [type = java.lang.String]
|
|
66
|
+
@security_key = @security_key.to_s unless @security_key.nil?
|
|
67
|
+
|
|
68
|
+
# conversion for gross_amount [type = java.math.BigDecimal]
|
|
69
|
+
if @gross_amount.nil?
|
|
70
|
+
@gross_amount = java.math.BigDecimal::ZERO
|
|
71
|
+
else
|
|
72
|
+
@gross_amount = java.math.BigDecimal.new(@gross_amount.to_s)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# conversion for status [type = java.lang.String]
|
|
76
|
+
@status = @status.to_s unless @status.nil?
|
|
77
|
+
self
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def to_ruby(j_obj)
|
|
81
|
+
# conversion for kb_payment_id [type = java.util.UUID]
|
|
82
|
+
@kb_payment_id = j_obj.kb_payment_id
|
|
83
|
+
@kb_payment_id = @kb_payment_id.nil? ? nil : @kb_payment_id.to_s
|
|
84
|
+
|
|
85
|
+
# conversion for is_complete [type = boolean]
|
|
86
|
+
@is_complete = j_obj.is_complete
|
|
87
|
+
if @is_complete.nil?
|
|
88
|
+
@is_complete = false
|
|
89
|
+
else
|
|
90
|
+
tmp_bool = (@is_complete.java_kind_of? java.lang.Boolean) ? @is_complete.boolean_value : @is_complete
|
|
91
|
+
@is_complete = tmp_bool ? true : false
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# conversion for item_id [type = java.lang.String]
|
|
95
|
+
@item_id = j_obj.item_id
|
|
96
|
+
|
|
97
|
+
# conversion for transaction_id [type = java.lang.String]
|
|
98
|
+
@transaction_id = j_obj.transaction_id
|
|
99
|
+
|
|
100
|
+
# conversion for received_at [type = org.joda.time.DateTime]
|
|
101
|
+
@received_at = j_obj.received_at
|
|
102
|
+
if !@received_at.nil?
|
|
103
|
+
fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
|
|
104
|
+
str = fmt.print(@received_at)
|
|
105
|
+
@received_at = DateTime.iso8601(str)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# conversion for payer_email [type = java.lang.String]
|
|
109
|
+
@payer_email = j_obj.payer_email
|
|
110
|
+
|
|
111
|
+
# conversion for receiver_email [type = java.lang.String]
|
|
112
|
+
@receiver_email = j_obj.receiver_email
|
|
113
|
+
|
|
114
|
+
# conversion for security_key [type = java.lang.String]
|
|
115
|
+
@security_key = j_obj.security_key
|
|
116
|
+
|
|
117
|
+
# conversion for gross_amount [type = java.math.BigDecimal]
|
|
118
|
+
@gross_amount = j_obj.gross_amount
|
|
119
|
+
@gross_amount = @gross_amount.nil? ? 0 : BigDecimal.new(@gross_amount.to_s)
|
|
120
|
+
|
|
121
|
+
# conversion for status [type = java.lang.String]
|
|
122
|
+
@status = j_obj.status
|
|
123
|
+
self
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -32,7 +32,7 @@ module Killbill
|
|
|
32
32
|
|
|
33
33
|
include org.killbill.billing.payment.plugin.api.PaymentInfoPlugin
|
|
34
34
|
|
|
35
|
-
attr_accessor :kb_payment_id, :amount, :currency, :created_date, :effective_date, :status, :gateway_error, :gateway_error_code, :first_payment_reference_id, :second_payment_reference_id
|
|
35
|
+
attr_accessor :kb_payment_id, :amount, :currency, :created_date, :effective_date, :status, :gateway_error, :gateway_error_code, :first_payment_reference_id, :second_payment_reference_id, :properties
|
|
36
36
|
|
|
37
37
|
def initialize()
|
|
38
38
|
end
|
|
@@ -77,6 +77,15 @@ module Killbill
|
|
|
77
77
|
|
|
78
78
|
# conversion for second_payment_reference_id [type = java.lang.String]
|
|
79
79
|
@second_payment_reference_id = @second_payment_reference_id.to_s unless @second_payment_reference_id.nil?
|
|
80
|
+
|
|
81
|
+
# conversion for properties [type = java.util.List]
|
|
82
|
+
tmp = java.util.ArrayList.new
|
|
83
|
+
(@properties || []).each do |m|
|
|
84
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
85
|
+
m = m.to_java unless m.nil?
|
|
86
|
+
tmp.add(m)
|
|
87
|
+
end
|
|
88
|
+
@properties = tmp
|
|
80
89
|
self
|
|
81
90
|
end
|
|
82
91
|
|
|
@@ -124,6 +133,16 @@ module Killbill
|
|
|
124
133
|
|
|
125
134
|
# conversion for second_payment_reference_id [type = java.lang.String]
|
|
126
135
|
@second_payment_reference_id = j_obj.second_payment_reference_id
|
|
136
|
+
|
|
137
|
+
# conversion for properties [type = java.util.List]
|
|
138
|
+
@properties = j_obj.properties
|
|
139
|
+
tmp = []
|
|
140
|
+
(@properties || []).each do |m|
|
|
141
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
142
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
143
|
+
tmp << m
|
|
144
|
+
end
|
|
145
|
+
@properties = tmp
|
|
127
146
|
self
|
|
128
147
|
end
|
|
129
148
|
|
|
@@ -37,8 +37,8 @@ module Killbill
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin
|
|
41
|
-
def
|
|
40
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin authorizePayment(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)'
|
|
41
|
+
def authorize_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, properties, context)
|
|
42
42
|
|
|
43
43
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
44
44
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -55,10 +55,111 @@ module Killbill
|
|
|
55
55
|
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
56
56
|
currency = currency.to_s.to_sym unless currency.nil?
|
|
57
57
|
|
|
58
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
59
|
+
tmp = []
|
|
60
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
61
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
62
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
63
|
+
tmp << m
|
|
64
|
+
end
|
|
65
|
+
properties = tmp
|
|
66
|
+
|
|
67
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
68
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
69
|
+
begin
|
|
70
|
+
res = @delegate_plugin.authorize_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, properties, context)
|
|
71
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
|
|
72
|
+
res = res.to_java unless res.nil?
|
|
73
|
+
return res
|
|
74
|
+
rescue Exception => e
|
|
75
|
+
message = "Failure in authorize_payment: #{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("authorize_payment failure", e.message)
|
|
81
|
+
ensure
|
|
82
|
+
@delegate_plugin.after_request
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin capturePayment(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)'
|
|
87
|
+
def capture_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, properties, context)
|
|
88
|
+
|
|
89
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
|
90
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
91
|
+
|
|
92
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
|
93
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
|
94
|
+
|
|
95
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
|
96
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
|
97
|
+
|
|
98
|
+
# conversion for amount [type = java.math.BigDecimal]
|
|
99
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
|
100
|
+
|
|
101
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
102
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
|
103
|
+
|
|
104
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
105
|
+
tmp = []
|
|
106
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
107
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
108
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
109
|
+
tmp << m
|
|
110
|
+
end
|
|
111
|
+
properties = tmp
|
|
112
|
+
|
|
113
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
114
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
115
|
+
begin
|
|
116
|
+
res = @delegate_plugin.capture_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, properties, context)
|
|
117
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
|
|
118
|
+
res = res.to_java unless res.nil?
|
|
119
|
+
return res
|
|
120
|
+
rescue Exception => e
|
|
121
|
+
message = "Failure in capture_payment: #{e}"
|
|
122
|
+
unless e.backtrace.nil?
|
|
123
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
|
124
|
+
end
|
|
125
|
+
logger.warn message
|
|
126
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("capture_payment failure", e.message)
|
|
127
|
+
ensure
|
|
128
|
+
@delegate_plugin.after_request
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin processPayment(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)'
|
|
133
|
+
def process_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, properties, context)
|
|
134
|
+
|
|
135
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
|
136
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
137
|
+
|
|
138
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
|
139
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
|
140
|
+
|
|
141
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
|
142
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
|
143
|
+
|
|
144
|
+
# conversion for amount [type = java.math.BigDecimal]
|
|
145
|
+
amount = amount.nil? ? 0 : BigDecimal.new(amount.to_s)
|
|
146
|
+
|
|
147
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
148
|
+
currency = currency.to_s.to_sym unless currency.nil?
|
|
149
|
+
|
|
150
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
151
|
+
tmp = []
|
|
152
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
153
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
154
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
155
|
+
tmp << m
|
|
156
|
+
end
|
|
157
|
+
properties = tmp
|
|
158
|
+
|
|
58
159
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
59
160
|
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
60
161
|
begin
|
|
61
|
-
res = @delegate_plugin.process_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, context)
|
|
162
|
+
res = @delegate_plugin.process_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, amount, currency, properties, context)
|
|
62
163
|
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
|
|
63
164
|
res = res.to_java unless res.nil?
|
|
64
165
|
return res
|
|
@@ -74,8 +175,8 @@ module Killbill
|
|
|
74
175
|
end
|
|
75
176
|
end
|
|
76
177
|
|
|
77
|
-
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin
|
|
78
|
-
def
|
|
178
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin voidPayment(Java::java.util.UUID, Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
179
|
+
def void_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, properties, context)
|
|
79
180
|
|
|
80
181
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
81
182
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -83,10 +184,59 @@ module Killbill
|
|
|
83
184
|
# conversion for kbPaymentId [type = java.util.UUID]
|
|
84
185
|
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
|
85
186
|
|
|
187
|
+
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
|
188
|
+
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
|
189
|
+
|
|
190
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
191
|
+
tmp = []
|
|
192
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
193
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
194
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
195
|
+
tmp << m
|
|
196
|
+
end
|
|
197
|
+
properties = tmp
|
|
198
|
+
|
|
199
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
200
|
+
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
201
|
+
begin
|
|
202
|
+
res = @delegate_plugin.void_payment(kbAccountId, kbPaymentId, kbPaymentMethodId, properties, context)
|
|
203
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
|
|
204
|
+
res = res.to_java unless res.nil?
|
|
205
|
+
return res
|
|
206
|
+
rescue Exception => e
|
|
207
|
+
message = "Failure in void_payment: #{e}"
|
|
208
|
+
unless e.backtrace.nil?
|
|
209
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
|
210
|
+
end
|
|
211
|
+
logger.warn message
|
|
212
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("void_payment failure", e.message)
|
|
213
|
+
ensure
|
|
214
|
+
@delegate_plugin.after_request
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.PaymentInfoPlugin getPaymentInfo(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
219
|
+
def get_payment_info(kbAccountId, kbPaymentId, properties, context)
|
|
220
|
+
|
|
221
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
|
222
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
223
|
+
|
|
224
|
+
# conversion for kbPaymentId [type = java.util.UUID]
|
|
225
|
+
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
|
226
|
+
|
|
227
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
228
|
+
tmp = []
|
|
229
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
230
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
231
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
232
|
+
tmp << m
|
|
233
|
+
end
|
|
234
|
+
properties = tmp
|
|
235
|
+
|
|
86
236
|
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
87
237
|
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
88
238
|
begin
|
|
89
|
-
res = @delegate_plugin.get_payment_info(kbAccountId, kbPaymentId, context)
|
|
239
|
+
res = @delegate_plugin.get_payment_info(kbAccountId, kbPaymentId, properties, context)
|
|
90
240
|
# conversion for res [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
|
|
91
241
|
res = res.to_java unless res.nil?
|
|
92
242
|
return res
|
|
@@ -102,8 +252,8 @@ module Killbill
|
|
|
102
252
|
end
|
|
103
253
|
end
|
|
104
254
|
|
|
105
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPayments(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
106
|
-
def search_payments(searchKey, offset, limit, context)
|
|
255
|
+
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)'
|
|
256
|
+
def search_payments(searchKey, offset, limit, properties, context)
|
|
107
257
|
|
|
108
258
|
# conversion for searchKey [type = java.lang.String]
|
|
109
259
|
|
|
@@ -111,10 +261,19 @@ module Killbill
|
|
|
111
261
|
|
|
112
262
|
# conversion for limit [type = java.lang.Long]
|
|
113
263
|
|
|
264
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
265
|
+
tmp = []
|
|
266
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
267
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
268
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
269
|
+
tmp << m
|
|
270
|
+
end
|
|
271
|
+
properties = tmp
|
|
272
|
+
|
|
114
273
|
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
115
274
|
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
116
275
|
begin
|
|
117
|
-
res = @delegate_plugin.search_payments(searchKey, offset, limit, context)
|
|
276
|
+
res = @delegate_plugin.search_payments(searchKey, offset, limit, properties, context)
|
|
118
277
|
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
119
278
|
res = res.to_java unless res.nil?
|
|
120
279
|
return res
|
|
@@ -130,8 +289,8 @@ module Killbill
|
|
|
130
289
|
end
|
|
131
290
|
end
|
|
132
291
|
|
|
133
|
-
java_signature 'Java::org.killbill.billing.payment.plugin.api.RefundInfoPlugin processRefund(Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
134
|
-
def process_refund(kbAccountId, kbPaymentId, refundAmount, currency, context)
|
|
292
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.RefundInfoPlugin processRefund(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)'
|
|
293
|
+
def process_refund(kbAccountId, kbPaymentId, refundAmount, currency, properties, context)
|
|
135
294
|
|
|
136
295
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
137
296
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -145,10 +304,19 @@ module Killbill
|
|
|
145
304
|
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
146
305
|
currency = currency.to_s.to_sym unless currency.nil?
|
|
147
306
|
|
|
307
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
308
|
+
tmp = []
|
|
309
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
310
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
311
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
312
|
+
tmp << m
|
|
313
|
+
end
|
|
314
|
+
properties = tmp
|
|
315
|
+
|
|
148
316
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
149
317
|
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
150
318
|
begin
|
|
151
|
-
res = @delegate_plugin.process_refund(kbAccountId, kbPaymentId, refundAmount, currency, context)
|
|
319
|
+
res = @delegate_plugin.process_refund(kbAccountId, kbPaymentId, refundAmount, currency, properties, context)
|
|
152
320
|
# conversion for res [type = org.killbill.billing.payment.plugin.api.RefundInfoPlugin]
|
|
153
321
|
res = res.to_java unless res.nil?
|
|
154
322
|
return res
|
|
@@ -164,8 +332,8 @@ module Killbill
|
|
|
164
332
|
end
|
|
165
333
|
end
|
|
166
334
|
|
|
167
|
-
java_signature 'Java::java.util.List getRefundInfo(Java::java.util.UUID, Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
168
|
-
def get_refund_info(kbAccountId, kbPaymentId, context)
|
|
335
|
+
java_signature 'Java::java.util.List getRefundInfo(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
336
|
+
def get_refund_info(kbAccountId, kbPaymentId, properties, context)
|
|
169
337
|
|
|
170
338
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
171
339
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -173,10 +341,19 @@ module Killbill
|
|
|
173
341
|
# conversion for kbPaymentId [type = java.util.UUID]
|
|
174
342
|
kbPaymentId = kbPaymentId.nil? ? nil : kbPaymentId.to_s
|
|
175
343
|
|
|
344
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
345
|
+
tmp = []
|
|
346
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
347
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
348
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
349
|
+
tmp << m
|
|
350
|
+
end
|
|
351
|
+
properties = tmp
|
|
352
|
+
|
|
176
353
|
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
177
354
|
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
178
355
|
begin
|
|
179
|
-
res = @delegate_plugin.get_refund_info(kbAccountId, kbPaymentId, context)
|
|
356
|
+
res = @delegate_plugin.get_refund_info(kbAccountId, kbPaymentId, properties, context)
|
|
180
357
|
# conversion for res [type = java.util.List]
|
|
181
358
|
tmp = java.util.ArrayList.new
|
|
182
359
|
(res || []).each do |m|
|
|
@@ -198,8 +375,8 @@ module Killbill
|
|
|
198
375
|
end
|
|
199
376
|
end
|
|
200
377
|
|
|
201
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchRefunds(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
202
|
-
def search_refunds(searchKey, offset, limit, context)
|
|
378
|
+
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchRefunds(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
379
|
+
def search_refunds(searchKey, offset, limit, properties, context)
|
|
203
380
|
|
|
204
381
|
# conversion for searchKey [type = java.lang.String]
|
|
205
382
|
|
|
@@ -207,10 +384,19 @@ module Killbill
|
|
|
207
384
|
|
|
208
385
|
# conversion for limit [type = java.lang.Long]
|
|
209
386
|
|
|
387
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
388
|
+
tmp = []
|
|
389
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
390
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
391
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
392
|
+
tmp << m
|
|
393
|
+
end
|
|
394
|
+
properties = tmp
|
|
395
|
+
|
|
210
396
|
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
211
397
|
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
212
398
|
begin
|
|
213
|
-
res = @delegate_plugin.search_refunds(searchKey, offset, limit, context)
|
|
399
|
+
res = @delegate_plugin.search_refunds(searchKey, offset, limit, properties, context)
|
|
214
400
|
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
215
401
|
res = res.to_java unless res.nil?
|
|
216
402
|
return res
|
|
@@ -226,8 +412,8 @@ module Killbill
|
|
|
226
412
|
end
|
|
227
413
|
end
|
|
228
414
|
|
|
229
|
-
java_signature 'Java::void addPaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::org.killbill.billing.payment.api.PaymentMethodPlugin, Java::boolean, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
230
|
-
def add_payment_method(kbAccountId, kbPaymentMethodId, paymentMethodProps, setDefault, context)
|
|
415
|
+
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)'
|
|
416
|
+
def add_payment_method(kbAccountId, kbPaymentMethodId, paymentMethodProps, setDefault, properties, context)
|
|
231
417
|
|
|
232
418
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
233
419
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -246,10 +432,19 @@ module Killbill
|
|
|
246
432
|
setDefault = tmp_bool ? true : false
|
|
247
433
|
end
|
|
248
434
|
|
|
435
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
436
|
+
tmp = []
|
|
437
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
438
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
439
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
440
|
+
tmp << m
|
|
441
|
+
end
|
|
442
|
+
properties = tmp
|
|
443
|
+
|
|
249
444
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
250
445
|
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
251
446
|
begin
|
|
252
|
-
@delegate_plugin.add_payment_method(kbAccountId, kbPaymentMethodId, paymentMethodProps, setDefault, context)
|
|
447
|
+
@delegate_plugin.add_payment_method(kbAccountId, kbPaymentMethodId, paymentMethodProps, setDefault, properties, context)
|
|
253
448
|
rescue Exception => e
|
|
254
449
|
message = "Failure in add_payment_method: #{e}"
|
|
255
450
|
unless e.backtrace.nil?
|
|
@@ -262,8 +457,8 @@ module Killbill
|
|
|
262
457
|
end
|
|
263
458
|
end
|
|
264
459
|
|
|
265
|
-
java_signature 'Java::void deletePaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
266
|
-
def delete_payment_method(kbAccountId, kbPaymentMethodId, context)
|
|
460
|
+
java_signature 'Java::void deletePaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
461
|
+
def delete_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
|
267
462
|
|
|
268
463
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
269
464
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -271,10 +466,19 @@ module Killbill
|
|
|
271
466
|
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
|
272
467
|
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
|
273
468
|
|
|
469
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
470
|
+
tmp = []
|
|
471
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
472
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
473
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
474
|
+
tmp << m
|
|
475
|
+
end
|
|
476
|
+
properties = tmp
|
|
477
|
+
|
|
274
478
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
275
479
|
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
276
480
|
begin
|
|
277
|
-
@delegate_plugin.delete_payment_method(kbAccountId, kbPaymentMethodId, context)
|
|
481
|
+
@delegate_plugin.delete_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
|
278
482
|
rescue Exception => e
|
|
279
483
|
message = "Failure in delete_payment_method: #{e}"
|
|
280
484
|
unless e.backtrace.nil?
|
|
@@ -287,8 +491,8 @@ module Killbill
|
|
|
287
491
|
end
|
|
288
492
|
end
|
|
289
493
|
|
|
290
|
-
java_signature 'Java::org.killbill.billing.payment.api.PaymentMethodPlugin getPaymentMethodDetail(Java::java.util.UUID, Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
291
|
-
def get_payment_method_detail(kbAccountId, kbPaymentMethodId, context)
|
|
494
|
+
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)'
|
|
495
|
+
def get_payment_method_detail(kbAccountId, kbPaymentMethodId, properties, context)
|
|
292
496
|
|
|
293
497
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
294
498
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -296,10 +500,19 @@ module Killbill
|
|
|
296
500
|
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
|
297
501
|
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
|
298
502
|
|
|
503
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
504
|
+
tmp = []
|
|
505
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
506
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
507
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
508
|
+
tmp << m
|
|
509
|
+
end
|
|
510
|
+
properties = tmp
|
|
511
|
+
|
|
299
512
|
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
300
513
|
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
301
514
|
begin
|
|
302
|
-
res = @delegate_plugin.get_payment_method_detail(kbAccountId, kbPaymentMethodId, context)
|
|
515
|
+
res = @delegate_plugin.get_payment_method_detail(kbAccountId, kbPaymentMethodId, properties, context)
|
|
303
516
|
# conversion for res [type = org.killbill.billing.payment.api.PaymentMethodPlugin]
|
|
304
517
|
res = res.to_java unless res.nil?
|
|
305
518
|
return res
|
|
@@ -315,8 +528,8 @@ module Killbill
|
|
|
315
528
|
end
|
|
316
529
|
end
|
|
317
530
|
|
|
318
|
-
java_signature 'Java::void setDefaultPaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
319
|
-
def set_default_payment_method(kbAccountId, kbPaymentMethodId, context)
|
|
531
|
+
java_signature 'Java::void setDefaultPaymentMethod(Java::java.util.UUID, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
532
|
+
def set_default_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
|
320
533
|
|
|
321
534
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
322
535
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -324,10 +537,19 @@ module Killbill
|
|
|
324
537
|
# conversion for kbPaymentMethodId [type = java.util.UUID]
|
|
325
538
|
kbPaymentMethodId = kbPaymentMethodId.nil? ? nil : kbPaymentMethodId.to_s
|
|
326
539
|
|
|
540
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
541
|
+
tmp = []
|
|
542
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
543
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
544
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
545
|
+
tmp << m
|
|
546
|
+
end
|
|
547
|
+
properties = tmp
|
|
548
|
+
|
|
327
549
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
328
550
|
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
329
551
|
begin
|
|
330
|
-
@delegate_plugin.set_default_payment_method(kbAccountId, kbPaymentMethodId, context)
|
|
552
|
+
@delegate_plugin.set_default_payment_method(kbAccountId, kbPaymentMethodId, properties, context)
|
|
331
553
|
rescue Exception => e
|
|
332
554
|
message = "Failure in set_default_payment_method: #{e}"
|
|
333
555
|
unless e.backtrace.nil?
|
|
@@ -340,8 +562,8 @@ module Killbill
|
|
|
340
562
|
end
|
|
341
563
|
end
|
|
342
564
|
|
|
343
|
-
java_signature 'Java::java.util.List getPaymentMethods(Java::java.util.UUID, Java::boolean, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
344
|
-
def get_payment_methods(kbAccountId, refreshFromGateway, context)
|
|
565
|
+
java_signature 'Java::java.util.List getPaymentMethods(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
566
|
+
def get_payment_methods(kbAccountId, refreshFromGateway, properties, context)
|
|
345
567
|
|
|
346
568
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
347
569
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -354,10 +576,19 @@ module Killbill
|
|
|
354
576
|
refreshFromGateway = tmp_bool ? true : false
|
|
355
577
|
end
|
|
356
578
|
|
|
579
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
580
|
+
tmp = []
|
|
581
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
582
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
583
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
584
|
+
tmp << m
|
|
585
|
+
end
|
|
586
|
+
properties = tmp
|
|
587
|
+
|
|
357
588
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
358
589
|
context = Killbill::Plugin::Model::CallContext.new.to_ruby(context) unless context.nil?
|
|
359
590
|
begin
|
|
360
|
-
res = @delegate_plugin.get_payment_methods(kbAccountId, refreshFromGateway, context)
|
|
591
|
+
res = @delegate_plugin.get_payment_methods(kbAccountId, refreshFromGateway, properties, context)
|
|
361
592
|
# conversion for res [type = java.util.List]
|
|
362
593
|
tmp = java.util.ArrayList.new
|
|
363
594
|
(res || []).each do |m|
|
|
@@ -379,8 +610,8 @@ module Killbill
|
|
|
379
610
|
end
|
|
380
611
|
end
|
|
381
612
|
|
|
382
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPaymentMethods(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
383
|
-
def search_payment_methods(searchKey, offset, limit, context)
|
|
613
|
+
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)'
|
|
614
|
+
def search_payment_methods(searchKey, offset, limit, properties, context)
|
|
384
615
|
|
|
385
616
|
# conversion for searchKey [type = java.lang.String]
|
|
386
617
|
|
|
@@ -388,10 +619,19 @@ module Killbill
|
|
|
388
619
|
|
|
389
620
|
# conversion for limit [type = java.lang.Long]
|
|
390
621
|
|
|
622
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
623
|
+
tmp = []
|
|
624
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
625
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
626
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
627
|
+
tmp << m
|
|
628
|
+
end
|
|
629
|
+
properties = tmp
|
|
630
|
+
|
|
391
631
|
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
392
632
|
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
393
633
|
begin
|
|
394
|
-
res = @delegate_plugin.search_payment_methods(searchKey, offset, limit, context)
|
|
634
|
+
res = @delegate_plugin.search_payment_methods(searchKey, offset, limit, properties, context)
|
|
395
635
|
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
396
636
|
res = res.to_java unless res.nil?
|
|
397
637
|
return res
|
|
@@ -407,8 +647,8 @@ module Killbill
|
|
|
407
647
|
end
|
|
408
648
|
end
|
|
409
649
|
|
|
410
|
-
java_signature 'Java::void resetPaymentMethods(Java::java.util.UUID, Java::java.util.List)'
|
|
411
|
-
def reset_payment_methods(kbAccountId, paymentMethods)
|
|
650
|
+
java_signature 'Java::void resetPaymentMethods(Java::java.util.UUID, Java::java.util.List, Java::java.lang.Iterable)'
|
|
651
|
+
def reset_payment_methods(kbAccountId, paymentMethods, properties)
|
|
412
652
|
|
|
413
653
|
# conversion for kbAccountId [type = java.util.UUID]
|
|
414
654
|
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
@@ -421,8 +661,17 @@ module Killbill
|
|
|
421
661
|
tmp << m
|
|
422
662
|
end
|
|
423
663
|
paymentMethods = tmp
|
|
664
|
+
|
|
665
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
666
|
+
tmp = []
|
|
667
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
668
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
669
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
670
|
+
tmp << m
|
|
671
|
+
end
|
|
672
|
+
properties = tmp
|
|
424
673
|
begin
|
|
425
|
-
@delegate_plugin.reset_payment_methods(kbAccountId, paymentMethods)
|
|
674
|
+
@delegate_plugin.reset_payment_methods(kbAccountId, paymentMethods, properties)
|
|
426
675
|
rescue Exception => e
|
|
427
676
|
message = "Failure in reset_payment_methods: #{e}"
|
|
428
677
|
unless e.backtrace.nil?
|
|
@@ -434,6 +683,76 @@ module Killbill
|
|
|
434
683
|
@delegate_plugin.after_request
|
|
435
684
|
end
|
|
436
685
|
end
|
|
686
|
+
|
|
687
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor buildFormDescriptor(Java::java.util.UUID, Java::org.killbill.billing.payment.plugin.api.HostedPaymentPageDescriptorFields, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
688
|
+
def build_form_descriptor(kbAccountId, descriptorFields, properties, context)
|
|
689
|
+
|
|
690
|
+
# conversion for kbAccountId [type = java.util.UUID]
|
|
691
|
+
kbAccountId = kbAccountId.nil? ? nil : kbAccountId.to_s
|
|
692
|
+
|
|
693
|
+
# conversion for descriptorFields [type = org.killbill.billing.payment.plugin.api.HostedPaymentPageDescriptorFields]
|
|
694
|
+
descriptorFields = Killbill::Plugin::Model::HostedPaymentPageDescriptorFields.new.to_ruby(descriptorFields) unless descriptorFields.nil?
|
|
695
|
+
|
|
696
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
697
|
+
tmp = []
|
|
698
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
699
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
700
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
701
|
+
tmp << m
|
|
702
|
+
end
|
|
703
|
+
properties = tmp
|
|
704
|
+
|
|
705
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
706
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
707
|
+
begin
|
|
708
|
+
res = @delegate_plugin.build_form_descriptor(kbAccountId, descriptorFields, properties, context)
|
|
709
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.HostedPaymentPageFormDescriptor]
|
|
710
|
+
res = res.to_java unless res.nil?
|
|
711
|
+
return res
|
|
712
|
+
rescue Exception => e
|
|
713
|
+
message = "Failure in build_form_descriptor: #{e}"
|
|
714
|
+
unless e.backtrace.nil?
|
|
715
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
|
716
|
+
end
|
|
717
|
+
logger.warn message
|
|
718
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("build_form_descriptor failure", e.message)
|
|
719
|
+
ensure
|
|
720
|
+
@delegate_plugin.after_request
|
|
721
|
+
end
|
|
722
|
+
end
|
|
723
|
+
|
|
724
|
+
java_signature 'Java::org.killbill.billing.payment.plugin.api.HostedPaymentPageNotification processNotification(Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
725
|
+
def process_notification(notification, properties, context)
|
|
726
|
+
|
|
727
|
+
# conversion for notification [type = java.lang.String]
|
|
728
|
+
|
|
729
|
+
# conversion for properties [type = java.lang.Iterable]
|
|
730
|
+
tmp = []
|
|
731
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
|
732
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
733
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
|
734
|
+
tmp << m
|
|
735
|
+
end
|
|
736
|
+
properties = tmp
|
|
737
|
+
|
|
738
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
739
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
|
740
|
+
begin
|
|
741
|
+
res = @delegate_plugin.process_notification(notification, properties, context)
|
|
742
|
+
# conversion for res [type = org.killbill.billing.payment.plugin.api.HostedPaymentPageNotification]
|
|
743
|
+
res = res.to_java unless res.nil?
|
|
744
|
+
return res
|
|
745
|
+
rescue Exception => e
|
|
746
|
+
message = "Failure in process_notification: #{e}"
|
|
747
|
+
unless e.backtrace.nil?
|
|
748
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
|
749
|
+
end
|
|
750
|
+
logger.warn message
|
|
751
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("process_notification failure", e.message)
|
|
752
|
+
ensure
|
|
753
|
+
@delegate_plugin.after_request
|
|
754
|
+
end
|
|
755
|
+
end
|
|
437
756
|
end
|
|
438
757
|
end
|
|
439
758
|
end
|