killbill 4.4.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/Jarfile +8 -7
- data/Jarfile.lock +8 -7
- data/NEWS +4 -0
- data/gen_config/plugin_api.conf +4 -2
- data/generators/active_merchant/templates/Jarfile.rb +8 -7
- data/generators/active_merchant/templates/config.yml.rb +4 -1
- data/generators/active_merchant/templates/db/ddl.sql.rb +73 -73
- data/generators/active_merchant/templates/plugin.gemspec.rb +1 -0
- data/generators/active_merchant/templates/spec/integration_spec.rb +4 -3
- data/lib/killbill/entitlement.rb +23 -0
- data/lib/killbill/gen/api/entitlement_api.rb +72 -18
- data/lib/killbill/gen/plugin-api/control_result.rb +70 -0
- data/lib/killbill/gen/plugin-api/entitlement_context.rb +215 -0
- data/lib/killbill/gen/plugin-api/entitlement_plugin_api.rb +138 -0
- data/lib/killbill/gen/plugin-api/entitlement_plugin_api_exception.rb +51 -0
- data/lib/killbill/gen/plugin-api/{on_success_payment_routing_result.rb → on_failure_entitlement_result.rb} +3 -3
- data/lib/killbill/gen/plugin-api/{on_failure_payment_routing_result.rb → on_failure_payment_control_result.rb} +23 -4
- data/lib/killbill/gen/plugin-api/on_success_entitlement_result.rb +53 -0
- data/lib/killbill/gen/plugin-api/on_success_payment_control_result.rb +70 -0
- data/lib/killbill/gen/plugin-api/{payment_routing_api_exception.rb → payment_control_api_exception.rb} +2 -2
- data/lib/killbill/gen/plugin-api/{payment_routing_context.rb → payment_control_context.rb} +18 -23
- data/lib/killbill/gen/plugin-api/{payment_routing_plugin_api.rb → payment_control_plugin_api.rb} +15 -15
- data/lib/killbill/gen/plugin-api/prior_entitlement_result.rb +119 -0
- data/lib/killbill/gen/plugin-api/{prior_payment_routing_result.rb → prior_payment_control_result.rb} +21 -21
- data/lib/killbill/gen/plugin-api/require_gen.rb +13 -6
- data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +4 -5
- data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +15 -2
- data/lib/killbill/helpers/active_merchant/configuration.rb +1 -1
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +1 -1
- data/lib/killbill/killbill_logger.rb +2 -0
- data/lib/killbill/payment_control.rb +4 -4
- data/lib/killbill/version.rb +1 -1
- data/spec/killbill/helpers/payment_method_spec.rb +2 -2
- data/spec/killbill/helpers/payment_plugin_spec.rb +11 -0
- data/spec/killbill/helpers/response_spec.rb +2 -2
- data/spec/killbill/killbill_logger_spec.rb +2 -0
- metadata +17 -9
@@ -29,10 +29,10 @@ module Killbill
|
|
29
29
|
module Plugin
|
30
30
|
module Model
|
31
31
|
|
32
|
-
java_package 'org.killbill.billing.
|
33
|
-
class
|
32
|
+
java_package 'org.killbill.billing.entitlement.plugin.api'
|
33
|
+
class OnFailureEntitlementResult
|
34
34
|
|
35
|
-
include org.killbill.billing.
|
35
|
+
include org.killbill.billing.entitlement.plugin.api.OnFailureEntitlementResult
|
36
36
|
|
37
37
|
attr_accessor
|
38
38
|
|
@@ -29,17 +29,26 @@ module Killbill
|
|
29
29
|
module Plugin
|
30
30
|
module Model
|
31
31
|
|
32
|
-
java_package 'org.killbill.billing.
|
33
|
-
class
|
32
|
+
java_package 'org.killbill.billing.control.plugin.api'
|
33
|
+
class OnFailurePaymentControlResult
|
34
34
|
|
35
|
-
include org.killbill.billing.
|
35
|
+
include org.killbill.billing.control.plugin.api.OnFailurePaymentControlResult
|
36
36
|
|
37
|
-
attr_accessor :next_retry_date
|
37
|
+
attr_accessor :adjusted_plugin_properties, :next_retry_date
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
41
41
|
|
42
42
|
def to_java()
|
43
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
44
|
+
tmp = java.util.ArrayList.new
|
45
|
+
(@adjusted_plugin_properties || []).each do |m|
|
46
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
47
|
+
m = m.to_java unless m.nil?
|
48
|
+
tmp.add(m)
|
49
|
+
end
|
50
|
+
@adjusted_plugin_properties = tmp
|
51
|
+
|
43
52
|
# conversion for next_retry_date [type = org.joda.time.DateTime]
|
44
53
|
if !@next_retry_date.nil?
|
45
54
|
@next_retry_date = (@next_retry_date.kind_of? Time) ? DateTime.parse(@next_retry_date.to_s) : @next_retry_date
|
@@ -49,6 +58,16 @@ module Killbill
|
|
49
58
|
end
|
50
59
|
|
51
60
|
def to_ruby(j_obj)
|
61
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
62
|
+
@adjusted_plugin_properties = j_obj.adjusted_plugin_properties
|
63
|
+
tmp = []
|
64
|
+
(@adjusted_plugin_properties.nil? ? [] : @adjusted_plugin_properties.iterator).each do |m|
|
65
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
66
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
67
|
+
tmp << m
|
68
|
+
end
|
69
|
+
@adjusted_plugin_properties = tmp
|
70
|
+
|
52
71
|
# conversion for next_retry_date [type = org.joda.time.DateTime]
|
53
72
|
@next_retry_date = j_obj.next_retry_date
|
54
73
|
if !@next_retry_date.nil?
|
@@ -0,0 +1,53 @@
|
|
1
|
+
#############################################################################################
|
2
|
+
# #
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 Groupon, Inc. #
|
5
|
+
# Copyright 2014 The Billing Project, LLC #
|
6
|
+
# #
|
7
|
+
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
+
# (the "License"); you may not use this file except in compliance with the #
|
9
|
+
# License. You may obtain a copy of the License at: #
|
10
|
+
# #
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
+
# #
|
13
|
+
# Unless required by applicable law or agreed to in writing, software #
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
+
# License for the specific language governing permissions and limitations #
|
17
|
+
# under the License. #
|
18
|
+
# #
|
19
|
+
#############################################################################################
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# DO NOT EDIT!!!
|
24
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
module Killbill
|
29
|
+
module Plugin
|
30
|
+
module Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.entitlement.plugin.api'
|
33
|
+
class OnSuccessEntitlementResult
|
34
|
+
|
35
|
+
include org.killbill.billing.entitlement.plugin.api.OnSuccessEntitlementResult
|
36
|
+
|
37
|
+
attr_accessor
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_ruby(j_obj)
|
47
|
+
self
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
#############################################################################################
|
2
|
+
# #
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 Groupon, Inc. #
|
5
|
+
# Copyright 2014 The Billing Project, LLC #
|
6
|
+
# #
|
7
|
+
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
+
# (the "License"); you may not use this file except in compliance with the #
|
9
|
+
# License. You may obtain a copy of the License at: #
|
10
|
+
# #
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
+
# #
|
13
|
+
# Unless required by applicable law or agreed to in writing, software #
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
+
# License for the specific language governing permissions and limitations #
|
17
|
+
# under the License. #
|
18
|
+
# #
|
19
|
+
#############################################################################################
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# DO NOT EDIT!!!
|
24
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
module Killbill
|
29
|
+
module Plugin
|
30
|
+
module Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.control.plugin.api'
|
33
|
+
class OnSuccessPaymentControlResult
|
34
|
+
|
35
|
+
include org.killbill.billing.control.plugin.api.OnSuccessPaymentControlResult
|
36
|
+
|
37
|
+
attr_accessor :adjusted_plugin_properties
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
44
|
+
tmp = java.util.ArrayList.new
|
45
|
+
(@adjusted_plugin_properties || []).each do |m|
|
46
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
47
|
+
m = m.to_java unless m.nil?
|
48
|
+
tmp.add(m)
|
49
|
+
end
|
50
|
+
@adjusted_plugin_properties = tmp
|
51
|
+
self
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_ruby(j_obj)
|
55
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
56
|
+
@adjusted_plugin_properties = j_obj.adjusted_plugin_properties
|
57
|
+
tmp = []
|
58
|
+
(@adjusted_plugin_properties.nil? ? [] : @adjusted_plugin_properties.iterator).each do |m|
|
59
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
60
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
61
|
+
tmp << m
|
62
|
+
end
|
63
|
+
@adjusted_plugin_properties = tmp
|
64
|
+
self
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -29,7 +29,7 @@ module Killbill
|
|
29
29
|
module Plugin
|
30
30
|
module Model
|
31
31
|
|
32
|
-
class
|
32
|
+
class PaymentControlApiException
|
33
33
|
|
34
34
|
|
35
35
|
attr_accessor
|
@@ -38,7 +38,7 @@ module Killbill
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def to_java()
|
41
|
-
Java::org.killbill.billing.
|
41
|
+
Java::org.killbill.billing.control.plugin.api.PaymentControlApiException.new()
|
42
42
|
end
|
43
43
|
|
44
44
|
def to_ruby(j_obj)
|
@@ -29,12 +29,12 @@ module Killbill
|
|
29
29
|
module Plugin
|
30
30
|
module Model
|
31
31
|
|
32
|
-
java_package 'org.killbill.billing.
|
33
|
-
class
|
32
|
+
java_package 'org.killbill.billing.control.plugin.api'
|
33
|
+
class PaymentControlContext
|
34
34
|
|
35
|
-
include org.killbill.billing.
|
35
|
+
include org.killbill.billing.control.plugin.api.PaymentControlContext
|
36
36
|
|
37
|
-
attr_accessor :user_token, :user_name, :call_origin, :user_type, :reason_code, :comments, :created_date, :updated_date, :tenant_id, :account_id, :payment_id, :attempt_payment_id, :payment_external_key, :transaction_id, :transaction_external_key, :transaction_type, :amount, :currency, :payment_method_id, :processed_amount, :processed_currency, :is_api_payment
|
37
|
+
attr_accessor :user_token, :user_name, :call_origin, :user_type, :reason_code, :comments, :created_date, :updated_date, :tenant_id, :account_id, :payment_id, :attempt_payment_id, :payment_external_key, :transaction_id, :transaction_external_key, :payment_api_type, :transaction_type, :hpp_type, :amount, :currency, :payment_method_id, :processed_amount, :processed_currency, :is_api_payment
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
@@ -91,9 +91,15 @@ module Killbill
|
|
91
91
|
# conversion for transaction_external_key [type = java.lang.String]
|
92
92
|
@transaction_external_key = @transaction_external_key.to_s unless @transaction_external_key.nil?
|
93
93
|
|
94
|
+
# conversion for payment_api_type [type = org.killbill.billing.control.plugin.api.PaymentApiType]
|
95
|
+
@payment_api_type = Java::org.killbill.billing.control.plugin.api.PaymentApiType.value_of( @payment_api_type.to_s ) unless @payment_api_type.nil?
|
96
|
+
|
94
97
|
# conversion for transaction_type [type = org.killbill.billing.payment.api.TransactionType]
|
95
98
|
@transaction_type = Java::org.killbill.billing.payment.api.TransactionType.value_of( @transaction_type.to_s ) unless @transaction_type.nil?
|
96
99
|
|
100
|
+
# conversion for hpp_type [type = org.killbill.billing.control.plugin.api.HPPType]
|
101
|
+
@hpp_type = Java::org.killbill.billing.control.plugin.api.HPPType.value_of( @hpp_type.to_s ) unless @hpp_type.nil?
|
102
|
+
|
97
103
|
# conversion for amount [type = java.math.BigDecimal]
|
98
104
|
if @amount.nil?
|
99
105
|
@amount = java.math.BigDecimal::ZERO
|
@@ -119,15 +125,6 @@ module Killbill
|
|
119
125
|
|
120
126
|
# conversion for is_api_payment [type = boolean]
|
121
127
|
@is_api_payment = @is_api_payment.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_api_payment)
|
122
|
-
|
123
|
-
# conversion for plugin_properties [type = java.lang.Iterable]
|
124
|
-
tmp = java.util.ArrayList.new
|
125
|
-
(@plugin_properties || []).each do |m|
|
126
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
127
|
-
m = m.to_java unless m.nil?
|
128
|
-
tmp.add(m)
|
129
|
-
end
|
130
|
-
@plugin_properties = tmp
|
131
128
|
self
|
132
129
|
end
|
133
130
|
|
@@ -195,10 +192,18 @@ module Killbill
|
|
195
192
|
# conversion for transaction_external_key [type = java.lang.String]
|
196
193
|
@transaction_external_key = j_obj.transaction_external_key
|
197
194
|
|
195
|
+
# conversion for payment_api_type [type = org.killbill.billing.control.plugin.api.PaymentApiType]
|
196
|
+
@payment_api_type = j_obj.payment_api_type
|
197
|
+
@payment_api_type = @payment_api_type.to_s.to_sym unless @payment_api_type.nil?
|
198
|
+
|
198
199
|
# conversion for transaction_type [type = org.killbill.billing.payment.api.TransactionType]
|
199
200
|
@transaction_type = j_obj.transaction_type
|
200
201
|
@transaction_type = @transaction_type.to_s.to_sym unless @transaction_type.nil?
|
201
202
|
|
203
|
+
# conversion for hpp_type [type = org.killbill.billing.control.plugin.api.HPPType]
|
204
|
+
@hpp_type = j_obj.hpp_type
|
205
|
+
@hpp_type = @hpp_type.to_s.to_sym unless @hpp_type.nil?
|
206
|
+
|
202
207
|
# conversion for amount [type = java.math.BigDecimal]
|
203
208
|
@amount = j_obj.amount
|
204
209
|
@amount = @amount.nil? ? 0 : BigDecimal.new(@amount.to_s)
|
@@ -227,16 +232,6 @@ module Killbill
|
|
227
232
|
tmp_bool = (@is_api_payment.java_kind_of? java.lang.Boolean) ? @is_api_payment.boolean_value : @is_api_payment
|
228
233
|
@is_api_payment = tmp_bool ? true : false
|
229
234
|
end
|
230
|
-
|
231
|
-
# conversion for plugin_properties [type = java.lang.Iterable]
|
232
|
-
@plugin_properties = j_obj.plugin_properties
|
233
|
-
tmp = []
|
234
|
-
(@plugin_properties.nil? ? [] : @plugin_properties.iterator).each do |m|
|
235
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
236
|
-
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
237
|
-
tmp << m
|
238
|
-
end
|
239
|
-
@plugin_properties = tmp
|
240
235
|
self
|
241
236
|
end
|
242
237
|
|
data/lib/killbill/gen/plugin-api/{payment_routing_plugin_api.rb → payment_control_plugin_api.rb}
RENAMED
@@ -30,21 +30,21 @@ module Killbill
|
|
30
30
|
module Plugin
|
31
31
|
module Api
|
32
32
|
|
33
|
-
java_package 'org.killbill.billing.
|
34
|
-
class
|
33
|
+
java_package 'org.killbill.billing.control.plugin.api'
|
34
|
+
class PaymentControlPluginApi < NotificationPluginApi
|
35
35
|
|
36
|
-
include org.killbill.billing.
|
36
|
+
include org.killbill.billing.control.plugin.api.PaymentControlPluginApi
|
37
37
|
|
38
38
|
def initialize(real_class_name, services = {})
|
39
39
|
super(real_class_name, services)
|
40
40
|
end
|
41
41
|
|
42
42
|
|
43
|
-
java_signature 'Java::org.killbill.billing.
|
43
|
+
java_signature 'Java::org.killbill.billing.control.plugin.api.PriorPaymentControlResult priorCall(Java::org.killbill.billing.control.plugin.api.PaymentControlContext, Java::java.lang.Iterable)'
|
44
44
|
def prior_call(context, properties)
|
45
45
|
|
46
|
-
# conversion for context [type = org.killbill.billing.
|
47
|
-
context = Killbill::Plugin::Model::
|
46
|
+
# conversion for context [type = org.killbill.billing.control.plugin.api.PaymentControlContext]
|
47
|
+
context = Killbill::Plugin::Model::PaymentControlContext.new.to_ruby(context) unless context.nil?
|
48
48
|
|
49
49
|
# conversion for properties [type = java.lang.Iterable]
|
50
50
|
tmp = []
|
@@ -56,7 +56,7 @@ module Killbill
|
|
56
56
|
properties = tmp
|
57
57
|
begin
|
58
58
|
res = @delegate_plugin.prior_call(context, properties)
|
59
|
-
# conversion for res [type = org.killbill.billing.
|
59
|
+
# conversion for res [type = org.killbill.billing.control.plugin.api.PriorPaymentControlResult]
|
60
60
|
res = res.to_java unless res.nil?
|
61
61
|
return res
|
62
62
|
rescue Exception => e
|
@@ -71,11 +71,11 @@ module Killbill
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
java_signature 'Java::org.killbill.billing.
|
74
|
+
java_signature 'Java::org.killbill.billing.control.plugin.api.OnSuccessPaymentControlResult onSuccessCall(Java::org.killbill.billing.control.plugin.api.PaymentControlContext, Java::java.lang.Iterable)'
|
75
75
|
def on_success_call(context, properties)
|
76
76
|
|
77
|
-
# conversion for context [type = org.killbill.billing.
|
78
|
-
context = Killbill::Plugin::Model::
|
77
|
+
# conversion for context [type = org.killbill.billing.control.plugin.api.PaymentControlContext]
|
78
|
+
context = Killbill::Plugin::Model::PaymentControlContext.new.to_ruby(context) unless context.nil?
|
79
79
|
|
80
80
|
# conversion for properties [type = java.lang.Iterable]
|
81
81
|
tmp = []
|
@@ -87,7 +87,7 @@ module Killbill
|
|
87
87
|
properties = tmp
|
88
88
|
begin
|
89
89
|
res = @delegate_plugin.on_success_call(context, properties)
|
90
|
-
# conversion for res [type = org.killbill.billing.
|
90
|
+
# conversion for res [type = org.killbill.billing.control.plugin.api.OnSuccessPaymentControlResult]
|
91
91
|
res = res.to_java unless res.nil?
|
92
92
|
return res
|
93
93
|
rescue Exception => e
|
@@ -102,11 +102,11 @@ module Killbill
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
java_signature 'Java::org.killbill.billing.
|
105
|
+
java_signature 'Java::org.killbill.billing.control.plugin.api.OnFailurePaymentControlResult onFailureCall(Java::org.killbill.billing.control.plugin.api.PaymentControlContext, Java::java.lang.Iterable)'
|
106
106
|
def on_failure_call(context, properties)
|
107
107
|
|
108
|
-
# conversion for context [type = org.killbill.billing.
|
109
|
-
context = Killbill::Plugin::Model::
|
108
|
+
# conversion for context [type = org.killbill.billing.control.plugin.api.PaymentControlContext]
|
109
|
+
context = Killbill::Plugin::Model::PaymentControlContext.new.to_ruby(context) unless context.nil?
|
110
110
|
|
111
111
|
# conversion for properties [type = java.lang.Iterable]
|
112
112
|
tmp = []
|
@@ -118,7 +118,7 @@ module Killbill
|
|
118
118
|
properties = tmp
|
119
119
|
begin
|
120
120
|
res = @delegate_plugin.on_failure_call(context, properties)
|
121
|
-
# conversion for res [type = org.killbill.billing.
|
121
|
+
# conversion for res [type = org.killbill.billing.control.plugin.api.OnFailurePaymentControlResult]
|
122
122
|
res = res.to_java unless res.nil?
|
123
123
|
return res
|
124
124
|
rescue Exception => e
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#############################################################################################
|
2
|
+
# #
|
3
|
+
# Copyright 2010-2013 Ning, Inc. #
|
4
|
+
# Copyright 2014 Groupon, Inc. #
|
5
|
+
# Copyright 2014 The Billing Project, LLC #
|
6
|
+
# #
|
7
|
+
# The Billing Project licenses this file to you under the Apache License, version 2.0 #
|
8
|
+
# (the "License"); you may not use this file except in compliance with the #
|
9
|
+
# License. You may obtain a copy of the License at: #
|
10
|
+
# #
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
12
|
+
# #
|
13
|
+
# Unless required by applicable law or agreed to in writing, software #
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
15
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
16
|
+
# License for the specific language governing permissions and limitations #
|
17
|
+
# under the License. #
|
18
|
+
# #
|
19
|
+
#############################################################################################
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# DO NOT EDIT!!!
|
24
|
+
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
25
|
+
#
|
26
|
+
|
27
|
+
|
28
|
+
module Killbill
|
29
|
+
module Plugin
|
30
|
+
module Model
|
31
|
+
|
32
|
+
java_package 'org.killbill.billing.entitlement.plugin.api'
|
33
|
+
class PriorEntitlementResult
|
34
|
+
|
35
|
+
include org.killbill.billing.entitlement.plugin.api.PriorEntitlementResult
|
36
|
+
|
37
|
+
attr_accessor :is_aborted, :adjusted_plan_phase_specifier, :adjusted_effective_date, :adjusted_plan_phase_price_override, :adjusted_plugin_properties
|
38
|
+
|
39
|
+
def initialize()
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_java()
|
43
|
+
# conversion for is_aborted [type = boolean]
|
44
|
+
@is_aborted = @is_aborted.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_aborted)
|
45
|
+
|
46
|
+
# conversion for adjusted_plan_phase_specifier [type = org.killbill.billing.catalog.api.PlanPhaseSpecifier]
|
47
|
+
@adjusted_plan_phase_specifier = @adjusted_plan_phase_specifier.to_java unless @adjusted_plan_phase_specifier.nil?
|
48
|
+
|
49
|
+
# conversion for adjusted_effective_date [type = org.joda.time.LocalDate]
|
50
|
+
if !@adjusted_effective_date.nil?
|
51
|
+
@adjusted_effective_date = Java::org.joda.time.LocalDate.parse(@adjusted_effective_date.to_s)
|
52
|
+
end
|
53
|
+
|
54
|
+
# conversion for adjusted_plan_phase_price_override [type = java.util.List]
|
55
|
+
tmp = java.util.ArrayList.new
|
56
|
+
(@adjusted_plan_phase_price_override || []).each do |m|
|
57
|
+
# conversion for m [type = org.killbill.billing.catalog.api.PlanPhasePriceOverride]
|
58
|
+
m = m.to_java unless m.nil?
|
59
|
+
tmp.add(m)
|
60
|
+
end
|
61
|
+
@adjusted_plan_phase_price_override = tmp
|
62
|
+
|
63
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
64
|
+
tmp = java.util.ArrayList.new
|
65
|
+
(@adjusted_plugin_properties || []).each do |m|
|
66
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
67
|
+
m = m.to_java unless m.nil?
|
68
|
+
tmp.add(m)
|
69
|
+
end
|
70
|
+
@adjusted_plugin_properties = tmp
|
71
|
+
self
|
72
|
+
end
|
73
|
+
|
74
|
+
def to_ruby(j_obj)
|
75
|
+
# conversion for is_aborted [type = boolean]
|
76
|
+
@is_aborted = j_obj.is_aborted
|
77
|
+
if @is_aborted.nil?
|
78
|
+
@is_aborted = false
|
79
|
+
else
|
80
|
+
tmp_bool = (@is_aborted.java_kind_of? java.lang.Boolean) ? @is_aborted.boolean_value : @is_aborted
|
81
|
+
@is_aborted = tmp_bool ? true : false
|
82
|
+
end
|
83
|
+
|
84
|
+
# conversion for adjusted_plan_phase_specifier [type = org.killbill.billing.catalog.api.PlanPhaseSpecifier]
|
85
|
+
@adjusted_plan_phase_specifier = j_obj.adjusted_plan_phase_specifier
|
86
|
+
@adjusted_plan_phase_specifier = Killbill::Plugin::Model::PlanPhaseSpecifier.new.to_ruby(@adjusted_plan_phase_specifier) unless @adjusted_plan_phase_specifier.nil?
|
87
|
+
|
88
|
+
# conversion for adjusted_effective_date [type = org.joda.time.LocalDate]
|
89
|
+
@adjusted_effective_date = j_obj.adjusted_effective_date
|
90
|
+
if !@adjusted_effective_date.nil?
|
91
|
+
@adjusted_effective_date = @adjusted_effective_date.to_s
|
92
|
+
end
|
93
|
+
|
94
|
+
# conversion for adjusted_plan_phase_price_override [type = java.util.List]
|
95
|
+
@adjusted_plan_phase_price_override = j_obj.adjusted_plan_phase_price_override
|
96
|
+
tmp = []
|
97
|
+
(@adjusted_plan_phase_price_override || []).each do |m|
|
98
|
+
# conversion for m [type = org.killbill.billing.catalog.api.PlanPhasePriceOverride]
|
99
|
+
m = Killbill::Plugin::Model::PlanPhasePriceOverride.new.to_ruby(m) unless m.nil?
|
100
|
+
tmp << m
|
101
|
+
end
|
102
|
+
@adjusted_plan_phase_price_override = tmp
|
103
|
+
|
104
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
105
|
+
@adjusted_plugin_properties = j_obj.adjusted_plugin_properties
|
106
|
+
tmp = []
|
107
|
+
(@adjusted_plugin_properties.nil? ? [] : @adjusted_plugin_properties.iterator).each do |m|
|
108
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
109
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
110
|
+
tmp << m
|
111
|
+
end
|
112
|
+
@adjusted_plugin_properties = tmp
|
113
|
+
self
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|