killbill 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gen_config/api.conf +42 -0
- data/gen_config/plugin_api.conf +14 -0
- data/lib/killbill.rb +3 -3
- data/lib/killbill/gen/{account.rb → api/account.rb} +0 -0
- data/lib/killbill/gen/{account_api_exception.rb → api/account_api_exception.rb} +0 -0
- data/lib/killbill/gen/{account_data.rb → api/account_data.rb} +0 -0
- data/lib/killbill/gen/{account_email.rb → api/account_email.rb} +0 -0
- data/lib/killbill/gen/{account_user_api.rb → api/account_user_api.rb} +19 -16
- data/lib/killbill/gen/{audit_user_api.rb → api/audit_user_api.rb} +25 -0
- data/lib/killbill/gen/{billing_exception_base.rb → api/billing_exception_base.rb} +0 -0
- data/lib/killbill/gen/{blockable.rb → api/blockable.rb} +0 -0
- data/lib/killbill/gen/{blocking_api_exception.rb → api/blocking_api_exception.rb} +0 -0
- data/lib/killbill/gen/{blocking_state.rb → api/blocking_state.rb} +0 -0
- data/lib/killbill/gen/{call_context.rb → api/call_context.rb} +0 -0
- data/lib/killbill/gen/{catalog.rb → api/catalog.rb} +0 -0
- data/lib/killbill/gen/{catalog_api_exception.rb → api/catalog_api_exception.rb} +0 -0
- data/lib/killbill/gen/{catalog_user_api.rb → api/catalog_user_api.rb} +2 -0
- data/lib/killbill/gen/{column_info.rb → api/column_info.rb} +0 -0
- data/lib/killbill/gen/{control_tag.rb → api/control_tag.rb} +0 -0
- data/lib/killbill/gen/{currency_value_null.rb → api/currency_value_null.rb} +0 -0
- data/lib/killbill/gen/{custom_field.rb → api/custom_field.rb} +0 -0
- data/lib/killbill/gen/{custom_field_api_exception.rb → api/custom_field_api_exception.rb} +0 -0
- data/lib/killbill/gen/{custom_field_user_api.rb → api/custom_field_user_api.rb} +10 -0
- data/lib/killbill/gen/{database_export_output_stream.rb → api/database_export_output_stream.rb} +0 -0
- data/lib/killbill/gen/{duration.rb → api/duration.rb} +0 -0
- data/lib/killbill/gen/{entitlement_user_api.rb → api/entitlement_user_api.rb} +31 -0
- data/lib/killbill/gen/{entitlement_user_api_exception.rb → api/entitlement_user_api_exception.rb} +0 -0
- data/lib/killbill/gen/{entity.rb → api/entity.rb} +0 -0
- data/lib/killbill/gen/{illegal_plan_change.rb → api/illegal_plan_change.rb} +0 -0
- data/lib/killbill/gen/{international_price.rb → api/international_price.rb} +2 -2
- data/lib/killbill/gen/{invalid_config_exception.rb → api/invalid_config_exception.rb} +0 -0
- data/lib/killbill/gen/{invoice.rb → api/invoice.rb} +12 -12
- data/lib/killbill/gen/{invoice_api_exception.rb → api/invoice_api_exception.rb} +0 -0
- data/lib/killbill/gen/{invoice_creation_event.rb → api/invoice_creation_event.rb} +0 -0
- data/lib/killbill/gen/api/invoice_formatter.rb +278 -0
- data/lib/killbill/gen/{invoice_item.rb → api/invoice_item.rb} +4 -4
- data/lib/killbill/gen/api/invoice_item_formatter.rb +213 -0
- data/lib/killbill/gen/{invoice_payment.rb → api/invoice_payment.rb} +2 -2
- data/lib/killbill/gen/{invoice_payment_api.rb → api/invoice_payment_api.rb} +23 -2
- data/lib/killbill/gen/{invoice_user_api.rb → api/invoice_user_api.rb} +85 -8
- data/lib/killbill/gen/{junction_api.rb → api/junction_api.rb} +2 -0
- data/lib/killbill/gen/{limit.rb → api/limit.rb} +0 -0
- data/lib/killbill/gen/{listing.rb → api/listing.rb} +0 -0
- data/lib/killbill/gen/{migration_plan.rb → api/migration_plan.rb} +0 -0
- data/lib/killbill/gen/{mutable_account_data.rb → api/mutable_account_data.rb} +0 -0
- data/lib/killbill/gen/api/osgi_killbill.rb +175 -0
- data/lib/killbill/gen/{external_bus.rb → api/osgi_plugin_properties.rb} +3 -3
- data/lib/killbill/gen/{payment.rb → api/payment.rb} +4 -4
- data/lib/killbill/gen/{payment_api.rb → api/payment_api.rb} +63 -4
- data/lib/killbill/gen/{payment_api_exception.rb → api/payment_api_exception.rb} +0 -0
- data/lib/killbill/gen/{payment_attempt.rb → api/payment_attempt.rb} +0 -0
- data/lib/killbill/gen/{payment_method.rb → api/payment_method.rb} +0 -0
- data/lib/killbill/gen/{payment_method_kv_info.rb → api/payment_method_kv_info.rb} +0 -0
- data/lib/killbill/gen/{payment_method_plugin.rb → api/payment_method_plugin.rb} +0 -0
- data/lib/killbill/gen/{plan.rb → api/plan.rb} +0 -0
- data/lib/killbill/gen/{plan_change_result.rb → api/plan_change_result.rb} +0 -0
- data/lib/killbill/gen/{plan_phase.rb → api/plan_phase.rb} +0 -0
- data/lib/killbill/gen/{plan_phase_specifier.rb → api/plan_phase_specifier.rb} +0 -0
- data/lib/killbill/gen/{plan_specifier.rb → api/plan_specifier.rb} +0 -0
- data/lib/killbill/gen/api/plugin_config_service_api.rb +64 -0
- data/lib/killbill/gen/{price.rb → api/price.rb} +2 -2
- data/lib/killbill/gen/{price_list.rb → api/price_list.rb} +0 -0
- data/lib/killbill/gen/{price_list_set.rb → api/price_list_set.rb} +0 -0
- data/lib/killbill/gen/{product.rb → api/product.rb} +0 -0
- data/lib/killbill/gen/{record_id_api.rb → api/record_id_api.rb} +3 -0
- data/lib/killbill/gen/{refund.rb → api/refund.rb} +2 -2
- data/lib/killbill/gen/api/require_gen.rb +107 -0
- data/lib/killbill/gen/api/rolled_up_usage.rb +101 -0
- data/lib/killbill/gen/{static_catalog.rb → api/static_catalog.rb} +0 -0
- data/lib/killbill/gen/{subscription.rb → api/subscription.rb} +0 -0
- data/lib/killbill/gen/{subscription_bundle.rb → api/subscription_bundle.rb} +0 -0
- data/lib/killbill/gen/{subscription_status_dry_run.rb → api/subscription_status_dry_run.rb} +0 -0
- data/lib/killbill/gen/{subscription_transition.rb → api/subscription_transition.rb} +0 -0
- data/lib/killbill/gen/{tag.rb → api/tag.rb} +0 -0
- data/lib/killbill/gen/{tag_api_exception.rb → api/tag_api_exception.rb} +0 -0
- data/lib/killbill/gen/{tag_definition.rb → api/tag_definition.rb} +0 -0
- data/lib/killbill/gen/{tag_definition_api_exception.rb → api/tag_definition_api_exception.rb} +0 -0
- data/lib/killbill/gen/{tag_user_api.rb → api/tag_user_api.rb} +34 -0
- data/lib/killbill/gen/{tenant.rb → api/tenant.rb} +0 -0
- data/lib/killbill/gen/{tenant_api_exception.rb → api/tenant_api_exception.rb} +0 -0
- data/lib/killbill/gen/{tenant_context.rb → api/tenant_context.rb} +0 -0
- data/lib/killbill/gen/{tenant_data.rb → api/tenant_data.rb} +0 -0
- data/lib/killbill/gen/{tenant_kv.rb → api/tenant_kv.rb} +0 -0
- data/lib/killbill/gen/{tenant_user_api.rb → api/tenant_user_api.rb} +11 -0
- data/lib/killbill/gen/{unit.rb → api/unit.rb} +0 -0
- data/lib/killbill/gen/api/usage_user_api.rb +89 -0
- data/lib/killbill/gen/{ext_bus_event.rb → plugin-api/ext_bus_event.rb} +0 -0
- data/lib/killbill/gen/plugin-api/notification_plugin_api.rb +61 -0
- data/lib/killbill/gen/{payment_info_plugin.rb → plugin-api/payment_info_plugin.rb} +2 -2
- data/lib/killbill/gen/{payment_method_info_plugin.rb → plugin-api/payment_method_info_plugin.rb} +0 -0
- data/lib/killbill/gen/plugin-api/payment_plugin_api.rb +356 -0
- data/lib/killbill/gen/{payment_plugin_api_exception.rb → plugin-api/payment_plugin_api_exception.rb} +0 -0
- data/lib/killbill/gen/{refund_info_plugin.rb → plugin-api/refund_info_plugin.rb} +2 -2
- data/lib/killbill/gen/plugin-api/require_gen.rb +32 -0
- data/lib/killbill/jplugin.rb +0 -71
- data/lib/killbill/killbill_api.rb +0 -7
- data/spec/killbill/killbillapi_spec.rb +1 -1
- data/spec/killbill/notification_plugin_api_spec.rb +22 -0
- data/spec/killbill/payment_plugin_api_spec.rb +122 -0
- data/spec/killbill/payment_test.rb +1 -1
- metadata +100 -107
- data/lib/killbill/enum.rb +0 -72
- data/lib/killbill/gen/account_service.rb +0 -55
- data/lib/killbill/gen/beatrix_service.rb +0 -55
- data/lib/killbill/gen/catalog_service.rb +0 -69
- data/lib/killbill/gen/default_mutable_account_data.rb +0 -180
- data/lib/killbill/gen/entitlement_service.rb +0 -55
- data/lib/killbill/gen/entity_persistence_exception.rb +0 -66
- data/lib/killbill/gen/export_user_api.rb +0 -17
- data/lib/killbill/gen/invoice_migration_api.rb +0 -66
- data/lib/killbill/gen/invoice_notifier.rb +0 -51
- data/lib/killbill/gen/invoice_service.rb +0 -55
- data/lib/killbill/gen/migration_account_data.rb +0 -228
- data/lib/killbill/gen/no_op_payment_plugin_api.rb +0 -254
- data/lib/killbill/gen/payment_plugin_api.rb +0 -232
- data/lib/killbill/gen/payment_service.rb +0 -62
- data/lib/killbill/gen/require_gen.rb +0 -120
- data/lib/killbill/gen/tenant_service.rb +0 -55
- data/lib/killbill/jpayment.rb +0 -107
- data/spec/killbill/jnotification_spec.rb +0 -39
- data/spec/killbill/jpayment_spec.rb +0 -126
- data/tools/java2ruby.rb +0 -440
@@ -1,62 +0,0 @@
|
|
1
|
-
###################################################################################
|
2
|
-
# #
|
3
|
-
# Copyright 2010-2013 Ning, Inc. #
|
4
|
-
# #
|
5
|
-
# Ning licenses this file to you under the Apache License, version 2.0 #
|
6
|
-
# (the "License"); you may not use this file except in compliance with the #
|
7
|
-
# License. You may obtain a copy of the License at: #
|
8
|
-
# #
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0 #
|
10
|
-
# #
|
11
|
-
# Unless required by applicable law or agreed to in writing, software #
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
13
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
14
|
-
# License for the specific language governing permissions and limitations #
|
15
|
-
# under the License. #
|
16
|
-
# #
|
17
|
-
###################################################################################
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
# DO NOT EDIT!!!
|
22
|
-
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
module Killbill
|
27
|
-
module Plugin
|
28
|
-
module Model
|
29
|
-
|
30
|
-
java_package 'com.ning.billing.payment.api'
|
31
|
-
class PaymentService
|
32
|
-
|
33
|
-
include com.ning.billing.payment.api.PaymentService
|
34
|
-
|
35
|
-
attr_accessor :name, :payment_api
|
36
|
-
|
37
|
-
def initialize()
|
38
|
-
end
|
39
|
-
|
40
|
-
def to_java()
|
41
|
-
# conversion for name [type = java.lang.String]
|
42
|
-
@name = @name.to_s unless @name.nil?
|
43
|
-
|
44
|
-
# conversion for payment_api [type = com.ning.billing.payment.api.PaymentApi]
|
45
|
-
@payment_api = @payment_api.to_java unless @payment_api.nil?
|
46
|
-
self
|
47
|
-
end
|
48
|
-
|
49
|
-
def to_ruby(j_obj)
|
50
|
-
# conversion for name [type = java.lang.String]
|
51
|
-
@name = j_obj.name
|
52
|
-
|
53
|
-
# conversion for payment_api [type = com.ning.billing.payment.api.PaymentApi]
|
54
|
-
@payment_api = j_obj.payment_api
|
55
|
-
@payment_api = Killbill::Plugin::Model::PaymentApi.new.to_ruby(@payment_api) unless @payment_api.nil?
|
56
|
-
self
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
###################################################################################
|
2
|
-
# #
|
3
|
-
# Copyright 2010-2013 Ning, Inc. #
|
4
|
-
# #
|
5
|
-
# Ning licenses this file to you under the Apache License, version 2.0 #
|
6
|
-
# (the "License"); you may not use this file except in compliance with the #
|
7
|
-
# License. You may obtain a copy of the License at: #
|
8
|
-
# #
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0 #
|
10
|
-
# #
|
11
|
-
# Unless required by applicable law or agreed to in writing, software #
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
13
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
14
|
-
# License for the specific language governing permissions and limitations #
|
15
|
-
# under the License. #
|
16
|
-
# #
|
17
|
-
###################################################################################
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
# DO NOT EDIT!!!
|
22
|
-
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
require 'killbill/gen/account'
|
27
|
-
require 'killbill/gen/account_api_exception'
|
28
|
-
require 'killbill/gen/account_data'
|
29
|
-
require 'killbill/gen/account_email'
|
30
|
-
require 'killbill/gen/account_service'
|
31
|
-
require 'killbill/gen/account_user_api'
|
32
|
-
require 'killbill/gen/default_mutable_account_data'
|
33
|
-
require 'killbill/gen/migration_account_data'
|
34
|
-
require 'killbill/gen/mutable_account_data'
|
35
|
-
require 'killbill/gen/beatrix_service'
|
36
|
-
require 'killbill/gen/ext_bus_event'
|
37
|
-
require 'killbill/gen/external_bus'
|
38
|
-
require 'killbill/gen/billing_exception_base'
|
39
|
-
require 'killbill/gen/catalog'
|
40
|
-
require 'killbill/gen/catalog_api_exception'
|
41
|
-
require 'killbill/gen/catalog_service'
|
42
|
-
require 'killbill/gen/catalog_user_api'
|
43
|
-
require 'killbill/gen/currency_value_null'
|
44
|
-
require 'killbill/gen/duration'
|
45
|
-
require 'killbill/gen/illegal_plan_change'
|
46
|
-
require 'killbill/gen/international_price'
|
47
|
-
require 'killbill/gen/invalid_config_exception'
|
48
|
-
require 'killbill/gen/limit'
|
49
|
-
require 'killbill/gen/listing'
|
50
|
-
require 'killbill/gen/migration_plan'
|
51
|
-
require 'killbill/gen/plan'
|
52
|
-
require 'killbill/gen/plan_change_result'
|
53
|
-
require 'killbill/gen/plan_phase'
|
54
|
-
require 'killbill/gen/plan_phase_specifier'
|
55
|
-
require 'killbill/gen/plan_specifier'
|
56
|
-
require 'killbill/gen/price'
|
57
|
-
require 'killbill/gen/price_list'
|
58
|
-
require 'killbill/gen/price_list_set'
|
59
|
-
require 'killbill/gen/product'
|
60
|
-
require 'killbill/gen/static_catalog'
|
61
|
-
require 'killbill/gen/unit'
|
62
|
-
require 'killbill/gen/entitlement_service'
|
63
|
-
require 'killbill/gen/entitlement_user_api'
|
64
|
-
require 'killbill/gen/entitlement_user_api_exception'
|
65
|
-
require 'killbill/gen/subscription'
|
66
|
-
require 'killbill/gen/subscription_bundle'
|
67
|
-
require 'killbill/gen/subscription_status_dry_run'
|
68
|
-
require 'killbill/gen/subscription_transition'
|
69
|
-
require 'killbill/gen/invoice'
|
70
|
-
require 'killbill/gen/invoice_api_exception'
|
71
|
-
require 'killbill/gen/invoice_creation_event'
|
72
|
-
require 'killbill/gen/invoice_item'
|
73
|
-
require 'killbill/gen/invoice_migration_api'
|
74
|
-
require 'killbill/gen/invoice_notifier'
|
75
|
-
require 'killbill/gen/invoice_payment'
|
76
|
-
require 'killbill/gen/invoice_payment_api'
|
77
|
-
require 'killbill/gen/invoice_service'
|
78
|
-
require 'killbill/gen/invoice_user_api'
|
79
|
-
require 'killbill/gen/blockable'
|
80
|
-
require 'killbill/gen/blocking_api_exception'
|
81
|
-
require 'killbill/gen/blocking_state'
|
82
|
-
require 'killbill/gen/junction_api'
|
83
|
-
require 'killbill/gen/payment'
|
84
|
-
require 'killbill/gen/payment_api'
|
85
|
-
require 'killbill/gen/payment_api_exception'
|
86
|
-
require 'killbill/gen/payment_attempt'
|
87
|
-
require 'killbill/gen/payment_method'
|
88
|
-
require 'killbill/gen/payment_method_kv_info'
|
89
|
-
require 'killbill/gen/payment_method_plugin'
|
90
|
-
require 'killbill/gen/payment_service'
|
91
|
-
require 'killbill/gen/refund'
|
92
|
-
require 'killbill/gen/no_op_payment_plugin_api'
|
93
|
-
require 'killbill/gen/payment_info_plugin'
|
94
|
-
require 'killbill/gen/payment_method_info_plugin'
|
95
|
-
require 'killbill/gen/payment_plugin_api'
|
96
|
-
require 'killbill/gen/payment_plugin_api_exception'
|
97
|
-
require 'killbill/gen/refund_info_plugin'
|
98
|
-
require 'killbill/gen/tenant'
|
99
|
-
require 'killbill/gen/tenant_api_exception'
|
100
|
-
require 'killbill/gen/tenant_data'
|
101
|
-
require 'killbill/gen/tenant_kv'
|
102
|
-
require 'killbill/gen/tenant_service'
|
103
|
-
require 'killbill/gen/tenant_user_api'
|
104
|
-
require 'killbill/gen/audit_user_api'
|
105
|
-
require 'killbill/gen/column_info'
|
106
|
-
require 'killbill/gen/custom_field_api_exception'
|
107
|
-
require 'killbill/gen/custom_field_user_api'
|
108
|
-
require 'killbill/gen/database_export_output_stream'
|
109
|
-
require 'killbill/gen/record_id_api'
|
110
|
-
require 'killbill/gen/tag_api_exception'
|
111
|
-
require 'killbill/gen/tag_definition_api_exception'
|
112
|
-
require 'killbill/gen/tag_user_api'
|
113
|
-
require 'killbill/gen/call_context'
|
114
|
-
require 'killbill/gen/tenant_context'
|
115
|
-
require 'killbill/gen/custom_field'
|
116
|
-
require 'killbill/gen/entity'
|
117
|
-
require 'killbill/gen/entity_persistence_exception'
|
118
|
-
require 'killbill/gen/control_tag'
|
119
|
-
require 'killbill/gen/tag'
|
120
|
-
require 'killbill/gen/tag_definition'
|
@@ -1,55 +0,0 @@
|
|
1
|
-
###################################################################################
|
2
|
-
# #
|
3
|
-
# Copyright 2010-2013 Ning, Inc. #
|
4
|
-
# #
|
5
|
-
# Ning licenses this file to you under the Apache License, version 2.0 #
|
6
|
-
# (the "License"); you may not use this file except in compliance with the #
|
7
|
-
# License. You may obtain a copy of the License at: #
|
8
|
-
# #
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0 #
|
10
|
-
# #
|
11
|
-
# Unless required by applicable law or agreed to in writing, software #
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
|
13
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
|
14
|
-
# License for the specific language governing permissions and limitations #
|
15
|
-
# under the License. #
|
16
|
-
# #
|
17
|
-
###################################################################################
|
18
|
-
|
19
|
-
|
20
|
-
#
|
21
|
-
# DO NOT EDIT!!!
|
22
|
-
# File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
|
23
|
-
#
|
24
|
-
|
25
|
-
|
26
|
-
module Killbill
|
27
|
-
module Plugin
|
28
|
-
module Model
|
29
|
-
|
30
|
-
java_package 'com.ning.billing.tenant.api'
|
31
|
-
class TenantService
|
32
|
-
|
33
|
-
include com.ning.billing.tenant.api.TenantService
|
34
|
-
|
35
|
-
attr_accessor :name
|
36
|
-
|
37
|
-
def initialize()
|
38
|
-
end
|
39
|
-
|
40
|
-
def to_java()
|
41
|
-
# conversion for name [type = java.lang.String]
|
42
|
-
@name = @name.to_s unless @name.nil?
|
43
|
-
self
|
44
|
-
end
|
45
|
-
|
46
|
-
def to_ruby(j_obj)
|
47
|
-
# conversion for name [type = java.lang.String]
|
48
|
-
@name = j_obj.name
|
49
|
-
self
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
data/lib/killbill/jpayment.rb
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
require 'java'
|
2
|
-
|
3
|
-
require 'singleton'
|
4
|
-
|
5
|
-
require 'killbill/creator'
|
6
|
-
require 'killbill/plugin'
|
7
|
-
|
8
|
-
include Java
|
9
|
-
|
10
|
-
|
11
|
-
module Killbill
|
12
|
-
module Plugin
|
13
|
-
|
14
|
-
java_package 'com.ning.billing.payment.plugin.api'
|
15
|
-
class JPayment < JPlugin
|
16
|
-
|
17
|
-
include com.ning.billing.payment.plugin.api.PaymentPluginApi
|
18
|
-
|
19
|
-
def initialize(real_class_name, services = {})
|
20
|
-
super(real_class_name, services)
|
21
|
-
end
|
22
|
-
|
23
|
-
java_signature 'com.ning.billing.payment.plugin.api.PaymentInfoPlugin processPayment(java.util.UUID, java.util.UUID, java.util.UUID, java.lang.BigDecimal, com.ning.billing.catalog.api.Currency, com.ning.billing.util.callcontext.CallContext)'
|
24
|
-
def process_payment(*args)
|
25
|
-
do_call_handle_exception(__method__, *args) do |res|
|
26
|
-
res.to_java
|
27
|
-
return res
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
java_signature 'Java::com.ning.billing.payment.plugin.api.PaymentInfoPlugin getPaymentInfo(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
|
32
|
-
def get_payment_info(*args)
|
33
|
-
do_call_handle_exception(__method__, *args) do |res|
|
34
|
-
res.to_java
|
35
|
-
return res
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
java_signature 'Java::com.ning.billing.payment.plugin.api.RefundInfoPlugin processRefund(java.util.UUID, java.util.UUID, java.lang.BigDecimal, com.ning.billing.catalog.api.Currency, Java::com.ning.billing.util.callcontext.CallContext)'
|
40
|
-
def process_refund(*args)
|
41
|
-
do_call_handle_exception(__method__, *args) do |res|
|
42
|
-
res.to_java
|
43
|
-
return res
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
java_signature 'java.util.List getRefundInfo(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
|
48
|
-
def get_refund_info(*args)
|
49
|
-
do_call_handle_exception(__method__, *args) do |res|
|
50
|
-
array_res = java.util.ArrayList.new
|
51
|
-
res.each do |el|
|
52
|
-
array_res.add(el.to_java)
|
53
|
-
end
|
54
|
-
return array_res
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
java_signature 'void addPaymentMethod(java.util.UUID, java.util.UUID, Java::com.ning.billing.payment.api.PaymentMethodPlugin, Java::boolean, Java::com.ning.billing.util.callcontext.CallContext)'
|
59
|
-
def add_payment_method(*args)
|
60
|
-
do_call_handle_exception(__method__, *args) do |res|
|
61
|
-
return nil
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
java_signature 'void deletePaymentMethod(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
|
66
|
-
def delete_payment_method(*args)
|
67
|
-
do_call_handle_exception(__method__, *args) do |res|
|
68
|
-
return nil
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
java_signature 'Java::com.ning.billing.payment.api.PaymentMethodPlugin getPaymentMethodDetail(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
|
73
|
-
def get_payment_method_detail(*args)
|
74
|
-
do_call_handle_exception(__method__, *args) do |res|
|
75
|
-
res.to_java
|
76
|
-
return res
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
java_signature 'void setDefaultPaymentMethod(java.util.UUID, java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
|
81
|
-
def set_default_payment_method(*args)
|
82
|
-
do_call_handle_exception(__method__, *args) do |res|
|
83
|
-
return nil
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
java_signature 'java.util.List getPaymentMethods(java.util.UUID, Java::boolean, Java::com.ning.billing.util.callcontext.CallContext)'
|
88
|
-
def get_payment_methods(*args)
|
89
|
-
do_call_handle_exception(__method__, *args) do |res|
|
90
|
-
array_res = java.util.ArrayList.new
|
91
|
-
res.each do |el|
|
92
|
-
array_res.add(el.to_java)
|
93
|
-
end
|
94
|
-
return array_res
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
java_signature 'void resetPaymentMethods(java.util.UUID, java.util.List)'
|
99
|
-
def reset_payment_methods(*args)
|
100
|
-
do_call_handle_exception(__method__, *args) do |res|
|
101
|
-
return nil
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'killbill/jnotification'
|
4
|
-
|
5
|
-
describe Killbill::Plugin::JNotification do
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
logger = ::Logger.new(STDOUT)
|
9
|
-
|
10
|
-
puts "************************************************** 1 ************************************"
|
11
|
-
@jnotification = Killbill::Plugin::JNotification.new("Killbill::Plugin::NotificationTest", { "logger" => logger })
|
12
|
-
puts "************************************************** 2 ************************************"
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
it "should_test_on_event_ok" do
|
18
|
-
|
19
|
-
puts "************************************************** 3 ************************************"
|
20
|
-
|
21
|
-
object_type = Java::com.ning.billing.ObjectType::INVOICE
|
22
|
-
event_type = Java::com.ning.billing.notification.plugin.api.ExtBusEventType::INVOICE_CREATION
|
23
|
-
uuid = java.util.UUID.random_uuid
|
24
|
-
|
25
|
-
puts "************************************************** 4 ************************************"
|
26
|
-
|
27
|
-
event = Java::com.ning.billing.mock.api.MockExtBusEvent.new(event_type, object_type, uuid, uuid, uuid)
|
28
|
-
|
29
|
-
puts "************************************************** 5 ************************************"
|
30
|
-
|
31
|
-
@jnotification.on_event(event)
|
32
|
-
@jnotification.on_event(event)
|
33
|
-
@jnotification.on_event(event)
|
34
|
-
|
35
|
-
puts "************************************************** 6 ************************************"
|
36
|
-
|
37
|
-
@jnotification.delegate_plugin.counter.should == 3
|
38
|
-
end
|
39
|
-
end
|
@@ -1,126 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
require 'killbill/jpayment'
|
4
|
-
|
5
|
-
describe Killbill::Plugin::JPayment do
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
logger = ::Logger.new(STDOUT)
|
9
|
-
@jpayment = Killbill::Plugin::JPayment.new("Killbill::Plugin::PaymentTest", { "logger" => logger })
|
10
|
-
@kb_account_id = java.util.UUID.fromString("aa5c926e-3d9d-4435-b44b-719d7b583256")
|
11
|
-
@kb_payment_id = java.util.UUID.fromString("bf5c926e-3d9c-470e-b34b-719d7b58323a")
|
12
|
-
@kb_payment_method_id = java.util.UUID.fromString("bf5c926e-3d9c-470e-b34b-719d7b58323a")
|
13
|
-
@payment_method_plugin = nil
|
14
|
-
@amount = java.math.BigDecimal.new("50")
|
15
|
-
@currency = Java::com.ning.billing.catalog.api.Currency::USD
|
16
|
-
end
|
17
|
-
|
18
|
-
before(:each) do
|
19
|
-
@jpayment.delegate_plugin.send(:clear_exception_on_next_calls)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should_test_charge_ok" do
|
23
|
-
output = @jpayment.process_payment(@kb_account_id, @kb_payment_id, @kb_payment_method_id, @amount, @currency)
|
24
|
-
output.amount.should be_an_instance_of java.math.BigDecimal
|
25
|
-
output.amount.compare_to(@amount).should == 0
|
26
|
-
|
27
|
-
puts "#{output.status.class}"
|
28
|
-
output.status.java_kind_of?(Java::com.ning.billing.payment.plugin.api.PaymentPluginStatus).should == true
|
29
|
-
output.status.to_s.should == "PROCESSED"
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should_test_charge_exception" do
|
33
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
34
|
-
lambda { @jpayment.process_payment(@kb_account_id, @kb_payment_id, @kb_payment_method_id, @amount, @currency) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should_test_get_payment_info_ok" do
|
38
|
-
output = @jpayment.get_payment_info(@kb_account_id, @kb_payment_method_id)
|
39
|
-
output.amount.should be_an_instance_of java.math.BigDecimal
|
40
|
-
output.amount.compare_to(java.math.BigDecimal.new(0)).should == 0
|
41
|
-
output.status.java_kind_of?(Java::com.ning.billing.payment.plugin.api.PaymentPluginStatus).should == true
|
42
|
-
output.status.to_s.should == "PROCESSED"
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
it "should_test_get_payment_info_exception" do
|
47
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
48
|
-
lambda { @jpayment.get_payment_info(@kb_account_id, @kb_payment_method_id) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should_test_refund_ok" do
|
52
|
-
output = @jpayment.process_refund(@kb_account_id, @kb_payment_method_id, @amount, @currency)
|
53
|
-
output.amount.should be_an_instance_of java.math.BigDecimal
|
54
|
-
output.amount.compare_to(@amount).should == 0
|
55
|
-
output.status.java_kind_of?(Java::com.ning.billing.payment.plugin.api.RefundPluginStatus).should == true
|
56
|
-
output.status.to_s.should == "PROCESSED"
|
57
|
-
end
|
58
|
-
|
59
|
-
|
60
|
-
it "should_test_refund_exception" do
|
61
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
62
|
-
lambda { @jpayment.process_refund(@kb_account_id, @kb_payment_method_id, @amount, @currency) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should_test_add_payment_method_ok" do
|
66
|
-
@jpayment.add_payment_method(@kb_account_id, @kb_payment_method_id, @payment_method_plugin, java.lang.Boolean.new("true"))
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should_test_add_payment_method_exception" do
|
70
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
71
|
-
lambda { @jpayment.add_payment_method(@kb_account_id, @kb_payment_method_id, @payment_method_plugin, true) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should_test_delete_payment_method_ok" do
|
75
|
-
@jpayment.delete_payment_method(@kb_account_id, @kb_payment_method_id)
|
76
|
-
end
|
77
|
-
|
78
|
-
it "should_test_delete_payment_method_exception" do
|
79
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
80
|
-
lambda { @jpayment.delete_payment_method(@kb_account_id, @kb_payment_method_id) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
81
|
-
end
|
82
|
-
|
83
|
-
it "should_test_get_payment_method_detail_ok" do
|
84
|
-
output = @jpayment.get_payment_method_detail(@kb_account_id, @kb_payment_method_id)
|
85
|
-
#output.external_payment_method_id.should be_an_instance_of java.lang.String
|
86
|
-
output.external_payment_method_id.should == "external_payment_method_id"
|
87
|
-
end
|
88
|
-
|
89
|
-
it "should_test_get_payment_method_detail_exception" do
|
90
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
91
|
-
lambda { @jpayment.get_payment_method_detail(@kb_account_id, @kb_payment_method_id) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
92
|
-
end
|
93
|
-
|
94
|
-
it "should_test_set_default_payment_method_ok" do
|
95
|
-
@jpayment.set_default_payment_method(@kb_account_id, @kb_payment_method_id)
|
96
|
-
end
|
97
|
-
|
98
|
-
it "should_test_set_default_payment_method_exception" do
|
99
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
100
|
-
lambda { @jpayment.set_default_payment_method(@kb_account_id, @kb_payment_method_id) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
101
|
-
end
|
102
|
-
|
103
|
-
it "should_get_payment_methods_ok" do
|
104
|
-
output = @jpayment.get_payment_methods(@kb_account_id, java.lang.Boolean.new("true"))
|
105
|
-
|
106
|
-
output.should be_an_instance_of java.util.ArrayList
|
107
|
-
output.size.should == 1
|
108
|
-
|
109
|
-
current_payment_method = output.get(0)
|
110
|
-
current_payment_method.account_id.to_s.should == @kb_account_id.to_s
|
111
|
-
end
|
112
|
-
|
113
|
-
it "should_get_payment_methods_exception" do
|
114
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
115
|
-
lambda { @jpayment.get_payment_methods(@kb_account_id, true) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
116
|
-
end
|
117
|
-
|
118
|
-
it "should_test_reset_payment_methods_ok" do
|
119
|
-
@jpayment.reset_payment_methods(@kb_account_id, java.util.ArrayList.new)
|
120
|
-
end
|
121
|
-
|
122
|
-
it "should_test_reset_payment_methods_exception" do
|
123
|
-
@jpayment.delegate_plugin.send(:raise_exception_on_next_calls)
|
124
|
-
lambda { @jpayment.reset_payment_methods(@kb_account_id, java.util.ArrayList.new) }.should raise_error Java::com.ning.billing.payment.plugin.api.PaymentPluginApiException
|
125
|
-
end
|
126
|
-
end
|