killbill 3.1.4 → 3.1.5
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/Jarfile +1 -1
- data/NEWS +3 -0
- data/VERSION +1 -1
- data/killbill.gemspec +1 -1
- data/lib/killbill.rb +1 -1
- data/lib/killbill/gen/api/account.rb +19 -18
- data/lib/killbill/gen/api/account_api_exception.rb +19 -18
- data/lib/killbill/gen/api/account_audit_logs.rb +19 -18
- data/lib/killbill/gen/api/account_audit_logs_for_object_type.rb +19 -18
- data/lib/killbill/gen/api/account_data.rb +19 -18
- data/lib/killbill/gen/api/account_email.rb +19 -18
- data/lib/killbill/gen/api/account_user_api.rb +19 -18
- data/lib/killbill/gen/api/audit_log.rb +19 -18
- data/lib/killbill/gen/api/audit_user_api.rb +19 -18
- data/lib/killbill/gen/api/billing_exception_base.rb +19 -18
- data/lib/killbill/gen/api/block.rb +19 -18
- data/lib/killbill/gen/api/blockable.rb +19 -18
- data/lib/killbill/gen/api/blocking_api_exception.rb +19 -18
- data/lib/killbill/gen/api/blocking_state.rb +19 -18
- data/lib/killbill/gen/api/call_context.rb +19 -18
- data/lib/killbill/gen/api/catalog.rb +19 -18
- data/lib/killbill/gen/api/catalog_api_exception.rb +19 -18
- data/lib/killbill/gen/api/catalog_user_api.rb +19 -18
- data/lib/killbill/gen/api/column_info.rb +19 -18
- data/lib/killbill/gen/api/control_tag.rb +19 -18
- data/lib/killbill/gen/api/currency_conversion.rb +19 -18
- data/lib/killbill/gen/api/currency_conversion_api.rb +19 -18
- data/lib/killbill/gen/api/currency_conversion_exception.rb +19 -18
- data/lib/killbill/gen/api/currency_value_null.rb +19 -18
- data/lib/killbill/gen/api/custom_field.rb +19 -18
- data/lib/killbill/gen/api/custom_field_api_exception.rb +19 -18
- data/lib/killbill/gen/api/custom_field_user_api.rb +19 -18
- data/lib/killbill/gen/api/database_export_output_stream.rb +19 -18
- data/lib/killbill/gen/api/duration.rb +19 -18
- data/lib/killbill/gen/api/entitlement.rb +19 -18
- data/lib/killbill/gen/api/entitlement_ao_status_dry_run.rb +19 -18
- data/lib/killbill/gen/api/entitlement_api.rb +19 -18
- data/lib/killbill/gen/api/entitlement_api_exception.rb +19 -18
- data/lib/killbill/gen/api/entity.rb +19 -18
- data/lib/killbill/gen/api/fixed.rb +19 -18
- data/lib/killbill/gen/api/illegal_plan_change.rb +19 -18
- data/lib/killbill/gen/api/international_price.rb +19 -18
- data/lib/killbill/gen/api/invalid_config_exception.rb +19 -18
- data/lib/killbill/gen/api/invoice.rb +19 -18
- data/lib/killbill/gen/api/invoice_api_exception.rb +19 -18
- data/lib/killbill/gen/api/invoice_creation_event.rb +19 -18
- data/lib/killbill/gen/api/invoice_formatter.rb +19 -18
- data/lib/killbill/gen/api/invoice_item.rb +19 -18
- data/lib/killbill/gen/api/invoice_item_formatter.rb +19 -18
- data/lib/killbill/gen/api/invoice_payment.rb +19 -18
- data/lib/killbill/gen/api/invoice_payment_api.rb +19 -18
- data/lib/killbill/gen/api/invoice_user_api.rb +19 -18
- data/lib/killbill/gen/api/limit.rb +19 -18
- data/lib/killbill/gen/api/listing.rb +19 -18
- data/lib/killbill/gen/api/migration_plan.rb +19 -18
- data/lib/killbill/gen/api/mutable_account_data.rb +19 -18
- data/lib/killbill/gen/api/osgi_killbill.rb +22 -21
- data/lib/killbill/gen/api/osgi_plugin_properties.rb +19 -18
- data/lib/killbill/gen/api/pagination.rb +19 -18
- data/lib/killbill/gen/api/{direct_payment.rb → payment.rb} +24 -23
- data/lib/killbill/gen/api/payment_api.rb +539 -347
- data/lib/killbill/gen/api/payment_api_exception.rb +19 -18
- data/lib/killbill/gen/api/payment_gateway_api.rb +19 -18
- data/lib/killbill/gen/api/payment_method.rb +19 -18
- data/lib/killbill/gen/api/payment_method_plugin.rb +19 -18
- data/lib/killbill/gen/api/payment_options.rb +19 -18
- data/lib/killbill/gen/api/{direct_payment_transaction.rb → payment_transaction.rb} +27 -26
- data/lib/killbill/gen/api/plan.rb +19 -18
- data/lib/killbill/gen/api/plan_change_result.rb +19 -18
- data/lib/killbill/gen/api/plan_phase.rb +19 -18
- data/lib/killbill/gen/api/plan_phase_specifier.rb +19 -18
- data/lib/killbill/gen/api/plan_specifier.rb +19 -18
- data/lib/killbill/gen/api/plugin_config_service_api.rb +19 -18
- data/lib/killbill/gen/api/plugin_property.rb +19 -18
- data/lib/killbill/gen/api/price.rb +19 -18
- data/lib/killbill/gen/api/price_list.rb +19 -18
- data/lib/killbill/gen/api/price_list_set.rb +19 -18
- data/lib/killbill/gen/api/product.rb +19 -18
- data/lib/killbill/gen/api/rate.rb +19 -18
- data/lib/killbill/gen/api/record_id_api.rb +19 -18
- data/lib/killbill/gen/api/recurring.rb +19 -18
- data/lib/killbill/gen/api/refund.rb +19 -18
- data/lib/killbill/gen/api/require_gen.rb +22 -21
- data/lib/killbill/gen/api/rolled_up_usage.rb +19 -18
- data/lib/killbill/gen/api/security_api_exception.rb +19 -18
- data/lib/killbill/gen/api/static_catalog.rb +19 -18
- data/lib/killbill/gen/api/subscription.rb +19 -18
- data/lib/killbill/gen/api/subscription_api.rb +19 -18
- data/lib/killbill/gen/api/subscription_api_exception.rb +19 -18
- data/lib/killbill/gen/api/subscription_bundle.rb +19 -18
- data/lib/killbill/gen/api/subscription_bundle_timeline.rb +19 -18
- data/lib/killbill/gen/api/subscription_event.rb +19 -18
- data/lib/killbill/gen/api/tag.rb +19 -18
- data/lib/killbill/gen/api/tag_api_exception.rb +19 -18
- data/lib/killbill/gen/api/tag_definition.rb +19 -18
- data/lib/killbill/gen/api/tag_definition_api_exception.rb +19 -18
- data/lib/killbill/gen/api/tag_user_api.rb +19 -18
- data/lib/killbill/gen/api/tenant.rb +19 -18
- data/lib/killbill/gen/api/tenant_api_exception.rb +19 -18
- data/lib/killbill/gen/api/tenant_context.rb +19 -18
- data/lib/killbill/gen/api/tenant_data.rb +19 -18
- data/lib/killbill/gen/api/tenant_kv.rb +19 -18
- data/lib/killbill/gen/api/tenant_user_api.rb +19 -18
- data/lib/killbill/gen/api/tier.rb +19 -18
- data/lib/killbill/gen/api/tiered_block.rb +19 -18
- data/lib/killbill/gen/api/unit.rb +19 -18
- data/lib/killbill/gen/api/usage.rb +19 -18
- data/lib/killbill/gen/api/usage_user_api.rb +19 -18
- data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +17 -12
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +44 -42
- metadata +6 -7
- data/lib/killbill/gen/api/direct_payment_api.rb +0 -959
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2010-2013 Ning, Inc.
|
|
4
|
-
# Copyright 2014
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
|
|
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
|
+
#############################################################################################
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
#
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2010-2013 Ning, Inc.
|
|
4
|
-
# Copyright 2014
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
|
|
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
|
+
#############################################################################################
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
#
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2010-2013 Ning, Inc.
|
|
4
|
-
# Copyright 2014
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
|
|
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
|
+
#############################################################################################
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
#
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2010-2013 Ning, Inc.
|
|
4
|
-
# Copyright 2014
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
|
|
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
|
+
#############################################################################################
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
#
|
|
@@ -20,6 +20,21 @@ module Killbill
|
|
|
20
20
|
context = context.to_ruby(context)
|
|
21
21
|
|
|
22
22
|
# Generate a token
|
|
23
|
+
properties = build_pm_properties(account)
|
|
24
|
+
|
|
25
|
+
info = Killbill::Plugin::Model::PaymentMethodPlugin.new
|
|
26
|
+
info.properties = properties
|
|
27
|
+
payment_method = @plugin.add_payment_method(kb_account_id, kb_payment_method_id, info, true, [], context)
|
|
28
|
+
|
|
29
|
+
pm = payment_method_model.from_kb_payment_method_id kb_payment_method_id, context.tenant_id
|
|
30
|
+
pm.should == payment_method
|
|
31
|
+
pm.kb_account_id.should == kb_account_id
|
|
32
|
+
pm.kb_payment_method_id.should == kb_payment_method_id
|
|
33
|
+
|
|
34
|
+
pm
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def build_pm_properties(account = nil)
|
|
23
38
|
cc_number = '4242424242424242'
|
|
24
39
|
cc_first_name = 'John'
|
|
25
40
|
cc_last_name = 'Doe'
|
|
@@ -43,7 +58,7 @@ module Killbill
|
|
|
43
58
|
properties << create_pm_kv_info('ccExpirationMonth', cc_exp_month)
|
|
44
59
|
properties << create_pm_kv_info('ccExpirationYear', cc_exp_year)
|
|
45
60
|
properties << create_pm_kv_info('ccLast4', cc_last_4)
|
|
46
|
-
properties << create_pm_kv_info('email', account.nil? ?
|
|
61
|
+
properties << create_pm_kv_info('email', account.nil? ? Time.now.to_i.to_s + '-test@tester.com' : account.email) # Required by e.g. CyberSource
|
|
47
62
|
properties << create_pm_kv_info('address1', address1)
|
|
48
63
|
properties << create_pm_kv_info('address2', address2)
|
|
49
64
|
properties << create_pm_kv_info('city', city)
|
|
@@ -51,17 +66,7 @@ module Killbill
|
|
|
51
66
|
properties << create_pm_kv_info('zip', zip)
|
|
52
67
|
properties << create_pm_kv_info('country', country)
|
|
53
68
|
properties << create_pm_kv_info('ccVerificationValue', cc_verification_value)
|
|
54
|
-
|
|
55
|
-
info = Killbill::Plugin::Model::PaymentMethodPlugin.new
|
|
56
|
-
info.properties = properties
|
|
57
|
-
payment_method = @plugin.add_payment_method(kb_account_id, kb_payment_method_id, info, true, [], context)
|
|
58
|
-
|
|
59
|
-
pm = payment_method_model.from_kb_payment_method_id kb_payment_method_id, context.tenant_id
|
|
60
|
-
pm.should == payment_method
|
|
61
|
-
pm.kb_account_id.should == kb_account_id
|
|
62
|
-
pm.kb_payment_method_id.should == kb_payment_method_id
|
|
63
|
-
|
|
64
|
-
pm
|
|
69
|
+
properties
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
def create_kb_account(kb_account_id)
|
|
@@ -42,7 +42,7 @@ module Killbill
|
|
|
42
42
|
options[:description] ||= "Kill Bill authorization for #{kb_payment_transaction_id}"
|
|
43
43
|
|
|
44
44
|
# Retrieve the payment method
|
|
45
|
-
payment_source = get_payment_source(kb_payment_method_id, options, context)
|
|
45
|
+
payment_source = get_payment_source(kb_payment_method_id, properties, options, context)
|
|
46
46
|
|
|
47
47
|
# Go to the gateway
|
|
48
48
|
gw_response = gateway.authorize(amount_in_cents, payment_source, options)
|
|
@@ -79,7 +79,7 @@ module Killbill
|
|
|
79
79
|
options[:description] ||= "Kill Bill purchase for #{kb_payment_transaction_id}"
|
|
80
80
|
|
|
81
81
|
# Retrieve the payment method
|
|
82
|
-
payment_source = get_payment_source(kb_payment_method_id, options, context)
|
|
82
|
+
payment_source = get_payment_source(kb_payment_method_id, properties, options, context)
|
|
83
83
|
|
|
84
84
|
# Go to the gateway
|
|
85
85
|
gw_response = gateway.purchase(amount_in_cents, payment_source, options)
|
|
@@ -112,7 +112,7 @@ module Killbill
|
|
|
112
112
|
options[:description] ||= "Kill Bill credit for #{kb_payment_transaction_id}"
|
|
113
113
|
|
|
114
114
|
# Retrieve the payment method
|
|
115
|
-
payment_source = get_payment_source(kb_payment_method_id, options, context)
|
|
115
|
+
payment_source = get_payment_source(kb_payment_method_id, properties, options, context)
|
|
116
116
|
|
|
117
117
|
# Go to the gateway
|
|
118
118
|
gw_response = gateway.credit(amount_in_cents, payment_source, options)
|
|
@@ -152,45 +152,21 @@ module Killbill
|
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
|
|
155
|
+
all_properties = (payment_method_props || payment_method_props.properties || []) + properties
|
|
155
156
|
options = properties_to_hash(properties)
|
|
156
157
|
options[:set_default] ||= set_default
|
|
158
|
+
options[:order_id] ||= kb_payment_method_id
|
|
157
159
|
|
|
158
160
|
# Registering a card or a token
|
|
159
|
-
|
|
160
|
-
if cc_or_token.blank?
|
|
161
|
-
# Nope - real credit card
|
|
162
|
-
cc_or_token = ::ActiveMerchant::Billing::CreditCard.new(
|
|
163
|
-
:number => find_value_from_payment_method_props(payment_method_props, 'ccNumber'),
|
|
164
|
-
:brand => find_value_from_payment_method_props(payment_method_props, 'ccType'),
|
|
165
|
-
:month => find_value_from_payment_method_props(payment_method_props, 'ccExpirationMonth'),
|
|
166
|
-
:year => find_value_from_payment_method_props(payment_method_props, 'ccExpirationYear'),
|
|
167
|
-
:verification_value => find_value_from_payment_method_props(payment_method_props, 'ccVerificationValue'),
|
|
168
|
-
:first_name => find_value_from_payment_method_props(payment_method_props, 'ccFirstName'),
|
|
169
|
-
:last_name => find_value_from_payment_method_props(payment_method_props, 'ccLastName')
|
|
170
|
-
)
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
options[:billing_address] ||= {
|
|
174
|
-
:email => find_value_from_payment_method_props(payment_method_props, 'email'),
|
|
175
|
-
:address1 => find_value_from_payment_method_props(payment_method_props, 'address1'),
|
|
176
|
-
:address2 => find_value_from_payment_method_props(payment_method_props, 'address2'),
|
|
177
|
-
:city => find_value_from_payment_method_props(payment_method_props, 'city'),
|
|
178
|
-
:zip => find_value_from_payment_method_props(payment_method_props, 'zip'),
|
|
179
|
-
:state => find_value_from_payment_method_props(payment_method_props, 'state'),
|
|
180
|
-
:country => find_value_from_payment_method_props(payment_method_props, 'country')
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
# To make various gateway implementations happy...
|
|
184
|
-
options[:billing_address].each { |k, v| options[k] ||= v }
|
|
185
|
-
|
|
186
|
-
options[:order_id] ||= kb_payment_method_id
|
|
161
|
+
payment_source = get_payment_source(nil, all_properties, options, context)
|
|
187
162
|
|
|
188
163
|
# Go to the gateway
|
|
189
|
-
gw_response = gateway.store
|
|
164
|
+
gw_response = gateway.store payment_source, options
|
|
190
165
|
response, transaction = save_response_and_transaction gw_response, :add_payment_method, kb_account_id, context.tenant_id
|
|
191
166
|
|
|
192
167
|
if response.success
|
|
193
|
-
|
|
168
|
+
# response.authorization may be a String combination separated by ; - don't split it! Some plugins expect it as-is (they split it themselves)
|
|
169
|
+
payment_method = @payment_method_model.from_response(kb_account_id, kb_payment_method_id, context.tenant_id, response.authorization, gw_response, options)
|
|
194
170
|
payment_method.save!
|
|
195
171
|
payment_method
|
|
196
172
|
else
|
|
@@ -373,21 +349,47 @@ module Killbill
|
|
|
373
349
|
Monetize.from_numeric(amount, currency).cents.to_i
|
|
374
350
|
end
|
|
375
351
|
|
|
376
|
-
def get_payment_source(kb_payment_method_id, options, context)
|
|
377
|
-
|
|
378
|
-
|
|
352
|
+
def get_payment_source(kb_payment_method_id, properties, options, context)
|
|
353
|
+
cc_number = find_value_from_properties(properties, 'ccNumber')
|
|
354
|
+
cc_or_token = find_value_from_properties(properties, 'token') || find_value_from_properties(properties, 'cardId')
|
|
355
|
+
|
|
356
|
+
if cc_number.blank? and cc_or_token.blank?
|
|
357
|
+
# Existing token
|
|
358
|
+
cc_or_token = @payment_method_model.from_kb_payment_method_id(kb_payment_method_id, context.tenant_id).token
|
|
359
|
+
elsif !cc_number.blank? and cc_or_token.blank?
|
|
360
|
+
# Real credit card
|
|
361
|
+
cc_or_token = ::ActiveMerchant::Billing::CreditCard.new(
|
|
362
|
+
:number => cc_number,
|
|
363
|
+
:brand => find_value_from_properties(properties, 'ccType'),
|
|
364
|
+
:month => find_value_from_properties(properties, 'ccExpirationMonth'),
|
|
365
|
+
:year => find_value_from_properties(properties, 'ccExpirationYear'),
|
|
366
|
+
:verification_value => find_value_from_properties(properties, 'ccVerificationValue'),
|
|
367
|
+
:first_name => find_value_from_properties(properties, 'ccFirstName'),
|
|
368
|
+
:last_name => find_value_from_properties(properties, 'ccLastName')
|
|
369
|
+
)
|
|
379
370
|
else
|
|
380
|
-
|
|
371
|
+
# Use specified token
|
|
381
372
|
end
|
|
382
|
-
end
|
|
383
373
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
374
|
+
options[:billing_address] ||= {
|
|
375
|
+
:email => find_value_from_properties(properties, 'email'),
|
|
376
|
+
:address1 => find_value_from_properties(properties, 'address1'),
|
|
377
|
+
:address2 => find_value_from_properties(properties, 'address2'),
|
|
378
|
+
:city => find_value_from_properties(properties, 'city'),
|
|
379
|
+
:zip => find_value_from_properties(properties, 'zip'),
|
|
380
|
+
:state => find_value_from_properties(properties, 'state'),
|
|
381
|
+
:country => find_value_from_properties(properties, 'country')
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
# To make various gateway implementations happy...
|
|
385
|
+
options[:billing_address].each { |k, v| options[k] ||= v }
|
|
386
|
+
|
|
387
|
+
cc_or_token
|
|
387
388
|
end
|
|
388
389
|
|
|
389
390
|
def find_value_from_properties(properties, key)
|
|
390
|
-
|
|
391
|
+
return nil if key.nil?
|
|
392
|
+
prop = (properties.find { |kv| kv.key.to_s == key.to_s })
|
|
391
393
|
prop.nil? ? nil : prop.value
|
|
392
394
|
end
|
|
393
395
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: killbill
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kill Bill core team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-07-
|
|
11
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sinatra
|
|
@@ -72,12 +72,12 @@ dependencies:
|
|
|
72
72
|
requirements:
|
|
73
73
|
- - ~>
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 1.
|
|
75
|
+
version: 1.42.0
|
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
|
77
77
|
requirements:
|
|
78
78
|
- - ~>
|
|
79
79
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: 1.
|
|
80
|
+
version: 1.42.0
|
|
81
81
|
prerelease: false
|
|
82
82
|
type: :development
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
@@ -227,9 +227,6 @@ files:
|
|
|
227
227
|
- lib/killbill/gen/api/custom_field_api_exception.rb
|
|
228
228
|
- lib/killbill/gen/api/custom_field_user_api.rb
|
|
229
229
|
- lib/killbill/gen/api/database_export_output_stream.rb
|
|
230
|
-
- lib/killbill/gen/api/direct_payment.rb
|
|
231
|
-
- lib/killbill/gen/api/direct_payment_api.rb
|
|
232
|
-
- lib/killbill/gen/api/direct_payment_transaction.rb
|
|
233
230
|
- lib/killbill/gen/api/duration.rb
|
|
234
231
|
- lib/killbill/gen/api/entitlement.rb
|
|
235
232
|
- lib/killbill/gen/api/entitlement_ao_status_dry_run.rb
|
|
@@ -257,6 +254,7 @@ files:
|
|
|
257
254
|
- lib/killbill/gen/api/osgi_killbill.rb
|
|
258
255
|
- lib/killbill/gen/api/osgi_plugin_properties.rb
|
|
259
256
|
- lib/killbill/gen/api/pagination.rb
|
|
257
|
+
- lib/killbill/gen/api/payment.rb
|
|
260
258
|
- lib/killbill/gen/api/payment_api.rb
|
|
261
259
|
- lib/killbill/gen/api/payment_api_exception.rb
|
|
262
260
|
- lib/killbill/gen/api/payment_attempt.rb
|
|
@@ -265,6 +263,7 @@ files:
|
|
|
265
263
|
- lib/killbill/gen/api/payment_method_kv_info.rb
|
|
266
264
|
- lib/killbill/gen/api/payment_method_plugin.rb
|
|
267
265
|
- lib/killbill/gen/api/payment_options.rb
|
|
266
|
+
- lib/killbill/gen/api/payment_transaction.rb
|
|
268
267
|
- lib/killbill/gen/api/plan.rb
|
|
269
268
|
- lib/killbill/gen/api/plan_change_result.rb
|
|
270
269
|
- lib/killbill/gen/api/plan_phase.rb
|
|
@@ -1,959 +0,0 @@
|
|
|
1
|
-
###################################################################################
|
|
2
|
-
# #
|
|
3
|
-
# Copyright 2010-2013 Ning, Inc. #
|
|
4
|
-
# Copyright 2014 The Billing Project, LLC #
|
|
5
|
-
# #
|
|
6
|
-
# The Billing Project licenses this file to you under the Apache License, #
|
|
7
|
-
# version 2.0 (the "License"); you may not use this file except in #
|
|
8
|
-
# compliance with the License. You may obtain a copy of the License at: #
|
|
9
|
-
# #
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0 #
|
|
11
|
-
# #
|
|
12
|
-
# Unless required by applicable law or agreed to in writing, software #
|
|
13
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
|
14
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
|
15
|
-
# License for the specific language governing permissions and limitations #
|
|
16
|
-
# under the License. #
|
|
17
|
-
# #
|
|
18
|
-
###################################################################################
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
# DO NOT EDIT!!!
|
|
23
|
-
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
module Killbill
|
|
28
|
-
module Plugin
|
|
29
|
-
module Api
|
|
30
|
-
|
|
31
|
-
java_package 'org.killbill.billing.payment.api'
|
|
32
|
-
class DirectPaymentApi
|
|
33
|
-
|
|
34
|
-
include org.killbill.billing.payment.api.DirectPaymentApi
|
|
35
|
-
|
|
36
|
-
def initialize(real_java_api)
|
|
37
|
-
@real_java_api = real_java_api
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createAuthorization(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
42
|
-
def create_authorization(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
|
|
43
|
-
|
|
44
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
45
|
-
account = account.to_java unless account.nil?
|
|
46
|
-
|
|
47
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
48
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
49
|
-
|
|
50
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
51
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
52
|
-
|
|
53
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
54
|
-
if amount.nil?
|
|
55
|
-
amount = java.math.BigDecimal::ZERO
|
|
56
|
-
else
|
|
57
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
61
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
62
|
-
|
|
63
|
-
# conversion for directPaymentExternalKey [type = java.lang.String]
|
|
64
|
-
directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
|
|
65
|
-
|
|
66
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
67
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
68
|
-
|
|
69
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
70
|
-
tmp = java.util.ArrayList.new
|
|
71
|
-
(properties || []).each do |m|
|
|
72
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
73
|
-
m = m.to_java unless m.nil?
|
|
74
|
-
tmp.add(m)
|
|
75
|
-
end
|
|
76
|
-
properties = tmp
|
|
77
|
-
|
|
78
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
79
|
-
context = context.to_java unless context.nil?
|
|
80
|
-
begin
|
|
81
|
-
res = @real_java_api.create_authorization(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
|
|
82
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
83
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
84
|
-
return res
|
|
85
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
86
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createCapture(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
91
|
-
def create_capture(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
|
|
92
|
-
|
|
93
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
94
|
-
account = account.to_java unless account.nil?
|
|
95
|
-
|
|
96
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
97
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
98
|
-
|
|
99
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
100
|
-
if amount.nil?
|
|
101
|
-
amount = java.math.BigDecimal::ZERO
|
|
102
|
-
else
|
|
103
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
107
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
108
|
-
|
|
109
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
110
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
111
|
-
|
|
112
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
113
|
-
tmp = java.util.ArrayList.new
|
|
114
|
-
(properties || []).each do |m|
|
|
115
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
116
|
-
m = m.to_java unless m.nil?
|
|
117
|
-
tmp.add(m)
|
|
118
|
-
end
|
|
119
|
-
properties = tmp
|
|
120
|
-
|
|
121
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
122
|
-
context = context.to_java unless context.nil?
|
|
123
|
-
begin
|
|
124
|
-
res = @real_java_api.create_capture(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
|
|
125
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
126
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
127
|
-
return res
|
|
128
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
129
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createPurchase(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
134
|
-
def create_purchase(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
|
|
135
|
-
|
|
136
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
137
|
-
account = account.to_java unless account.nil?
|
|
138
|
-
|
|
139
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
140
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
141
|
-
|
|
142
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
143
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
144
|
-
|
|
145
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
146
|
-
if amount.nil?
|
|
147
|
-
amount = java.math.BigDecimal::ZERO
|
|
148
|
-
else
|
|
149
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
153
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
154
|
-
|
|
155
|
-
# conversion for directPaymentExternalKey [type = java.lang.String]
|
|
156
|
-
directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
|
|
157
|
-
|
|
158
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
159
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
160
|
-
|
|
161
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
162
|
-
tmp = java.util.ArrayList.new
|
|
163
|
-
(properties || []).each do |m|
|
|
164
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
165
|
-
m = m.to_java unless m.nil?
|
|
166
|
-
tmp.add(m)
|
|
167
|
-
end
|
|
168
|
-
properties = tmp
|
|
169
|
-
|
|
170
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
171
|
-
context = context.to_java unless context.nil?
|
|
172
|
-
begin
|
|
173
|
-
res = @real_java_api.create_purchase(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
|
|
174
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
175
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
176
|
-
return res
|
|
177
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
178
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
179
|
-
end
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createPurchaseWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
183
|
-
def create_purchase_with_payment_control(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, paymentOptions, context)
|
|
184
|
-
|
|
185
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
186
|
-
account = account.to_java unless account.nil?
|
|
187
|
-
|
|
188
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
189
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
190
|
-
|
|
191
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
192
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
193
|
-
|
|
194
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
195
|
-
if amount.nil?
|
|
196
|
-
amount = java.math.BigDecimal::ZERO
|
|
197
|
-
else
|
|
198
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
202
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
203
|
-
|
|
204
|
-
# conversion for directPaymentExternalKey [type = java.lang.String]
|
|
205
|
-
directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
|
|
206
|
-
|
|
207
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
208
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
209
|
-
|
|
210
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
211
|
-
tmp = java.util.ArrayList.new
|
|
212
|
-
(properties || []).each do |m|
|
|
213
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
214
|
-
m = m.to_java unless m.nil?
|
|
215
|
-
tmp.add(m)
|
|
216
|
-
end
|
|
217
|
-
properties = tmp
|
|
218
|
-
|
|
219
|
-
# conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
|
|
220
|
-
paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
|
|
221
|
-
|
|
222
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
223
|
-
context = context.to_java unless context.nil?
|
|
224
|
-
begin
|
|
225
|
-
res = @real_java_api.create_purchase_with_payment_control(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, paymentOptions, context)
|
|
226
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
227
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
228
|
-
return res
|
|
229
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
230
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createVoid(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
235
|
-
def create_void(account, directPaymentId, directPaymentTransactionExternalKey, properties, context)
|
|
236
|
-
|
|
237
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
238
|
-
account = account.to_java unless account.nil?
|
|
239
|
-
|
|
240
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
241
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
242
|
-
|
|
243
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
244
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
245
|
-
|
|
246
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
247
|
-
tmp = java.util.ArrayList.new
|
|
248
|
-
(properties || []).each do |m|
|
|
249
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
250
|
-
m = m.to_java unless m.nil?
|
|
251
|
-
tmp.add(m)
|
|
252
|
-
end
|
|
253
|
-
properties = tmp
|
|
254
|
-
|
|
255
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
256
|
-
context = context.to_java unless context.nil?
|
|
257
|
-
begin
|
|
258
|
-
res = @real_java_api.create_void(account, directPaymentId, directPaymentTransactionExternalKey, properties, context)
|
|
259
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
260
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
261
|
-
return res
|
|
262
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
263
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
|
|
267
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createRefund(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
268
|
-
def create_refund(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
|
|
269
|
-
|
|
270
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
271
|
-
account = account.to_java unless account.nil?
|
|
272
|
-
|
|
273
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
274
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
275
|
-
|
|
276
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
277
|
-
if amount.nil?
|
|
278
|
-
amount = java.math.BigDecimal::ZERO
|
|
279
|
-
else
|
|
280
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
281
|
-
end
|
|
282
|
-
|
|
283
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
284
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
285
|
-
|
|
286
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
287
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
288
|
-
|
|
289
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
290
|
-
tmp = java.util.ArrayList.new
|
|
291
|
-
(properties || []).each do |m|
|
|
292
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
293
|
-
m = m.to_java unless m.nil?
|
|
294
|
-
tmp.add(m)
|
|
295
|
-
end
|
|
296
|
-
properties = tmp
|
|
297
|
-
|
|
298
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
299
|
-
context = context.to_java unless context.nil?
|
|
300
|
-
begin
|
|
301
|
-
res = @real_java_api.create_refund(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
|
|
302
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
303
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
304
|
-
return res
|
|
305
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
306
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
307
|
-
end
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createRefundWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
311
|
-
def create_refund_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, paymentOptions, context)
|
|
312
|
-
|
|
313
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
314
|
-
account = account.to_java unless account.nil?
|
|
315
|
-
|
|
316
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
317
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
318
|
-
|
|
319
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
320
|
-
if amount.nil?
|
|
321
|
-
amount = java.math.BigDecimal::ZERO
|
|
322
|
-
else
|
|
323
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
324
|
-
end
|
|
325
|
-
|
|
326
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
327
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
328
|
-
|
|
329
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
330
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
331
|
-
|
|
332
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
333
|
-
tmp = java.util.ArrayList.new
|
|
334
|
-
(properties || []).each do |m|
|
|
335
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
336
|
-
m = m.to_java unless m.nil?
|
|
337
|
-
tmp.add(m)
|
|
338
|
-
end
|
|
339
|
-
properties = tmp
|
|
340
|
-
|
|
341
|
-
# conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
|
|
342
|
-
paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
|
|
343
|
-
|
|
344
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
345
|
-
context = context.to_java unless context.nil?
|
|
346
|
-
begin
|
|
347
|
-
res = @real_java_api.create_refund_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, paymentOptions, context)
|
|
348
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
349
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
350
|
-
return res
|
|
351
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
352
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
353
|
-
end
|
|
354
|
-
end
|
|
355
|
-
|
|
356
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createCredit(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
357
|
-
def create_credit(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
|
|
358
|
-
|
|
359
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
360
|
-
account = account.to_java unless account.nil?
|
|
361
|
-
|
|
362
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
363
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
364
|
-
|
|
365
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
366
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
367
|
-
|
|
368
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
369
|
-
if amount.nil?
|
|
370
|
-
amount = java.math.BigDecimal::ZERO
|
|
371
|
-
else
|
|
372
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
373
|
-
end
|
|
374
|
-
|
|
375
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
376
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
377
|
-
|
|
378
|
-
# conversion for directPaymentExternalKey [type = java.lang.String]
|
|
379
|
-
directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
|
|
380
|
-
|
|
381
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
382
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
383
|
-
|
|
384
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
385
|
-
tmp = java.util.ArrayList.new
|
|
386
|
-
(properties || []).each do |m|
|
|
387
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
388
|
-
m = m.to_java unless m.nil?
|
|
389
|
-
tmp.add(m)
|
|
390
|
-
end
|
|
391
|
-
properties = tmp
|
|
392
|
-
|
|
393
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
394
|
-
context = context.to_java unless context.nil?
|
|
395
|
-
begin
|
|
396
|
-
res = @real_java_api.create_credit(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
|
|
397
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
398
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
399
|
-
return res
|
|
400
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
401
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
402
|
-
end
|
|
403
|
-
end
|
|
404
|
-
|
|
405
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createChargeback(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
406
|
-
def create_chargeback(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, context)
|
|
407
|
-
|
|
408
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
409
|
-
account = account.to_java unless account.nil?
|
|
410
|
-
|
|
411
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
412
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
413
|
-
|
|
414
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
415
|
-
if amount.nil?
|
|
416
|
-
amount = java.math.BigDecimal::ZERO
|
|
417
|
-
else
|
|
418
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
419
|
-
end
|
|
420
|
-
|
|
421
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
422
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
423
|
-
|
|
424
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
425
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
426
|
-
|
|
427
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
428
|
-
context = context.to_java unless context.nil?
|
|
429
|
-
begin
|
|
430
|
-
res = @real_java_api.create_chargeback(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, context)
|
|
431
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
432
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
433
|
-
return res
|
|
434
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
435
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
436
|
-
end
|
|
437
|
-
end
|
|
438
|
-
|
|
439
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createChargebackWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
440
|
-
def create_chargeback_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, paymentOptions, context)
|
|
441
|
-
|
|
442
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
443
|
-
account = account.to_java unless account.nil?
|
|
444
|
-
|
|
445
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
446
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
447
|
-
|
|
448
|
-
# conversion for amount [type = java.math.BigDecimal]
|
|
449
|
-
if amount.nil?
|
|
450
|
-
amount = java.math.BigDecimal::ZERO
|
|
451
|
-
else
|
|
452
|
-
amount = java.math.BigDecimal.new(amount.to_s)
|
|
453
|
-
end
|
|
454
|
-
|
|
455
|
-
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
|
456
|
-
currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
|
|
457
|
-
|
|
458
|
-
# conversion for directPaymentTransactionExternalKey [type = java.lang.String]
|
|
459
|
-
directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
|
|
460
|
-
|
|
461
|
-
# conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
|
|
462
|
-
paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
|
|
463
|
-
|
|
464
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
465
|
-
context = context.to_java unless context.nil?
|
|
466
|
-
begin
|
|
467
|
-
res = @real_java_api.create_chargeback_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, paymentOptions, context)
|
|
468
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
469
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
470
|
-
return res
|
|
471
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
472
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
473
|
-
end
|
|
474
|
-
end
|
|
475
|
-
|
|
476
|
-
java_signature 'Java::void notifyPendingTransactionOfStateChanged(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
477
|
-
def notify_pending_transaction_of_state_changed(account, directPaymentTransactionId, isSuccess, context)
|
|
478
|
-
|
|
479
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
480
|
-
account = account.to_java unless account.nil?
|
|
481
|
-
|
|
482
|
-
# conversion for directPaymentTransactionId [type = java.util.UUID]
|
|
483
|
-
directPaymentTransactionId = java.util.UUID.fromString(directPaymentTransactionId.to_s) unless directPaymentTransactionId.nil?
|
|
484
|
-
|
|
485
|
-
# conversion for isSuccess [type = boolean]
|
|
486
|
-
isSuccess = isSuccess.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(isSuccess)
|
|
487
|
-
|
|
488
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
489
|
-
context = context.to_java unless context.nil?
|
|
490
|
-
@real_java_api.notify_pending_transaction_of_state_changed(account, directPaymentTransactionId, isSuccess, context)
|
|
491
|
-
end
|
|
492
|
-
|
|
493
|
-
java_signature 'Java::void notifyPendingTransactionOfStateChangedWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
494
|
-
def notify_pending_transaction_of_state_changed_with_payment_control(account, directPaymentTransactionId, isSuccess, paymentOptions, context)
|
|
495
|
-
|
|
496
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
497
|
-
account = account.to_java unless account.nil?
|
|
498
|
-
|
|
499
|
-
# conversion for directPaymentTransactionId [type = java.util.UUID]
|
|
500
|
-
directPaymentTransactionId = java.util.UUID.fromString(directPaymentTransactionId.to_s) unless directPaymentTransactionId.nil?
|
|
501
|
-
|
|
502
|
-
# conversion for isSuccess [type = boolean]
|
|
503
|
-
isSuccess = isSuccess.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(isSuccess)
|
|
504
|
-
|
|
505
|
-
# conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
|
|
506
|
-
paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
|
|
507
|
-
|
|
508
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
509
|
-
context = context.to_java unless context.nil?
|
|
510
|
-
@real_java_api.notify_pending_transaction_of_state_changed_with_payment_control(account, directPaymentTransactionId, isSuccess, paymentOptions, context)
|
|
511
|
-
end
|
|
512
|
-
|
|
513
|
-
java_signature 'Java::java.util.List getAccountPayments(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
514
|
-
def get_account_payments(accountId, withPluginInfo, properties, context)
|
|
515
|
-
|
|
516
|
-
# conversion for accountId [type = java.util.UUID]
|
|
517
|
-
accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
|
|
518
|
-
|
|
519
|
-
# conversion for withPluginInfo [type = boolean]
|
|
520
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
521
|
-
|
|
522
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
523
|
-
tmp = java.util.ArrayList.new
|
|
524
|
-
(properties || []).each do |m|
|
|
525
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
526
|
-
m = m.to_java unless m.nil?
|
|
527
|
-
tmp.add(m)
|
|
528
|
-
end
|
|
529
|
-
properties = tmp
|
|
530
|
-
|
|
531
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
532
|
-
context = context.to_java unless context.nil?
|
|
533
|
-
begin
|
|
534
|
-
res = @real_java_api.get_account_payments(accountId, withPluginInfo, properties, context)
|
|
535
|
-
# conversion for res [type = java.util.List]
|
|
536
|
-
tmp = []
|
|
537
|
-
(res || []).each do |m|
|
|
538
|
-
# conversion for m [type = org.killbill.billing.payment.api.DirectPayment]
|
|
539
|
-
m = Killbill::Plugin::Model::DirectPayment.new.to_ruby(m) unless m.nil?
|
|
540
|
-
tmp << m
|
|
541
|
-
end
|
|
542
|
-
res = tmp
|
|
543
|
-
return res
|
|
544
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
545
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
546
|
-
end
|
|
547
|
-
end
|
|
548
|
-
|
|
549
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment getPayment(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
550
|
-
def get_payment(directPaymentId, withPluginInfo, properties, context)
|
|
551
|
-
|
|
552
|
-
# conversion for directPaymentId [type = java.util.UUID]
|
|
553
|
-
directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
|
|
554
|
-
|
|
555
|
-
# conversion for withPluginInfo [type = boolean]
|
|
556
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
557
|
-
|
|
558
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
559
|
-
tmp = java.util.ArrayList.new
|
|
560
|
-
(properties || []).each do |m|
|
|
561
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
562
|
-
m = m.to_java unless m.nil?
|
|
563
|
-
tmp.add(m)
|
|
564
|
-
end
|
|
565
|
-
properties = tmp
|
|
566
|
-
|
|
567
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
568
|
-
context = context.to_java unless context.nil?
|
|
569
|
-
begin
|
|
570
|
-
res = @real_java_api.get_payment(directPaymentId, withPluginInfo, properties, context)
|
|
571
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
572
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
573
|
-
return res
|
|
574
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
575
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
576
|
-
end
|
|
577
|
-
end
|
|
578
|
-
|
|
579
|
-
java_signature 'Java::org.killbill.billing.payment.api.DirectPayment getPaymentByExternalKey(Java::java.lang.String, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
580
|
-
def get_payment_by_external_key(paymentExternalKey, withPluginInfo, properties, context)
|
|
581
|
-
|
|
582
|
-
# conversion for paymentExternalKey [type = java.lang.String]
|
|
583
|
-
paymentExternalKey = paymentExternalKey.to_s unless paymentExternalKey.nil?
|
|
584
|
-
|
|
585
|
-
# conversion for withPluginInfo [type = boolean]
|
|
586
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
587
|
-
|
|
588
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
589
|
-
tmp = java.util.ArrayList.new
|
|
590
|
-
(properties || []).each do |m|
|
|
591
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
592
|
-
m = m.to_java unless m.nil?
|
|
593
|
-
tmp.add(m)
|
|
594
|
-
end
|
|
595
|
-
properties = tmp
|
|
596
|
-
|
|
597
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
598
|
-
context = context.to_java unless context.nil?
|
|
599
|
-
begin
|
|
600
|
-
res = @real_java_api.get_payment_by_external_key(paymentExternalKey, withPluginInfo, properties, context)
|
|
601
|
-
# conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
|
|
602
|
-
res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
|
|
603
|
-
return res
|
|
604
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
605
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
606
|
-
end
|
|
607
|
-
end
|
|
608
|
-
|
|
609
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination getPayments(Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
610
|
-
def get_payments(offset, limit, withPluginInfo, properties, context)
|
|
611
|
-
|
|
612
|
-
# conversion for offset [type = java.lang.Long]
|
|
613
|
-
offset = offset
|
|
614
|
-
|
|
615
|
-
# conversion for limit [type = java.lang.Long]
|
|
616
|
-
limit = limit
|
|
617
|
-
|
|
618
|
-
# conversion for withPluginInfo [type = boolean]
|
|
619
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
620
|
-
|
|
621
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
622
|
-
tmp = java.util.ArrayList.new
|
|
623
|
-
(properties || []).each do |m|
|
|
624
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
625
|
-
m = m.to_java unless m.nil?
|
|
626
|
-
tmp.add(m)
|
|
627
|
-
end
|
|
628
|
-
properties = tmp
|
|
629
|
-
|
|
630
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
631
|
-
context = context.to_java unless context.nil?
|
|
632
|
-
res = @real_java_api.get_payments(offset, limit, withPluginInfo, properties, context)
|
|
633
|
-
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
634
|
-
res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
|
|
635
|
-
return res
|
|
636
|
-
end
|
|
637
|
-
|
|
638
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPayments(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
639
|
-
def search_payments(searchKey, offset, limit, withPluginInfo, properties, context)
|
|
640
|
-
|
|
641
|
-
# conversion for searchKey [type = java.lang.String]
|
|
642
|
-
searchKey = searchKey.to_s unless searchKey.nil?
|
|
643
|
-
|
|
644
|
-
# conversion for offset [type = java.lang.Long]
|
|
645
|
-
offset = offset
|
|
646
|
-
|
|
647
|
-
# conversion for limit [type = java.lang.Long]
|
|
648
|
-
limit = limit
|
|
649
|
-
|
|
650
|
-
# conversion for withPluginInfo [type = boolean]
|
|
651
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
652
|
-
|
|
653
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
654
|
-
tmp = java.util.ArrayList.new
|
|
655
|
-
(properties || []).each do |m|
|
|
656
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
657
|
-
m = m.to_java unless m.nil?
|
|
658
|
-
tmp.add(m)
|
|
659
|
-
end
|
|
660
|
-
properties = tmp
|
|
661
|
-
|
|
662
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
663
|
-
context = context.to_java unless context.nil?
|
|
664
|
-
res = @real_java_api.search_payments(searchKey, offset, limit, withPluginInfo, properties, context)
|
|
665
|
-
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
666
|
-
res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
|
|
667
|
-
return res
|
|
668
|
-
end
|
|
669
|
-
|
|
670
|
-
java_signature 'Java::java.util.UUID addPaymentMethod(Java::org.killbill.billing.account.api.Account, Java::java.lang.String, Java::java.lang.String, Java::boolean, Java::org.killbill.billing.payment.api.PaymentMethodPlugin, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
671
|
-
def add_payment_method(account, paymentMethodExternalKey, pluginName, setDefault, paymentMethodInfo, properties, context)
|
|
672
|
-
|
|
673
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
674
|
-
account = account.to_java unless account.nil?
|
|
675
|
-
|
|
676
|
-
# conversion for paymentMethodExternalKey [type = java.lang.String]
|
|
677
|
-
paymentMethodExternalKey = paymentMethodExternalKey.to_s unless paymentMethodExternalKey.nil?
|
|
678
|
-
|
|
679
|
-
# conversion for pluginName [type = java.lang.String]
|
|
680
|
-
pluginName = pluginName.to_s unless pluginName.nil?
|
|
681
|
-
|
|
682
|
-
# conversion for setDefault [type = boolean]
|
|
683
|
-
setDefault = setDefault.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(setDefault)
|
|
684
|
-
|
|
685
|
-
# conversion for paymentMethodInfo [type = org.killbill.billing.payment.api.PaymentMethodPlugin]
|
|
686
|
-
paymentMethodInfo = paymentMethodInfo.to_java unless paymentMethodInfo.nil?
|
|
687
|
-
|
|
688
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
689
|
-
tmp = java.util.ArrayList.new
|
|
690
|
-
(properties || []).each do |m|
|
|
691
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
692
|
-
m = m.to_java unless m.nil?
|
|
693
|
-
tmp.add(m)
|
|
694
|
-
end
|
|
695
|
-
properties = tmp
|
|
696
|
-
|
|
697
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
698
|
-
context = context.to_java unless context.nil?
|
|
699
|
-
begin
|
|
700
|
-
res = @real_java_api.add_payment_method(account, paymentMethodExternalKey, pluginName, setDefault, paymentMethodInfo, properties, context)
|
|
701
|
-
# conversion for res [type = java.util.UUID]
|
|
702
|
-
res = res.nil? ? nil : res.to_s
|
|
703
|
-
return res
|
|
704
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
705
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
706
|
-
end
|
|
707
|
-
end
|
|
708
|
-
|
|
709
|
-
java_signature 'Java::java.util.List getAccountPaymentMethods(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
710
|
-
def get_account_payment_methods(accountId, withPluginInfo, properties, context)
|
|
711
|
-
|
|
712
|
-
# conversion for accountId [type = java.util.UUID]
|
|
713
|
-
accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
|
|
714
|
-
|
|
715
|
-
# conversion for withPluginInfo [type = boolean]
|
|
716
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
717
|
-
|
|
718
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
719
|
-
tmp = java.util.ArrayList.new
|
|
720
|
-
(properties || []).each do |m|
|
|
721
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
722
|
-
m = m.to_java unless m.nil?
|
|
723
|
-
tmp.add(m)
|
|
724
|
-
end
|
|
725
|
-
properties = tmp
|
|
726
|
-
|
|
727
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
728
|
-
context = context.to_java unless context.nil?
|
|
729
|
-
begin
|
|
730
|
-
res = @real_java_api.get_account_payment_methods(accountId, withPluginInfo, properties, context)
|
|
731
|
-
# conversion for res [type = java.util.List]
|
|
732
|
-
tmp = []
|
|
733
|
-
(res || []).each do |m|
|
|
734
|
-
# conversion for m [type = org.killbill.billing.payment.api.PaymentMethod]
|
|
735
|
-
m = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(m) unless m.nil?
|
|
736
|
-
tmp << m
|
|
737
|
-
end
|
|
738
|
-
res = tmp
|
|
739
|
-
return res
|
|
740
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
741
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
742
|
-
end
|
|
743
|
-
end
|
|
744
|
-
|
|
745
|
-
java_signature 'Java::org.killbill.billing.payment.api.PaymentMethod getPaymentMethodById(Java::java.util.UUID, Java::boolean, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
746
|
-
def get_payment_method_by_id(paymentMethodId, includedInactive, withPluginInfo, properties, context)
|
|
747
|
-
|
|
748
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
749
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
750
|
-
|
|
751
|
-
# conversion for includedInactive [type = boolean]
|
|
752
|
-
includedInactive = includedInactive.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includedInactive)
|
|
753
|
-
|
|
754
|
-
# conversion for withPluginInfo [type = boolean]
|
|
755
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
756
|
-
|
|
757
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
758
|
-
tmp = java.util.ArrayList.new
|
|
759
|
-
(properties || []).each do |m|
|
|
760
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
761
|
-
m = m.to_java unless m.nil?
|
|
762
|
-
tmp.add(m)
|
|
763
|
-
end
|
|
764
|
-
properties = tmp
|
|
765
|
-
|
|
766
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
767
|
-
context = context.to_java unless context.nil?
|
|
768
|
-
begin
|
|
769
|
-
res = @real_java_api.get_payment_method_by_id(paymentMethodId, includedInactive, withPluginInfo, properties, context)
|
|
770
|
-
# conversion for res [type = org.killbill.billing.payment.api.PaymentMethod]
|
|
771
|
-
res = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(res) unless res.nil?
|
|
772
|
-
return res
|
|
773
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
774
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
775
|
-
end
|
|
776
|
-
end
|
|
777
|
-
|
|
778
|
-
java_signature 'Java::org.killbill.billing.payment.api.PaymentMethod getPaymentMethodByExternalKey(Java::java.lang.String, Java::boolean, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
779
|
-
def get_payment_method_by_external_key(paymentMethodExternalKey, includedInactive, withPluginInfo, properties, context)
|
|
780
|
-
|
|
781
|
-
# conversion for paymentMethodExternalKey [type = java.lang.String]
|
|
782
|
-
paymentMethodExternalKey = paymentMethodExternalKey.to_s unless paymentMethodExternalKey.nil?
|
|
783
|
-
|
|
784
|
-
# conversion for includedInactive [type = boolean]
|
|
785
|
-
includedInactive = includedInactive.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includedInactive)
|
|
786
|
-
|
|
787
|
-
# conversion for withPluginInfo [type = boolean]
|
|
788
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
789
|
-
|
|
790
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
791
|
-
tmp = java.util.ArrayList.new
|
|
792
|
-
(properties || []).each do |m|
|
|
793
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
794
|
-
m = m.to_java unless m.nil?
|
|
795
|
-
tmp.add(m)
|
|
796
|
-
end
|
|
797
|
-
properties = tmp
|
|
798
|
-
|
|
799
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
800
|
-
context = context.to_java unless context.nil?
|
|
801
|
-
begin
|
|
802
|
-
res = @real_java_api.get_payment_method_by_external_key(paymentMethodExternalKey, includedInactive, withPluginInfo, properties, context)
|
|
803
|
-
# conversion for res [type = org.killbill.billing.payment.api.PaymentMethod]
|
|
804
|
-
res = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(res) unless res.nil?
|
|
805
|
-
return res
|
|
806
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
807
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
808
|
-
end
|
|
809
|
-
end
|
|
810
|
-
|
|
811
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination getPaymentMethods(Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
812
|
-
def get_payment_methods(offset, limit, withPluginInfo, properties, context)
|
|
813
|
-
|
|
814
|
-
# conversion for offset [type = java.lang.Long]
|
|
815
|
-
offset = offset
|
|
816
|
-
|
|
817
|
-
# conversion for limit [type = java.lang.Long]
|
|
818
|
-
limit = limit
|
|
819
|
-
|
|
820
|
-
# conversion for withPluginInfo [type = boolean]
|
|
821
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
822
|
-
|
|
823
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
824
|
-
tmp = java.util.ArrayList.new
|
|
825
|
-
(properties || []).each do |m|
|
|
826
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
827
|
-
m = m.to_java unless m.nil?
|
|
828
|
-
tmp.add(m)
|
|
829
|
-
end
|
|
830
|
-
properties = tmp
|
|
831
|
-
|
|
832
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
833
|
-
context = context.to_java unless context.nil?
|
|
834
|
-
res = @real_java_api.get_payment_methods(offset, limit, withPluginInfo, properties, context)
|
|
835
|
-
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
836
|
-
res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
|
|
837
|
-
return res
|
|
838
|
-
end
|
|
839
|
-
|
|
840
|
-
java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPaymentMethods(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
|
841
|
-
def search_payment_methods(searchKey, offset, limit, withPluginInfo, properties, context)
|
|
842
|
-
|
|
843
|
-
# conversion for searchKey [type = java.lang.String]
|
|
844
|
-
searchKey = searchKey.to_s unless searchKey.nil?
|
|
845
|
-
|
|
846
|
-
# conversion for offset [type = java.lang.Long]
|
|
847
|
-
offset = offset
|
|
848
|
-
|
|
849
|
-
# conversion for limit [type = java.lang.Long]
|
|
850
|
-
limit = limit
|
|
851
|
-
|
|
852
|
-
# conversion for withPluginInfo [type = boolean]
|
|
853
|
-
withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
|
|
854
|
-
|
|
855
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
856
|
-
tmp = java.util.ArrayList.new
|
|
857
|
-
(properties || []).each do |m|
|
|
858
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
859
|
-
m = m.to_java unless m.nil?
|
|
860
|
-
tmp.add(m)
|
|
861
|
-
end
|
|
862
|
-
properties = tmp
|
|
863
|
-
|
|
864
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
|
865
|
-
context = context.to_java unless context.nil?
|
|
866
|
-
res = @real_java_api.search_payment_methods(searchKey, offset, limit, withPluginInfo, properties, context)
|
|
867
|
-
# conversion for res [type = org.killbill.billing.util.entity.Pagination]
|
|
868
|
-
res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
|
|
869
|
-
return res
|
|
870
|
-
end
|
|
871
|
-
|
|
872
|
-
java_signature 'Java::void deletePaymentMethod(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
873
|
-
def delete_payment_method(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, properties, context)
|
|
874
|
-
|
|
875
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
876
|
-
account = account.to_java unless account.nil?
|
|
877
|
-
|
|
878
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
879
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
880
|
-
|
|
881
|
-
# conversion for deleteDefaultPaymentMethodWithAutoPayOff [type = boolean]
|
|
882
|
-
deleteDefaultPaymentMethodWithAutoPayOff = deleteDefaultPaymentMethodWithAutoPayOff.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(deleteDefaultPaymentMethodWithAutoPayOff)
|
|
883
|
-
|
|
884
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
885
|
-
tmp = java.util.ArrayList.new
|
|
886
|
-
(properties || []).each do |m|
|
|
887
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
888
|
-
m = m.to_java unless m.nil?
|
|
889
|
-
tmp.add(m)
|
|
890
|
-
end
|
|
891
|
-
properties = tmp
|
|
892
|
-
|
|
893
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
894
|
-
context = context.to_java unless context.nil?
|
|
895
|
-
@real_java_api.delete_payment_method(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, properties, context)
|
|
896
|
-
end
|
|
897
|
-
|
|
898
|
-
java_signature 'Java::void setDefaultPaymentMethod(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
899
|
-
def set_default_payment_method(account, paymentMethodId, properties, context)
|
|
900
|
-
|
|
901
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
902
|
-
account = account.to_java unless account.nil?
|
|
903
|
-
|
|
904
|
-
# conversion for paymentMethodId [type = java.util.UUID]
|
|
905
|
-
paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
|
|
906
|
-
|
|
907
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
908
|
-
tmp = java.util.ArrayList.new
|
|
909
|
-
(properties || []).each do |m|
|
|
910
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
911
|
-
m = m.to_java unless m.nil?
|
|
912
|
-
tmp.add(m)
|
|
913
|
-
end
|
|
914
|
-
properties = tmp
|
|
915
|
-
|
|
916
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
917
|
-
context = context.to_java unless context.nil?
|
|
918
|
-
@real_java_api.set_default_payment_method(account, paymentMethodId, properties, context)
|
|
919
|
-
end
|
|
920
|
-
|
|
921
|
-
java_signature 'Java::java.util.List refreshPaymentMethods(Java::org.killbill.billing.account.api.Account, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
|
|
922
|
-
def refresh_payment_methods(account, pluginName, properties, context)
|
|
923
|
-
|
|
924
|
-
# conversion for account [type = org.killbill.billing.account.api.Account]
|
|
925
|
-
account = account.to_java unless account.nil?
|
|
926
|
-
|
|
927
|
-
# conversion for pluginName [type = java.lang.String]
|
|
928
|
-
pluginName = pluginName.to_s unless pluginName.nil?
|
|
929
|
-
|
|
930
|
-
# conversion for properties [type = java.lang.Iterable]
|
|
931
|
-
tmp = java.util.ArrayList.new
|
|
932
|
-
(properties || []).each do |m|
|
|
933
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
|
934
|
-
m = m.to_java unless m.nil?
|
|
935
|
-
tmp.add(m)
|
|
936
|
-
end
|
|
937
|
-
properties = tmp
|
|
938
|
-
|
|
939
|
-
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
|
940
|
-
context = context.to_java unless context.nil?
|
|
941
|
-
begin
|
|
942
|
-
res = @real_java_api.refresh_payment_methods(account, pluginName, properties, context)
|
|
943
|
-
# conversion for res [type = java.util.List]
|
|
944
|
-
tmp = []
|
|
945
|
-
(res || []).each do |m|
|
|
946
|
-
# conversion for m [type = org.killbill.billing.payment.api.PaymentMethod]
|
|
947
|
-
m = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(m) unless m.nil?
|
|
948
|
-
tmp << m
|
|
949
|
-
end
|
|
950
|
-
res = tmp
|
|
951
|
-
return res
|
|
952
|
-
rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
|
|
953
|
-
raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
|
|
954
|
-
end
|
|
955
|
-
end
|
|
956
|
-
end
|
|
957
|
-
end
|
|
958
|
-
end
|
|
959
|
-
end
|