killbill 8.3.6 → 9.2.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/.travis.yml +51 -0
- data/Gemfile.lock +4 -4
- data/Jarfile +11 -11
- data/Jarfile.lock +63 -57
- data/NEWS +2 -8
- data/README.md +1 -0
- data/gen_config/api.conf +2 -0
- data/lib/killbill/gen/api/account.rb +20 -20
- data/lib/killbill/gen/api/account_data.rb +15 -1
- data/lib/killbill/gen/api/block_price_override.rb +81 -0
- data/lib/killbill/gen/api/call_context.rb +8 -1
- data/lib/killbill/gen/api/catalog_entity.rb +7 -1
- data/lib/killbill/gen/api/catalog_user_api.rb +8 -0
- data/lib/killbill/gen/api/custom_field_user_api.rb +17 -0
- data/lib/killbill/gen/api/email_notification.rb +75 -0
- data/lib/killbill/gen/api/entitlement_api.rb +12 -6
- data/lib/killbill/gen/api/immutable_account_data.rb +1 -20
- data/lib/killbill/gen/api/invoice.rb +15 -1
- data/lib/killbill/gen/api/invoice_formatter.rb +15 -1
- data/lib/killbill/gen/api/invoice_item.rb +19 -1
- data/lib/killbill/gen/api/invoice_item_formatter.rb +19 -1
- data/lib/killbill/gen/api/migration_plan.rb +14 -1
- data/lib/killbill/gen/api/mutable_account_data.rb +15 -1
- data/lib/killbill/gen/api/mutable_static_catalog.rb +1 -8
- data/lib/killbill/gen/api/osgi_killbill.rb +8 -1
- data/lib/killbill/gen/api/overdue_api.rb +88 -0
- data/lib/killbill/gen/api/overdue_api_exception.rb +68 -0
- data/lib/killbill/gen/api/overdue_condition.rb +108 -0
- data/lib/killbill/gen/api/overdue_config.rb +58 -0
- data/lib/killbill/gen/api/overdue_state.rb +120 -0
- data/lib/killbill/gen/api/overdue_states_account.rb +72 -0
- data/lib/killbill/gen/api/payment_api.rb +192 -51
- data/lib/killbill/gen/api/plan.rb +14 -1
- data/lib/killbill/gen/api/plan_phase.rb +7 -1
- data/lib/killbill/gen/api/plan_phase_price_override.rb +20 -1
- data/lib/killbill/gen/api/price_list.rb +7 -1
- data/lib/killbill/gen/api/product.rb +7 -1
- data/lib/killbill/gen/api/require_gen.rb +131 -121
- data/lib/killbill/gen/api/security_api.rb +20 -0
- data/lib/killbill/gen/api/static_catalog.rb +1 -8
- data/lib/killbill/gen/api/tag_user_api.rb +12 -3
- data/lib/killbill/gen/api/tenant_context.rb +8 -1
- data/lib/killbill/gen/api/tier_price_override.rb +70 -0
- data/lib/killbill/gen/api/tiered_block_price_override.rb +87 -0
- data/lib/killbill/gen/api/unit.rb +7 -1
- data/lib/killbill/gen/api/usage.rb +14 -1
- data/lib/killbill/gen/api/usage_price_override.rb +83 -0
- data/lib/killbill/gen/plugin-api/catalog_plugin_api.rb +34 -0
- data/lib/killbill/gen/plugin-api/entitlement_context.rb +8 -8
- data/lib/killbill/gen/plugin-api/ext_bus_event.rb +8 -1
- data/lib/killbill/gen/plugin-api/invoice_payment_metadata.rb +115 -0
- data/lib/killbill/gen/plugin-api/invoice_plugin_api_retry_exception.rb +64 -0
- data/lib/killbill/gen/plugin-api/notification_plugin_api_retry_exception.rb +64 -0
- data/lib/killbill/gen/plugin-api/payment_control_context.rb +14 -8
- data/lib/killbill/gen/plugin-api/prior_payment_control_result.rb +7 -1
- data/lib/killbill/gen/plugin-api/require_gen.rb +15 -12
- data/lib/killbill/gen/plugin-api/subscription_metadata.rb +8 -2
- data/lib/killbill/gen/plugin-api/versioned_plugin_catalog.rb +1 -8
- data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +6 -21
- data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +1 -1
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +12 -12
- data/lib/killbill/version.rb +1 -1
- data/spec/killbill/helpers/response_spec.rb +0 -7
- data/spec/killbill/helpers/test_response.rb +0 -4
- data/spec/killbill/killbillapi_spec.rb +1 -0
- metadata +17 -4
- data/.circleci/config.yml +0 -138
- data/lib/killbill/gen/api/refund.rb +0 -151
@@ -34,7 +34,7 @@ module Killbill
|
|
34
34
|
|
35
35
|
include org.killbill.billing.catalog.api.StaticCatalog
|
36
36
|
|
37
|
-
attr_accessor :catalog_name, :
|
37
|
+
attr_accessor :catalog_name, :effective_date, :current_supported_currencies, :current_products, :current_units, :current_plans, :available_base_plan_listings
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
@@ -43,9 +43,6 @@ module Killbill
|
|
43
43
|
# conversion for catalog_name [type = java.lang.String]
|
44
44
|
@catalog_name = @catalog_name.to_s unless @catalog_name.nil?
|
45
45
|
|
46
|
-
# conversion for recurring_billing_mode [type = org.killbill.billing.catalog.api.BillingMode]
|
47
|
-
@recurring_billing_mode = Java::org.killbill.billing.catalog.api.BillingMode.value_of( @recurring_billing_mode.to_s ) unless @recurring_billing_mode.nil?
|
48
|
-
|
49
46
|
# conversion for effective_date [type = java.util.Date]
|
50
47
|
if !@effective_date.nil?
|
51
48
|
@effective_date = (@effective_date.kind_of? Time) ? DateTime.parse(@effective_date.to_s) : @effective_date
|
@@ -104,10 +101,6 @@ module Killbill
|
|
104
101
|
# conversion for catalog_name [type = java.lang.String]
|
105
102
|
@catalog_name = j_obj.catalog_name
|
106
103
|
|
107
|
-
# conversion for recurring_billing_mode [type = org.killbill.billing.catalog.api.BillingMode]
|
108
|
-
@recurring_billing_mode = j_obj.recurring_billing_mode
|
109
|
-
@recurring_billing_mode = @recurring_billing_mode.to_s.to_sym unless @recurring_billing_mode.nil?
|
110
|
-
|
111
104
|
# conversion for effective_date [type = java.util.Date]
|
112
105
|
@effective_date = j_obj.effective_date
|
113
106
|
if !@effective_date.nil?
|
@@ -56,8 +56,8 @@ module Killbill
|
|
56
56
|
return res
|
57
57
|
end
|
58
58
|
|
59
|
-
java_signature 'Java::org.killbill.billing.util.tag.TagDefinition createTagDefinition(Java::java.lang.String, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.CallContext)'
|
60
|
-
def create_tag_definition(definitionName, description, context)
|
59
|
+
java_signature 'Java::org.killbill.billing.util.tag.TagDefinition createTagDefinition(Java::java.lang.String, Java::java.lang.String, Java::java.util.Set, Java::org.killbill.billing.util.callcontext.CallContext)'
|
60
|
+
def create_tag_definition(definitionName, description, applicableObjectTypes, context)
|
61
61
|
|
62
62
|
# conversion for definitionName [type = java.lang.String]
|
63
63
|
definitionName = definitionName.to_s unless definitionName.nil?
|
@@ -65,10 +65,19 @@ module Killbill
|
|
65
65
|
# conversion for description [type = java.lang.String]
|
66
66
|
description = description.to_s unless description.nil?
|
67
67
|
|
68
|
+
# conversion for applicableObjectTypes [type = java.util.Set]
|
69
|
+
tmp = java.util.TreeSet.new
|
70
|
+
(applicableObjectTypes || []).each do |m|
|
71
|
+
# conversion for m [type = org.killbill.billing.ObjectType]
|
72
|
+
m = Java::org.killbill.billing.ObjectType.value_of( m.to_s ) unless m.nil?
|
73
|
+
tmp.add(m)
|
74
|
+
end
|
75
|
+
applicableObjectTypes = tmp
|
76
|
+
|
68
77
|
# conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
|
69
78
|
context = context.to_java unless context.nil?
|
70
79
|
begin
|
71
|
-
res = @real_java_api.create_tag_definition(definitionName, description, context)
|
80
|
+
res = @real_java_api.create_tag_definition(definitionName, description, applicableObjectTypes, context)
|
72
81
|
# conversion for res [type = org.killbill.billing.util.tag.TagDefinition]
|
73
82
|
res = Killbill::Plugin::Model::TagDefinition.new.to_ruby(res) unless res.nil?
|
74
83
|
return res
|
@@ -34,18 +34,25 @@ module Killbill
|
|
34
34
|
|
35
35
|
include org.killbill.billing.util.callcontext.TenantContext
|
36
36
|
|
37
|
-
attr_accessor :tenant_id
|
37
|
+
attr_accessor :account_id, :tenant_id
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
41
41
|
|
42
42
|
def to_java()
|
43
|
+
# conversion for account_id [type = java.util.UUID]
|
44
|
+
@account_id = java.util.UUID.fromString(@account_id.to_s) unless @account_id.nil?
|
45
|
+
|
43
46
|
# conversion for tenant_id [type = java.util.UUID]
|
44
47
|
@tenant_id = java.util.UUID.fromString(@tenant_id.to_s) unless @tenant_id.nil?
|
45
48
|
self
|
46
49
|
end
|
47
50
|
|
48
51
|
def to_ruby(j_obj)
|
52
|
+
# conversion for account_id [type = java.util.UUID]
|
53
|
+
@account_id = j_obj.account_id
|
54
|
+
@account_id = @account_id.nil? ? nil : @account_id.to_s
|
55
|
+
|
49
56
|
# conversion for tenant_id [type = java.util.UUID]
|
50
57
|
@tenant_id = j_obj.tenant_id
|
51
58
|
@tenant_id = @tenant_id.nil? ? nil : @tenant_id.to_s
|
@@ -0,0 +1,70 @@
|
|
1
|
+
#############################################################################################
|
2
|
+
# #
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 Groupon, Inc. #
|
5
|
+
# Copyright 2014 The Billing Project, LLC #
|
6
|
+
# #
|
7
|
+
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
+
# (the "License"); you may not use this file except in compliance with the #
|
9
|
+
# License. You may obtain a copy of the License at: #
|
10
|
+
# #
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
+
# #
|
13
|
+
# Unless required by applicable law or agreed to in writing, software #
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
+
# License for the specific language governing permissions and limitations #
|
17
|
+
# under the License. #
|
18
|
+
# #
|
19
|
+
#############################################################################################
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# DO NOT EDIT!!!
|
24
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
module Killbill
|
29
|
+
module Plugin
|
30
|
+
module Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.catalog.api'
|
33
|
+
class TierPriceOverride
|
34
|
+
|
35
|
+
include org.killbill.billing.catalog.api.TierPriceOverride
|
36
|
+
|
37
|
+
attr_accessor :tiered_block_price_overrides
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for tiered_block_price_overrides [type = java.util.List]
|
44
|
+
tmp = java.util.ArrayList.new
|
45
|
+
(@tiered_block_price_overrides || []).each do |m|
|
46
|
+
# conversion for m [type = org.killbill.billing.catalog.api.TieredBlockPriceOverride]
|
47
|
+
m = m.to_java unless m.nil?
|
48
|
+
tmp.add(m)
|
49
|
+
end
|
50
|
+
@tiered_block_price_overrides = tmp
|
51
|
+
self
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_ruby(j_obj)
|
55
|
+
# conversion for tiered_block_price_overrides [type = java.util.List]
|
56
|
+
@tiered_block_price_overrides = j_obj.tiered_block_price_overrides
|
57
|
+
tmp = []
|
58
|
+
(@tiered_block_price_overrides || []).each do |m|
|
59
|
+
# conversion for m [type = org.killbill.billing.catalog.api.TieredBlockPriceOverride]
|
60
|
+
m = Killbill::Plugin::Model::TieredBlockPriceOverride.new.to_ruby(m) unless m.nil?
|
61
|
+
tmp << m
|
62
|
+
end
|
63
|
+
@tiered_block_price_overrides = tmp
|
64
|
+
self
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
#############################################################################################
|
2
|
+
# #
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 Groupon, Inc. #
|
5
|
+
# Copyright 2014 The Billing Project, LLC #
|
6
|
+
# #
|
7
|
+
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
+
# (the "License"); you may not use this file except in compliance with the #
|
9
|
+
# License. You may obtain a copy of the License at: #
|
10
|
+
# #
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
+
# #
|
13
|
+
# Unless required by applicable law or agreed to in writing, software #
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
+
# License for the specific language governing permissions and limitations #
|
17
|
+
# under the License. #
|
18
|
+
# #
|
19
|
+
#############################################################################################
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# DO NOT EDIT!!!
|
24
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
module Killbill
|
29
|
+
module Plugin
|
30
|
+
module Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.catalog.api'
|
33
|
+
class TieredBlockPriceOverride
|
34
|
+
|
35
|
+
include org.killbill.billing.catalog.api.TieredBlockPriceOverride
|
36
|
+
|
37
|
+
attr_accessor :unit_name, :size, :price, :currency, :max
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for unit_name [type = java.lang.String]
|
44
|
+
@unit_name = @unit_name.to_s unless @unit_name.nil?
|
45
|
+
|
46
|
+
# conversion for size [type = java.lang.Double]
|
47
|
+
@size = @size
|
48
|
+
|
49
|
+
# conversion for price [type = java.math.BigDecimal]
|
50
|
+
if @price.nil?
|
51
|
+
@price = java.math.BigDecimal::ZERO
|
52
|
+
else
|
53
|
+
@price = java.math.BigDecimal.new(@price.to_s)
|
54
|
+
end
|
55
|
+
|
56
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
57
|
+
@currency = Java::org.killbill.billing.catalog.api.Currency.value_of( @currency.to_s ) unless @currency.nil?
|
58
|
+
|
59
|
+
# conversion for max [type = java.lang.Double]
|
60
|
+
@max = @max
|
61
|
+
self
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_ruby(j_obj)
|
65
|
+
# conversion for unit_name [type = java.lang.String]
|
66
|
+
@unit_name = j_obj.unit_name
|
67
|
+
|
68
|
+
# conversion for size [type = java.lang.Double]
|
69
|
+
@size = j_obj.size
|
70
|
+
|
71
|
+
# conversion for price [type = java.math.BigDecimal]
|
72
|
+
@price = j_obj.price
|
73
|
+
@price = @price.nil? ? 0 : BigDecimal.new(@price.to_s)
|
74
|
+
|
75
|
+
# conversion for currency [type = org.killbill.billing.catalog.api.Currency]
|
76
|
+
@currency = j_obj.currency
|
77
|
+
@currency = @currency.to_s.to_sym unless @currency.nil?
|
78
|
+
|
79
|
+
# conversion for max [type = java.lang.Double]
|
80
|
+
@max = j_obj.max
|
81
|
+
self
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -34,7 +34,7 @@ module Killbill
|
|
34
34
|
|
35
35
|
include org.killbill.billing.catalog.api.Unit
|
36
36
|
|
37
|
-
attr_accessor :name
|
37
|
+
attr_accessor :name, :pretty_name
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
@@ -42,12 +42,18 @@ module Killbill
|
|
42
42
|
def to_java()
|
43
43
|
# conversion for name [type = java.lang.String]
|
44
44
|
@name = @name.to_s unless @name.nil?
|
45
|
+
|
46
|
+
# conversion for pretty_name [type = java.lang.String]
|
47
|
+
@pretty_name = @pretty_name.to_s unless @pretty_name.nil?
|
45
48
|
self
|
46
49
|
end
|
47
50
|
|
48
51
|
def to_ruby(j_obj)
|
49
52
|
# conversion for name [type = java.lang.String]
|
50
53
|
@name = j_obj.name
|
54
|
+
|
55
|
+
# conversion for pretty_name [type = java.lang.String]
|
56
|
+
@pretty_name = j_obj.pretty_name
|
51
57
|
self
|
52
58
|
end
|
53
59
|
|
@@ -34,7 +34,7 @@ module Killbill
|
|
34
34
|
|
35
35
|
include org.killbill.billing.catalog.api.Usage
|
36
36
|
|
37
|
-
attr_accessor :name, :billing_mode, :usage_type, :billing_period, :limits, :tiers, :blocks, :fixed_price, :recurring_price
|
37
|
+
attr_accessor :name, :pretty_name, :billing_mode, :usage_type, :tier_block_policy, :billing_period, :limits, :tiers, :blocks, :fixed_price, :recurring_price
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
@@ -43,12 +43,18 @@ module Killbill
|
|
43
43
|
# conversion for name [type = java.lang.String]
|
44
44
|
@name = @name.to_s unless @name.nil?
|
45
45
|
|
46
|
+
# conversion for pretty_name [type = java.lang.String]
|
47
|
+
@pretty_name = @pretty_name.to_s unless @pretty_name.nil?
|
48
|
+
|
46
49
|
# conversion for billing_mode [type = org.killbill.billing.catalog.api.BillingMode]
|
47
50
|
@billing_mode = Java::org.killbill.billing.catalog.api.BillingMode.value_of( @billing_mode.to_s ) unless @billing_mode.nil?
|
48
51
|
|
49
52
|
# conversion for usage_type [type = org.killbill.billing.catalog.api.UsageType]
|
50
53
|
@usage_type = Java::org.killbill.billing.catalog.api.UsageType.value_of( @usage_type.to_s ) unless @usage_type.nil?
|
51
54
|
|
55
|
+
# conversion for tier_block_policy [type = org.killbill.billing.catalog.api.TierBlockPolicy]
|
56
|
+
@tier_block_policy = Java::org.killbill.billing.catalog.api.TierBlockPolicy.value_of( @tier_block_policy.to_s ) unless @tier_block_policy.nil?
|
57
|
+
|
52
58
|
# conversion for billing_period [type = org.killbill.billing.catalog.api.BillingPeriod]
|
53
59
|
@billing_period = Java::org.killbill.billing.catalog.api.BillingPeriod.value_of( @billing_period.to_s ) unless @billing_period.nil?
|
54
60
|
|
@@ -91,6 +97,9 @@ module Killbill
|
|
91
97
|
# conversion for name [type = java.lang.String]
|
92
98
|
@name = j_obj.name
|
93
99
|
|
100
|
+
# conversion for pretty_name [type = java.lang.String]
|
101
|
+
@pretty_name = j_obj.pretty_name
|
102
|
+
|
94
103
|
# conversion for billing_mode [type = org.killbill.billing.catalog.api.BillingMode]
|
95
104
|
@billing_mode = j_obj.billing_mode
|
96
105
|
@billing_mode = @billing_mode.to_s.to_sym unless @billing_mode.nil?
|
@@ -99,6 +108,10 @@ module Killbill
|
|
99
108
|
@usage_type = j_obj.usage_type
|
100
109
|
@usage_type = @usage_type.to_s.to_sym unless @usage_type.nil?
|
101
110
|
|
111
|
+
# conversion for tier_block_policy [type = org.killbill.billing.catalog.api.TierBlockPolicy]
|
112
|
+
@tier_block_policy = j_obj.tier_block_policy
|
113
|
+
@tier_block_policy = @tier_block_policy.to_s.to_sym unless @tier_block_policy.nil?
|
114
|
+
|
102
115
|
# conversion for billing_period [type = org.killbill.billing.catalog.api.BillingPeriod]
|
103
116
|
@billing_period = j_obj.billing_period
|
104
117
|
@billing_period = @billing_period.to_s.to_sym unless @billing_period.nil?
|
@@ -0,0 +1,83 @@
|
|
1
|
+
#############################################################################################
|
2
|
+
# #
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 Groupon, Inc. #
|
5
|
+
# Copyright 2014 The Billing Project, LLC #
|
6
|
+
# #
|
7
|
+
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
+
# (the "License"); you may not use this file except in compliance with the #
|
9
|
+
# License. You may obtain a copy of the License at: #
|
10
|
+
# #
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
+
# #
|
13
|
+
# Unless required by applicable law or agreed to in writing, software #
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
+
# License for the specific language governing permissions and limitations #
|
17
|
+
# under the License. #
|
18
|
+
# #
|
19
|
+
#############################################################################################
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# DO NOT EDIT!!!
|
24
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
module Killbill
|
29
|
+
module Plugin
|
30
|
+
module Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.catalog.api'
|
33
|
+
class UsagePriceOverride
|
34
|
+
|
35
|
+
include org.killbill.billing.catalog.api.UsagePriceOverride
|
36
|
+
|
37
|
+
attr_accessor :name, :usage_type, :tier_price_overrides
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for name [type = java.lang.String]
|
44
|
+
@name = @name.to_s unless @name.nil?
|
45
|
+
|
46
|
+
# conversion for usage_type [type = org.killbill.billing.catalog.api.UsageType]
|
47
|
+
@usage_type = Java::org.killbill.billing.catalog.api.UsageType.value_of( @usage_type.to_s ) unless @usage_type.nil?
|
48
|
+
|
49
|
+
# conversion for tier_price_overrides [type = java.util.List]
|
50
|
+
tmp = java.util.ArrayList.new
|
51
|
+
(@tier_price_overrides || []).each do |m|
|
52
|
+
# conversion for m [type = org.killbill.billing.catalog.api.TierPriceOverride]
|
53
|
+
m = m.to_java unless m.nil?
|
54
|
+
tmp.add(m)
|
55
|
+
end
|
56
|
+
@tier_price_overrides = tmp
|
57
|
+
self
|
58
|
+
end
|
59
|
+
|
60
|
+
def to_ruby(j_obj)
|
61
|
+
# conversion for name [type = java.lang.String]
|
62
|
+
@name = j_obj.name
|
63
|
+
|
64
|
+
# conversion for usage_type [type = org.killbill.billing.catalog.api.UsageType]
|
65
|
+
@usage_type = j_obj.usage_type
|
66
|
+
@usage_type = @usage_type.to_s.to_sym unless @usage_type.nil?
|
67
|
+
|
68
|
+
# conversion for tier_price_overrides [type = java.util.List]
|
69
|
+
@tier_price_overrides = j_obj.tier_price_overrides
|
70
|
+
tmp = []
|
71
|
+
(@tier_price_overrides || []).each do |m|
|
72
|
+
# conversion for m [type = org.killbill.billing.catalog.api.TierPriceOverride]
|
73
|
+
m = Killbill::Plugin::Model::TierPriceOverride.new.to_ruby(m) unless m.nil?
|
74
|
+
tmp << m
|
75
|
+
end
|
76
|
+
@tier_price_overrides = tmp
|
77
|
+
self
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -40,6 +40,40 @@ module Killbill
|
|
40
40
|
end
|
41
41
|
|
42
42
|
|
43
|
+
java_signature 'Java::org.joda.time.DateTime getLatestCatalogVersion(Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
44
|
+
def get_latest_catalog_version(properties, context)
|
45
|
+
|
46
|
+
# conversion for properties [type = java.lang.Iterable]
|
47
|
+
tmp = []
|
48
|
+
(properties.nil? ? [] : properties.iterator).each do |m|
|
49
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
50
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
51
|
+
tmp << m
|
52
|
+
end
|
53
|
+
properties = tmp
|
54
|
+
|
55
|
+
# conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
|
56
|
+
context = Killbill::Plugin::Model::TenantContext.new.to_ruby(context) unless context.nil?
|
57
|
+
begin
|
58
|
+
res = @delegate_plugin.get_latest_catalog_version(properties, context)
|
59
|
+
# conversion for res [type = org.joda.time.DateTime]
|
60
|
+
if !res.nil?
|
61
|
+
res = (res.kind_of? Time) ? DateTime.parse(res.to_s) : res
|
62
|
+
res = Java::org.joda.time.DateTime.new(res.to_s, Java::org.joda.time.DateTimeZone::UTC)
|
63
|
+
end
|
64
|
+
return res
|
65
|
+
rescue Exception => e
|
66
|
+
message = "Failure in get_latest_catalog_version: #{e}"
|
67
|
+
unless e.backtrace.nil?
|
68
|
+
message = "#{message}\n#{e.backtrace.join("\n")}"
|
69
|
+
end
|
70
|
+
logger.warn message
|
71
|
+
raise Java::org.killbill.billing.payment.plugin.api.PaymentPluginApiException.new("get_latest_catalog_version failure", e.message)
|
72
|
+
ensure
|
73
|
+
@delegate_plugin.after_request
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
43
77
|
java_signature 'Java::org.killbill.billing.catalog.plugin.api.VersionedPluginCatalog getVersionedPluginCatalog(Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
|
44
78
|
def get_versioned_plugin_catalog(properties, context)
|
45
79
|
|