killbill 1.0.19 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/Jarfile +4 -2
  2. data/VERSION +1 -1
  3. data/killbill.gemspec +4 -3
  4. data/lib/killbill.rb +7 -51
  5. data/lib/killbill/creator.rb +10 -18
  6. data/lib/killbill/gen/account.rb +208 -27
  7. data/lib/killbill/gen/account_api_exception.rb +66 -0
  8. data/lib/killbill/gen/account_data.rb +166 -23
  9. data/lib/killbill/gen/account_email.rb +80 -8
  10. data/lib/killbill/gen/account_service.rb +55 -0
  11. data/lib/killbill/gen/account_user_api.rb +187 -0
  12. data/lib/killbill/gen/audit_user_api.rb +196 -0
  13. data/lib/killbill/gen/beatrix_service.rb +55 -0
  14. data/lib/killbill/gen/billing_exception_base.rb +66 -0
  15. data/lib/killbill/gen/blockable.rb +91 -0
  16. data/lib/killbill/gen/blocking_api_exception.rb +66 -0
  17. data/lib/killbill/gen/blocking_state.rb +150 -16
  18. data/lib/killbill/gen/call_context.rb +107 -13
  19. data/lib/killbill/gen/catalog.rb +76 -0
  20. data/lib/killbill/gen/catalog_api_exception.rb +66 -0
  21. data/lib/killbill/gen/catalog_service.rb +69 -0
  22. data/lib/killbill/gen/catalog_user_api.rb +54 -0
  23. data/lib/killbill/gen/column_info.rb +67 -0
  24. data/lib/killbill/gen/control_tag.rb +112 -0
  25. data/lib/killbill/gen/currency_value_null.rb +66 -0
  26. data/lib/killbill/gen/custom_field.rb +93 -10
  27. data/lib/killbill/gen/custom_field_api_exception.rb +66 -0
  28. data/lib/killbill/gen/custom_field_user_api.rb +115 -0
  29. data/lib/killbill/gen/database_export_output_stream.rb +51 -0
  30. data/lib/killbill/gen/default_mutable_account_data.rb +180 -0
  31. data/lib/killbill/gen/duration.rb +62 -0
  32. data/lib/killbill/gen/entitlement_service.rb +55 -0
  33. data/lib/killbill/gen/entitlement_user_api.rb +272 -0
  34. data/lib/killbill/gen/entitlement_user_api_exception.rb +66 -0
  35. data/lib/killbill/gen/entity.rb +84 -0
  36. data/lib/killbill/gen/entity_persistence_exception.rb +66 -0
  37. data/lib/killbill/gen/export_user_api.rb +17 -0
  38. data/lib/killbill/gen/ext_bus_event.rb +68 -9
  39. data/lib/killbill/gen/external_bus.rb +51 -0
  40. data/lib/killbill/gen/illegal_plan_change.rb +66 -0
  41. data/lib/killbill/gen/international_price.rb +79 -0
  42. data/lib/killbill/gen/invalid_config_exception.rb +49 -0
  43. data/lib/killbill/gen/invoice.rb +238 -23
  44. data/lib/killbill/gen/invoice_api_exception.rb +66 -0
  45. data/lib/killbill/gen/invoice_creation_event.rb +51 -0
  46. data/lib/killbill/gen/invoice_item.rb +179 -21
  47. data/lib/killbill/gen/invoice_migration_api.rb +66 -0
  48. data/lib/killbill/gen/invoice_notifier.rb +51 -0
  49. data/lib/killbill/gen/invoice_payment.rb +135 -15
  50. data/lib/killbill/gen/invoice_payment_api.rb +208 -0
  51. data/lib/killbill/gen/invoice_service.rb +55 -0
  52. data/lib/killbill/gen/invoice_user_api.rb +461 -0
  53. data/lib/killbill/gen/junction_api.rb +60 -0
  54. data/lib/killbill/gen/limit.rb +68 -0
  55. data/lib/killbill/gen/listing.rb +63 -0
  56. data/lib/killbill/gen/migration_account_data.rb +228 -0
  57. data/lib/killbill/gen/migration_plan.rb +143 -0
  58. data/lib/killbill/gen/mutable_account_data.rb +182 -0
  59. data/lib/killbill/gen/no_op_payment_plugin_api.rb +254 -0
  60. data/lib/killbill/gen/payment.rb +183 -20
  61. data/lib/killbill/gen/payment_api.rb +433 -0
  62. data/lib/killbill/gen/payment_api_exception.rb +66 -0
  63. data/lib/killbill/gen/payment_attempt.rb +100 -10
  64. data/lib/killbill/gen/payment_info_plugin.rb +103 -12
  65. data/lib/killbill/gen/payment_method.rb +116 -0
  66. data/lib/killbill/gen/payment_method_info_plugin.rb +64 -7
  67. data/lib/killbill/gen/payment_method_kv_info.rb +56 -6
  68. data/lib/killbill/gen/payment_method_plugin.rb +142 -20
  69. data/lib/killbill/gen/payment_plugin_api.rb +232 -0
  70. data/lib/killbill/gen/payment_plugin_api_exception.rb +59 -0
  71. data/lib/killbill/gen/payment_service.rb +62 -0
  72. data/lib/killbill/gen/plan.rb +143 -0
  73. data/lib/killbill/gen/plan_change_result.rb +68 -0
  74. data/lib/killbill/gen/plan_phase.rb +104 -0
  75. data/lib/killbill/gen/plan_phase_specifier.rb +80 -0
  76. data/lib/killbill/gen/plan_specifier.rb +73 -0
  77. data/lib/killbill/gen/price.rb +67 -0
  78. data/lib/killbill/gen/price_list.rb +74 -0
  79. data/lib/killbill/gen/price_list_set.rb +56 -0
  80. data/lib/killbill/gen/product.rb +101 -0
  81. data/lib/killbill/gen/record_id_api.rb +55 -0
  82. data/lib/killbill/gen/refund.rb +126 -13
  83. data/lib/killbill/gen/refund_info_plugin.rb +96 -10
  84. data/lib/killbill/gen/require_gen.rb +97 -15
  85. data/lib/killbill/gen/static_catalog.rb +137 -0
  86. data/lib/killbill/gen/subscription.rb +258 -28
  87. data/lib/killbill/gen/subscription_bundle.rb +94 -10
  88. data/lib/killbill/gen/subscription_status_dry_run.rb +89 -0
  89. data/lib/killbill/gen/subscription_transition.rb +196 -0
  90. data/lib/killbill/gen/tag.rb +88 -9
  91. data/lib/killbill/gen/tag_api_exception.rb +66 -0
  92. data/lib/killbill/gen/tag_definition.rb +110 -10
  93. data/lib/killbill/gen/tag_definition_api_exception.rb +66 -0
  94. data/lib/killbill/gen/tag_user_api.rb +239 -0
  95. data/lib/killbill/gen/tenant.rb +102 -0
  96. data/lib/killbill/gen/tenant_api_exception.rb +66 -0
  97. data/lib/killbill/gen/tenant_context.rb +39 -4
  98. data/lib/killbill/gen/tenant_data.rb +67 -0
  99. data/lib/killbill/gen/tenant_kv.rb +96 -0
  100. data/lib/killbill/gen/tenant_service.rb +55 -0
  101. data/lib/killbill/gen/tenant_user_api.rb +127 -0
  102. data/lib/killbill/gen/unit.rb +55 -0
  103. data/lib/killbill/jnotification.rb +1 -1
  104. data/lib/killbill/jpayment.rb +10 -7
  105. data/lib/killbill/jplugin.rb +63 -61
  106. data/lib/killbill/killbill_api.rb +42 -9
  107. data/spec/killbill/jnotification_spec.rb +15 -1
  108. data/spec/killbill/jpayment_spec.rb +12 -8
  109. data/spec/killbill/killbillapi_spec.rb +23 -21
  110. data/spec/killbill/payment_plugin_spec.rb +1 -9
  111. data/spec/killbill/payment_test.rb +21 -5
  112. metadata +96 -22
  113. data/lib/killbill/gen/audit_log.rb +0 -28
  114. data/lib/killbill/gen/call_origin.rb +0 -34
  115. data/lib/killbill/gen/currency.rb +0 -34
  116. data/lib/killbill/gen/date_time_zone.rb +0 -35
  117. data/lib/killbill/gen/ext_bus_event_type.rb +0 -34
  118. data/lib/killbill/gen/invoice_payment_type.rb +0 -34
  119. data/lib/killbill/gen/object_type.rb +0 -34
  120. data/lib/killbill/gen/payment_plugin_status.rb +0 -34
  121. data/lib/killbill/gen/refund_plugin_status.rb +0 -34
  122. data/lib/killbill/gen/subscription_source_type.rb +0 -34
  123. data/lib/killbill/gen/subscription_state.rb +0 -34
  124. data/lib/killbill/gen/user_type.rb +0 -34
  125. data/lib/killbill/gen/uuid.rb +0 -22
  126. data/lib/killbill/jconverter.rb +0 -537
  127. data/lib/killbill/jkillbill_api.rb +0 -137
  128. data/spec/killbill/jconverter_spec.rb +0 -193
@@ -0,0 +1,433 @@
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 Api
29
+
30
+ java_package 'com.ning.billing.payment.api'
31
+ class PaymentApi
32
+
33
+ include com.ning.billing.payment.api.PaymentApi
34
+
35
+ def initialize(real_java_api)
36
+ @real_java_api = real_java_api
37
+ end
38
+
39
+
40
+ java_signature 'Java::com.ning.billing.payment.api.Payment createPayment(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::com.ning.billing.util.callcontext.CallContext)'
41
+ def create_payment(account, invoiceId, amount, context)
42
+ # conversion for account [type = com.ning.billing.account.api.Account]
43
+ account = account.to_java unless account.nil?
44
+ # conversion for invoiceId [type = java.util.UUID]
45
+ invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?
46
+ # conversion for amount [type = java.math.BigDecimal]
47
+ if amount.nil?
48
+ amount = java.math.BigDecimal::ZERO
49
+ else
50
+ amount = java.math.BigDecimal.new(amount.to_i)
51
+ end
52
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
53
+ context = context.to_java unless context.nil?
54
+ begin
55
+ res = @real_java_api.create_payment(account, invoiceId, amount, context)
56
+ # conversion for res [type = com.ning.billing.payment.api.Payment]
57
+ res = Killbill::Plugin::Model::Payment.new.to_ruby(res) unless res.nil?
58
+ return res
59
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
60
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
61
+ end
62
+ end
63
+
64
+ java_signature 'Java::com.ning.billing.payment.api.Payment createExternalPayment(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::com.ning.billing.util.callcontext.CallContext)'
65
+ def create_external_payment(account, invoiceId, amount, context)
66
+ # conversion for account [type = com.ning.billing.account.api.Account]
67
+ account = account.to_java unless account.nil?
68
+ # conversion for invoiceId [type = java.util.UUID]
69
+ invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?
70
+ # conversion for amount [type = java.math.BigDecimal]
71
+ if amount.nil?
72
+ amount = java.math.BigDecimal::ZERO
73
+ else
74
+ amount = java.math.BigDecimal.new(amount.to_i)
75
+ end
76
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
77
+ context = context.to_java unless context.nil?
78
+ begin
79
+ res = @real_java_api.create_external_payment(account, invoiceId, amount, context)
80
+ # conversion for res [type = com.ning.billing.payment.api.Payment]
81
+ res = Killbill::Plugin::Model::Payment.new.to_ruby(res) unless res.nil?
82
+ return res
83
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
84
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
85
+ end
86
+ end
87
+
88
+ java_signature 'Java::com.ning.billing.payment.api.Payment retryPayment(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
89
+ def retry_payment(account, paymentId, context)
90
+ # conversion for account [type = com.ning.billing.account.api.Account]
91
+ account = account.to_java unless account.nil?
92
+ # conversion for paymentId [type = java.util.UUID]
93
+ paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
94
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
95
+ context = context.to_java unless context.nil?
96
+ begin
97
+ res = @real_java_api.retry_payment(account, paymentId, context)
98
+ # conversion for res [type = com.ning.billing.payment.api.Payment]
99
+ res = Killbill::Plugin::Model::Payment.new.to_ruby(res) unless res.nil?
100
+ return res
101
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
102
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
103
+ end
104
+ end
105
+
106
+ java_signature 'Java::com.ning.billing.payment.api.Refund createRefund(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::com.ning.billing.util.callcontext.CallContext)'
107
+ def create_refund(account, paymentId, refundAmount, context)
108
+ # conversion for account [type = com.ning.billing.account.api.Account]
109
+ account = account.to_java unless account.nil?
110
+ # conversion for paymentId [type = java.util.UUID]
111
+ paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
112
+ # conversion for refundAmount [type = java.math.BigDecimal]
113
+ if refundAmount.nil?
114
+ refundAmount = java.math.BigDecimal::ZERO
115
+ else
116
+ refundAmount = java.math.BigDecimal.new(refundAmount.to_i)
117
+ end
118
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
119
+ context = context.to_java unless context.nil?
120
+ begin
121
+ res = @real_java_api.create_refund(account, paymentId, refundAmount, context)
122
+ # conversion for res [type = com.ning.billing.payment.api.Refund]
123
+ res = Killbill::Plugin::Model::Refund.new.to_ruby(res) unless res.nil?
124
+ return res
125
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
126
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
127
+ end
128
+ end
129
+
130
+ java_signature 'Java::com.ning.billing.payment.api.Refund getRefund(Java::java.util.UUID, Java::boolean, Java::com.ning.billing.util.callcontext.TenantContext)'
131
+ def get_refund(refundId, withPluginInfo, context)
132
+ # conversion for refundId [type = java.util.UUID]
133
+ refundId = java.util.UUID.fromString(refundId.to_s) unless refundId.nil?
134
+ # conversion for withPluginInfo [type = boolean]
135
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
136
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
137
+ context = context.to_java unless context.nil?
138
+ begin
139
+ res = @real_java_api.get_refund(refundId, withPluginInfo, context)
140
+ # conversion for res [type = com.ning.billing.payment.api.Refund]
141
+ res = Killbill::Plugin::Model::Refund.new.to_ruby(res) unless res.nil?
142
+ return res
143
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
144
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
145
+ end
146
+ end
147
+
148
+ java_signature 'Java::com.ning.billing.payment.api.Refund createRefundWithAdjustment(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::com.ning.billing.util.callcontext.CallContext)'
149
+ def create_refund_with_adjustment(account, paymentId, refundAmount, context)
150
+ # conversion for account [type = com.ning.billing.account.api.Account]
151
+ account = account.to_java unless account.nil?
152
+ # conversion for paymentId [type = java.util.UUID]
153
+ paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
154
+ # conversion for refundAmount [type = java.math.BigDecimal]
155
+ if refundAmount.nil?
156
+ refundAmount = java.math.BigDecimal::ZERO
157
+ else
158
+ refundAmount = java.math.BigDecimal.new(refundAmount.to_i)
159
+ end
160
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
161
+ context = context.to_java unless context.nil?
162
+ begin
163
+ res = @real_java_api.create_refund_with_adjustment(account, paymentId, refundAmount, context)
164
+ # conversion for res [type = com.ning.billing.payment.api.Refund]
165
+ res = Killbill::Plugin::Model::Refund.new.to_ruby(res) unless res.nil?
166
+ return res
167
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
168
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
169
+ end
170
+ end
171
+
172
+ java_signature 'Java::com.ning.billing.payment.api.Refund createRefundWithItemsAdjustments(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::java.util.Set, Java::com.ning.billing.util.callcontext.CallContext)'
173
+ def create_refund_with_items_adjustments(account, paymentId, invoiceItemIds, context)
174
+ # conversion for account [type = com.ning.billing.account.api.Account]
175
+ account = account.to_java unless account.nil?
176
+ # conversion for paymentId [type = java.util.UUID]
177
+ paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
178
+ # conversion for invoiceItemIds [type = java.util.Set]
179
+ tmp = java.util.ArrayList.new
180
+ (invoiceItemIds || []).each do |m|
181
+ # conversion for m [type = java.util.UUID]
182
+ m = java.util.UUID.fromString(m.to_s) unless m.nil?
183
+ tmp.add(m)
184
+ end
185
+ invoiceItemIds = tmp
186
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
187
+ context = context.to_java unless context.nil?
188
+ begin
189
+ res = @real_java_api.create_refund_with_items_adjustments(account, paymentId, invoiceItemIds, context)
190
+ # conversion for res [type = com.ning.billing.payment.api.Refund]
191
+ res = Killbill::Plugin::Model::Refund.new.to_ruby(res) unless res.nil?
192
+ return res
193
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
194
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
195
+ end
196
+ end
197
+
198
+ java_signature 'Java::java.util.List getAccountRefunds(Java::com.ning.billing.account.api.Account, Java::com.ning.billing.util.callcontext.TenantContext)'
199
+ def get_account_refunds(account, context)
200
+ # conversion for account [type = com.ning.billing.account.api.Account]
201
+ account = account.to_java unless account.nil?
202
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
203
+ context = context.to_java unless context.nil?
204
+ begin
205
+ res = @real_java_api.get_account_refunds(account, context)
206
+ # conversion for res [type = java.util.List]
207
+ tmp = []
208
+ (res || []).each do |m|
209
+ # conversion for m [type = com.ning.billing.payment.api.Refund]
210
+ m = Killbill::Plugin::Model::Refund.new.to_ruby(m) unless m.nil?
211
+ tmp << m
212
+ end
213
+ res = tmp
214
+ return res
215
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
216
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
217
+ end
218
+ end
219
+
220
+ java_signature 'Java::java.util.List getPaymentRefunds(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
221
+ def get_payment_refunds(paymentId, context)
222
+ # conversion for paymentId [type = java.util.UUID]
223
+ paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
224
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
225
+ context = context.to_java unless context.nil?
226
+ begin
227
+ res = @real_java_api.get_payment_refunds(paymentId, context)
228
+ # conversion for res [type = java.util.List]
229
+ tmp = []
230
+ (res || []).each do |m|
231
+ # conversion for m [type = com.ning.billing.payment.api.Refund]
232
+ m = Killbill::Plugin::Model::Refund.new.to_ruby(m) unless m.nil?
233
+ tmp << m
234
+ end
235
+ res = tmp
236
+ return res
237
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
238
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
239
+ end
240
+ end
241
+
242
+ java_signature 'Java::java.util.List getInvoicePayments(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
243
+ def get_invoice_payments(invoiceId, context)
244
+ # conversion for invoiceId [type = java.util.UUID]
245
+ invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?
246
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
247
+ context = context.to_java unless context.nil?
248
+ begin
249
+ res = @real_java_api.get_invoice_payments(invoiceId, context)
250
+ # conversion for res [type = java.util.List]
251
+ tmp = []
252
+ (res || []).each do |m|
253
+ # conversion for m [type = com.ning.billing.payment.api.Payment]
254
+ m = Killbill::Plugin::Model::Payment.new.to_ruby(m) unless m.nil?
255
+ tmp << m
256
+ end
257
+ res = tmp
258
+ return res
259
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
260
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
261
+ end
262
+ end
263
+
264
+ java_signature 'Java::java.util.List getAccountPayments(Java::java.util.UUID, Java::com.ning.billing.util.callcontext.TenantContext)'
265
+ def get_account_payments(accountId, context)
266
+ # conversion for accountId [type = java.util.UUID]
267
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
268
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
269
+ context = context.to_java unless context.nil?
270
+ begin
271
+ res = @real_java_api.get_account_payments(accountId, context)
272
+ # conversion for res [type = java.util.List]
273
+ tmp = []
274
+ (res || []).each do |m|
275
+ # conversion for m [type = com.ning.billing.payment.api.Payment]
276
+ m = Killbill::Plugin::Model::Payment.new.to_ruby(m) unless m.nil?
277
+ tmp << m
278
+ end
279
+ res = tmp
280
+ return res
281
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
282
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
283
+ end
284
+ end
285
+
286
+ java_signature 'Java::com.ning.billing.payment.api.Payment getPayment(Java::java.util.UUID, Java::boolean, Java::com.ning.billing.util.callcontext.TenantContext)'
287
+ def get_payment(paymentId, withPluginInfo, context)
288
+ # conversion for paymentId [type = java.util.UUID]
289
+ paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
290
+ # conversion for withPluginInfo [type = boolean]
291
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
292
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
293
+ context = context.to_java unless context.nil?
294
+ begin
295
+ res = @real_java_api.get_payment(paymentId, withPluginInfo, context)
296
+ # conversion for res [type = com.ning.billing.payment.api.Payment]
297
+ res = Killbill::Plugin::Model::Payment.new.to_ruby(res) unless res.nil?
298
+ return res
299
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
300
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
301
+ end
302
+ end
303
+
304
+ java_signature 'Java::java.util.Set getAvailablePlugins()'
305
+ def get_available_plugins()
306
+ res = @real_java_api.get_available_plugins()
307
+ # conversion for res [type = java.util.Set]
308
+ tmp = []
309
+ (res || []).each do |m|
310
+ # conversion for m [type = java.lang.String]
311
+ tmp << m
312
+ end
313
+ res = tmp
314
+ return res
315
+ end
316
+
317
+ java_signature 'Java::java.util.UUID addPaymentMethod(Java::java.lang.String, Java::com.ning.billing.account.api.Account, Java::boolean, Java::com.ning.billing.payment.api.PaymentMethodPlugin, Java::com.ning.billing.util.callcontext.CallContext)'
318
+ def add_payment_method(pluginName, account, setDefault, paymentMethodInfo, context)
319
+ # conversion for pluginName [type = java.lang.String]
320
+ pluginName = pluginName.to_s unless pluginName.nil?
321
+ # conversion for account [type = com.ning.billing.account.api.Account]
322
+ account = account.to_java unless account.nil?
323
+ # conversion for setDefault [type = boolean]
324
+ setDefault = setDefault.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(setDefault)
325
+ # conversion for paymentMethodInfo [type = com.ning.billing.payment.api.PaymentMethodPlugin]
326
+ paymentMethodInfo = paymentMethodInfo.to_java unless paymentMethodInfo.nil?
327
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
328
+ context = context.to_java unless context.nil?
329
+ begin
330
+ res = @real_java_api.add_payment_method(pluginName, account, setDefault, paymentMethodInfo, context)
331
+ # conversion for res [type = java.util.UUID]
332
+ res = res.nil? ? nil : res.to_s
333
+ return res
334
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
335
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
336
+ end
337
+ end
338
+
339
+ java_signature 'Java::java.util.List getPaymentMethods(Java::com.ning.billing.account.api.Account, Java::boolean, Java::com.ning.billing.util.callcontext.TenantContext)'
340
+ def get_payment_methods(account, withPluginInfo, context)
341
+ # conversion for account [type = com.ning.billing.account.api.Account]
342
+ account = account.to_java unless account.nil?
343
+ # conversion for withPluginInfo [type = boolean]
344
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
345
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
346
+ context = context.to_java unless context.nil?
347
+ begin
348
+ res = @real_java_api.get_payment_methods(account, withPluginInfo, context)
349
+ # conversion for res [type = java.util.List]
350
+ tmp = []
351
+ (res || []).each do |m|
352
+ # conversion for m [type = com.ning.billing.payment.api.PaymentMethod]
353
+ m = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(m) unless m.nil?
354
+ tmp << m
355
+ end
356
+ res = tmp
357
+ return res
358
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
359
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
360
+ end
361
+ end
362
+
363
+ java_signature 'Java::com.ning.billing.payment.api.PaymentMethod getPaymentMethodById(Java::java.util.UUID, Java::boolean, Java::boolean, Java::com.ning.billing.util.callcontext.TenantContext)'
364
+ def get_payment_method_by_id(paymentMethodId, includedInactive, withPluginInfo, context)
365
+ # conversion for paymentMethodId [type = java.util.UUID]
366
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
367
+ # conversion for includedInactive [type = boolean]
368
+ includedInactive = includedInactive.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includedInactive)
369
+ # conversion for withPluginInfo [type = boolean]
370
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
371
+ # conversion for context [type = com.ning.billing.util.callcontext.TenantContext]
372
+ context = context.to_java unless context.nil?
373
+ begin
374
+ res = @real_java_api.get_payment_method_by_id(paymentMethodId, includedInactive, withPluginInfo, context)
375
+ # conversion for res [type = com.ning.billing.payment.api.PaymentMethod]
376
+ res = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(res) unless res.nil?
377
+ return res
378
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
379
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
380
+ end
381
+ end
382
+
383
+ java_signature 'Java::void deletedPaymentMethod(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::com.ning.billing.util.callcontext.CallContext)'
384
+ def deleted_payment_method(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, context)
385
+ # conversion for account [type = com.ning.billing.account.api.Account]
386
+ account = account.to_java unless account.nil?
387
+ # conversion for paymentMethodId [type = java.util.UUID]
388
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
389
+ # conversion for deleteDefaultPaymentMethodWithAutoPayOff [type = boolean]
390
+ deleteDefaultPaymentMethodWithAutoPayOff = deleteDefaultPaymentMethodWithAutoPayOff.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(deleteDefaultPaymentMethodWithAutoPayOff)
391
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
392
+ context = context.to_java unless context.nil?
393
+ @real_java_api.deleted_payment_method(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, context)
394
+ end
395
+
396
+ java_signature 'Java::void setDefaultPaymentMethod(Java::com.ning.billing.account.api.Account, Java::java.util.UUID, Java::com.ning.billing.util.callcontext.CallContext)'
397
+ def set_default_payment_method(account, paymentMethodId, context)
398
+ # conversion for account [type = com.ning.billing.account.api.Account]
399
+ account = account.to_java unless account.nil?
400
+ # conversion for paymentMethodId [type = java.util.UUID]
401
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
402
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
403
+ context = context.to_java unless context.nil?
404
+ @real_java_api.set_default_payment_method(account, paymentMethodId, context)
405
+ end
406
+
407
+ java_signature 'Java::java.util.List refreshPaymentMethods(Java::java.lang.String, Java::com.ning.billing.account.api.Account, Java::com.ning.billing.util.callcontext.CallContext)'
408
+ def refresh_payment_methods(pluginName, account, context)
409
+ # conversion for pluginName [type = java.lang.String]
410
+ pluginName = pluginName.to_s unless pluginName.nil?
411
+ # conversion for account [type = com.ning.billing.account.api.Account]
412
+ account = account.to_java unless account.nil?
413
+ # conversion for context [type = com.ning.billing.util.callcontext.CallContext]
414
+ context = context.to_java unless context.nil?
415
+ begin
416
+ res = @real_java_api.refresh_payment_methods(pluginName, account, context)
417
+ # conversion for res [type = java.util.List]
418
+ tmp = []
419
+ (res || []).each do |m|
420
+ # conversion for m [type = com.ning.billing.payment.api.PaymentMethod]
421
+ m = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(m) unless m.nil?
422
+ tmp << m
423
+ end
424
+ res = tmp
425
+ return res
426
+ rescue Java::com.ning.billing.payment.api.PaymentApiException => e
427
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
428
+ end
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
@@ -0,0 +1,66 @@
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
+ class PaymentApiException
31
+
32
+
33
+ attr_accessor :message, :cause, :code
34
+
35
+ def initialize()
36
+ end
37
+
38
+ def to_java()
39
+ # conversion for message [type = java.lang.String]
40
+ @message = @message.to_s unless @message.nil?
41
+
42
+ # conversion for cause [type = java.lang.Throwable]
43
+ @cause = @cause.to_s unless cause.nil?
44
+
45
+ # conversion for code [type = int]
46
+ @code = @code
47
+ Java::com.ning.billing.payment.api.PaymentApiException.new(@message, @cause, @code)
48
+ end
49
+
50
+ def to_ruby(j_obj)
51
+ # conversion for message [type = java.lang.String]
52
+ @message = j_obj.message
53
+
54
+ # conversion for cause [type = java.lang.Throwable]
55
+ @cause = j_obj.cause
56
+ @cause = @cause.to_s unless @cause.nil?
57
+
58
+ # conversion for code [type = int]
59
+ @code = j_obj.code
60
+ self
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end