killbill 3.1.3 → 3.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/Jarfile +7 -5
  3. data/NEWS +3 -0
  4. data/README.md +41 -17
  5. data/VERSION +1 -1
  6. data/generators/active_merchant/templates/Jarfile.rb +7 -5
  7. data/generators/active_merchant/templates/config.yml.rb +3 -3
  8. data/generators/active_merchant/templates/db/ddl.sql.rb +4 -0
  9. data/generators/active_merchant/templates/db/schema.rb +4 -0
  10. data/generators/active_merchant/templates/lib/api.rb +42 -22
  11. data/generators/active_merchant/templates/lib/models/response.rb +3 -1
  12. data/generators/active_merchant/templates/plugin.gemspec.rb +1 -1
  13. data/lib/killbill.rb +7 -4
  14. data/lib/killbill/gen/api/account.rb +4 -3
  15. data/lib/killbill/gen/api/account_api_exception.rb +4 -3
  16. data/lib/killbill/gen/api/account_audit_logs.rb +12 -68
  17. data/lib/killbill/gen/api/account_audit_logs_for_object_type.rb +4 -3
  18. data/lib/killbill/gen/api/account_data.rb +4 -3
  19. data/lib/killbill/gen/api/account_email.rb +4 -3
  20. data/lib/killbill/gen/api/account_user_api.rb +4 -3
  21. data/lib/killbill/gen/api/audit_log.rb +4 -3
  22. data/lib/killbill/gen/api/audit_user_api.rb +4 -3
  23. data/lib/killbill/gen/api/billing_exception_base.rb +4 -3
  24. data/lib/killbill/gen/api/block.rb +4 -3
  25. data/lib/killbill/gen/api/blockable.rb +4 -3
  26. data/lib/killbill/gen/api/blocking_api_exception.rb +4 -3
  27. data/lib/killbill/gen/api/blocking_state.rb +4 -3
  28. data/lib/killbill/gen/api/call_context.rb +4 -3
  29. data/lib/killbill/gen/api/catalog.rb +4 -3
  30. data/lib/killbill/gen/api/catalog_api_exception.rb +4 -3
  31. data/lib/killbill/gen/api/catalog_user_api.rb +4 -3
  32. data/lib/killbill/gen/api/column_info.rb +4 -3
  33. data/lib/killbill/gen/api/control_tag.rb +4 -3
  34. data/lib/killbill/gen/api/currency_conversion.rb +4 -3
  35. data/lib/killbill/gen/api/currency_conversion_api.rb +4 -3
  36. data/lib/killbill/gen/api/currency_conversion_exception.rb +4 -3
  37. data/lib/killbill/gen/api/currency_value_null.rb +4 -3
  38. data/lib/killbill/gen/api/custom_field.rb +4 -3
  39. data/lib/killbill/gen/api/custom_field_api_exception.rb +4 -3
  40. data/lib/killbill/gen/api/custom_field_user_api.rb +4 -3
  41. data/lib/killbill/gen/api/database_export_output_stream.rb +4 -3
  42. data/lib/killbill/gen/api/direct_payment.rb +39 -11
  43. data/lib/killbill/gen/api/direct_payment_api.rb +643 -31
  44. data/lib/killbill/gen/api/direct_payment_transaction.rb +37 -12
  45. data/lib/killbill/gen/api/duration.rb +4 -3
  46. data/lib/killbill/gen/api/entitlement.rb +4 -3
  47. data/lib/killbill/gen/api/entitlement_ao_status_dry_run.rb +4 -3
  48. data/lib/killbill/gen/api/entitlement_api.rb +4 -3
  49. data/lib/killbill/gen/api/entitlement_api_exception.rb +4 -3
  50. data/lib/killbill/gen/api/entity.rb +4 -3
  51. data/lib/killbill/gen/api/fixed.rb +4 -3
  52. data/lib/killbill/gen/api/illegal_plan_change.rb +4 -3
  53. data/lib/killbill/gen/api/international_price.rb +4 -3
  54. data/lib/killbill/gen/api/invalid_config_exception.rb +4 -3
  55. data/lib/killbill/gen/api/invoice.rb +4 -3
  56. data/lib/killbill/gen/api/invoice_api_exception.rb +4 -3
  57. data/lib/killbill/gen/api/invoice_creation_event.rb +4 -3
  58. data/lib/killbill/gen/api/invoice_formatter.rb +4 -3
  59. data/lib/killbill/gen/api/invoice_item.rb +4 -3
  60. data/lib/killbill/gen/api/invoice_item_formatter.rb +4 -3
  61. data/lib/killbill/gen/api/invoice_payment.rb +7 -7
  62. data/lib/killbill/gen/api/invoice_payment_api.rb +7 -153
  63. data/lib/killbill/gen/api/invoice_user_api.rb +22 -3
  64. data/lib/killbill/gen/api/limit.rb +4 -3
  65. data/lib/killbill/gen/api/listing.rb +4 -3
  66. data/lib/killbill/gen/api/migration_plan.rb +4 -3
  67. data/lib/killbill/gen/api/mutable_account_data.rb +4 -3
  68. data/lib/killbill/gen/api/osgi_killbill.rb +15 -7
  69. data/lib/killbill/gen/api/osgi_plugin_properties.rb +4 -3
  70. data/lib/killbill/gen/api/pagination.rb +4 -3
  71. data/lib/killbill/gen/api/payment_api_exception.rb +4 -3
  72. data/lib/killbill/gen/api/payment_gateway_api.rb +4 -3
  73. data/lib/killbill/gen/api/payment_method.rb +11 -4
  74. data/lib/killbill/gen/api/payment_method_plugin.rb +5 -76
  75. data/lib/killbill/gen/api/payment_options.rb +68 -0
  76. data/lib/killbill/gen/api/plan.rb +4 -3
  77. data/lib/killbill/gen/api/plan_change_result.rb +4 -3
  78. data/lib/killbill/gen/api/plan_phase.rb +4 -3
  79. data/lib/killbill/gen/api/plan_phase_specifier.rb +4 -3
  80. data/lib/killbill/gen/api/plan_specifier.rb +4 -3
  81. data/lib/killbill/gen/api/plugin_config_service_api.rb +4 -3
  82. data/lib/killbill/gen/api/plugin_property.rb +4 -3
  83. data/lib/killbill/gen/api/price.rb +4 -3
  84. data/lib/killbill/gen/api/price_list.rb +4 -3
  85. data/lib/killbill/gen/api/price_list_set.rb +4 -3
  86. data/lib/killbill/gen/api/product.rb +4 -3
  87. data/lib/killbill/gen/api/rate.rb +4 -3
  88. data/lib/killbill/gen/api/record_id_api.rb +4 -3
  89. data/lib/killbill/gen/api/recurring.rb +4 -3
  90. data/lib/killbill/gen/api/refund.rb +7 -6
  91. data/lib/killbill/gen/api/require_gen.rb +5 -6
  92. data/lib/killbill/gen/api/rolled_up_usage.rb +4 -3
  93. data/lib/killbill/gen/api/security_api_exception.rb +4 -3
  94. data/lib/killbill/gen/api/static_catalog.rb +4 -3
  95. data/lib/killbill/gen/api/subscription.rb +4 -3
  96. data/lib/killbill/gen/api/subscription_api.rb +4 -3
  97. data/lib/killbill/gen/api/subscription_api_exception.rb +4 -3
  98. data/lib/killbill/gen/api/subscription_bundle.rb +4 -3
  99. data/lib/killbill/gen/api/subscription_bundle_timeline.rb +4 -3
  100. data/lib/killbill/gen/api/subscription_event.rb +4 -3
  101. data/lib/killbill/gen/api/tag.rb +4 -3
  102. data/lib/killbill/gen/api/tag_api_exception.rb +4 -3
  103. data/lib/killbill/gen/api/tag_definition.rb +4 -3
  104. data/lib/killbill/gen/api/tag_definition_api_exception.rb +4 -3
  105. data/lib/killbill/gen/api/tag_user_api.rb +4 -3
  106. data/lib/killbill/gen/api/tenant.rb +4 -3
  107. data/lib/killbill/gen/api/tenant_api_exception.rb +4 -3
  108. data/lib/killbill/gen/api/tenant_context.rb +4 -3
  109. data/lib/killbill/gen/api/tenant_data.rb +4 -3
  110. data/lib/killbill/gen/api/tenant_kv.rb +4 -3
  111. data/lib/killbill/gen/api/tenant_user_api.rb +4 -3
  112. data/lib/killbill/gen/api/tier.rb +4 -3
  113. data/lib/killbill/gen/api/tiered_block.rb +4 -3
  114. data/lib/killbill/gen/api/unit.rb +4 -3
  115. data/lib/killbill/gen/api/usage.rb +4 -3
  116. data/lib/killbill/gen/api/usage_user_api.rb +4 -3
  117. data/lib/killbill/gen/plugin-api/currency_plugin_api.rb +4 -3
  118. data/lib/killbill/gen/plugin-api/ext_bus_event.rb +4 -3
  119. data/lib/killbill/gen/plugin-api/gateway_notification.rb +4 -3
  120. data/lib/killbill/gen/plugin-api/hosted_payment_page_form_descriptor.rb +4 -3
  121. data/lib/killbill/gen/plugin-api/notification_plugin_api.rb +4 -3
  122. data/lib/killbill/gen/plugin-api/payment_method_info_plugin.rb +4 -3
  123. data/lib/killbill/gen/plugin-api/payment_plugin_api.rb +75 -81
  124. data/lib/killbill/gen/plugin-api/payment_plugin_api_exception.rb +4 -3
  125. data/lib/killbill/gen/plugin-api/{payment_info_plugin.rb → payment_transaction_info_plugin.rb} +21 -6
  126. data/lib/killbill/gen/plugin-api/require_gen.rb +5 -5
  127. data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +20 -36
  128. data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +72 -81
  129. data/lib/killbill/helpers/active_merchant/active_record/models/transaction.rb +62 -43
  130. data/lib/killbill/helpers/active_merchant/killbill_spec_helper.rb +0 -13
  131. data/lib/killbill/helpers/active_merchant/payment_plugin.rb +127 -125
  132. data/lib/killbill/http_servlet.rb +16 -1
  133. data/lib/killbill/killbill_api.rb +0 -3
  134. data/lib/killbill/payment.rb +22 -6
  135. data/lib/killbill/rake_task.rb +93 -31
  136. data/spec/killbill/helpers/payment_method_spec.rb +153 -0
  137. data/spec/killbill/helpers/response_spec.rb +58 -15
  138. data/spec/killbill/helpers/test_schema.rb +12 -8
  139. data/spec/killbill/helpers/transaction_spec.rb +134 -0
  140. data/spec/killbill/payment_plugin_api_spec.rb +18 -18
  141. data/spec/killbill/payment_plugin_spec.rb +26 -15
  142. data/spec/killbill/payment_test.rb +6 -7
  143. data/spec/spec_helper.rb +3 -0
  144. metadata +6 -5
  145. data/lib/killbill/gen/api/payment.rb +0 -187
  146. data/lib/killbill/gen/plugin-api/refund_info_plugin.rb +0 -152
@@ -1,10 +1,11 @@
1
1
  ###################################################################################
2
2
  # #
3
3
  # Copyright 2010-2013 Ning, Inc. #
4
+ # Copyright 2014 The Billing Project, LLC #
4
5
  # #
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: #
6
+ # The Billing Project licenses this file to you under the Apache License, #
7
+ # version 2.0 (the "License"); you may not use this file except in #
8
+ # compliance with the License. You may obtain a copy of the License at: #
8
9
  # #
9
10
  # http://www.apache.org/licenses/LICENSE-2.0 #
10
11
  # #
@@ -37,8 +38,57 @@ module Killbill
37
38
  end
38
39
 
39
40
 
40
- java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createAuthorization(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
41
- def create_authorization(account, directPaymentId, amount, currency, externalKey, properties, context)
41
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createAuthorization(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
42
+ def create_authorization(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
43
+
44
+ # conversion for account [type = org.killbill.billing.account.api.Account]
45
+ account = account.to_java unless account.nil?
46
+
47
+ # conversion for paymentMethodId [type = java.util.UUID]
48
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
49
+
50
+ # conversion for directPaymentId [type = java.util.UUID]
51
+ directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
52
+
53
+ # conversion for amount [type = java.math.BigDecimal]
54
+ if amount.nil?
55
+ amount = java.math.BigDecimal::ZERO
56
+ else
57
+ amount = java.math.BigDecimal.new(amount.to_s)
58
+ end
59
+
60
+ # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
61
+ currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
62
+
63
+ # conversion for directPaymentExternalKey [type = java.lang.String]
64
+ directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
65
+
66
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
67
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
68
+
69
+ # conversion for properties [type = java.lang.Iterable]
70
+ tmp = java.util.ArrayList.new
71
+ (properties || []).each do |m|
72
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
73
+ m = m.to_java unless m.nil?
74
+ tmp.add(m)
75
+ end
76
+ properties = tmp
77
+
78
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
79
+ context = context.to_java unless context.nil?
80
+ begin
81
+ res = @real_java_api.create_authorization(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
82
+ # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
83
+ res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
84
+ return res
85
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
86
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
87
+ end
88
+ end
89
+
90
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createCapture(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
91
+ def create_capture(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
42
92
 
43
93
  # conversion for account [type = org.killbill.billing.account.api.Account]
44
94
  account = account.to_java unless account.nil?
@@ -56,8 +106,8 @@ module Killbill
56
106
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
57
107
  currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
58
108
 
59
- # conversion for externalKey [type = java.lang.String]
60
- externalKey = externalKey.to_s unless externalKey.nil?
109
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
110
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
61
111
 
62
112
  # conversion for properties [type = java.lang.Iterable]
63
113
  tmp = java.util.ArrayList.new
@@ -71,7 +121,7 @@ module Killbill
71
121
  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
72
122
  context = context.to_java unless context.nil?
73
123
  begin
74
- res = @real_java_api.create_authorization(account, directPaymentId, amount, currency, externalKey, properties, context)
124
+ res = @real_java_api.create_capture(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
75
125
  # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
76
126
  res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
77
127
  return res
@@ -80,12 +130,15 @@ module Killbill
80
130
  end
81
131
  end
82
132
 
83
- java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createCapture(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
84
- def create_capture(account, directPaymentId, amount, currency, properties, context)
133
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createPurchase(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
134
+ def create_purchase(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
85
135
 
86
136
  # conversion for account [type = org.killbill.billing.account.api.Account]
87
137
  account = account.to_java unless account.nil?
88
138
 
139
+ # conversion for paymentMethodId [type = java.util.UUID]
140
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
141
+
89
142
  # conversion for directPaymentId [type = java.util.UUID]
90
143
  directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
91
144
 
@@ -99,6 +152,12 @@ module Killbill
99
152
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
100
153
  currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
101
154
 
155
+ # conversion for directPaymentExternalKey [type = java.lang.String]
156
+ directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
157
+
158
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
159
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
160
+
102
161
  # conversion for properties [type = java.lang.Iterable]
103
162
  tmp = java.util.ArrayList.new
104
163
  (properties || []).each do |m|
@@ -111,7 +170,7 @@ module Killbill
111
170
  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
112
171
  context = context.to_java unless context.nil?
113
172
  begin
114
- res = @real_java_api.create_capture(account, directPaymentId, amount, currency, properties, context)
173
+ res = @real_java_api.create_purchase(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
115
174
  # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
116
175
  res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
117
176
  return res
@@ -120,12 +179,15 @@ module Killbill
120
179
  end
121
180
  end
122
181
 
123
- java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createPurchase(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
124
- def create_purchase(account, directPaymentId, amount, currency, externalKey, properties, context)
182
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createPurchaseWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
183
+ def create_purchase_with_payment_control(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, paymentOptions, context)
125
184
 
126
185
  # conversion for account [type = org.killbill.billing.account.api.Account]
127
186
  account = account.to_java unless account.nil?
128
187
 
188
+ # conversion for paymentMethodId [type = java.util.UUID]
189
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
190
+
129
191
  # conversion for directPaymentId [type = java.util.UUID]
130
192
  directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
131
193
 
@@ -139,8 +201,11 @@ module Killbill
139
201
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
140
202
  currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
141
203
 
142
- # conversion for externalKey [type = java.lang.String]
143
- externalKey = externalKey.to_s unless externalKey.nil?
204
+ # conversion for directPaymentExternalKey [type = java.lang.String]
205
+ directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
206
+
207
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
208
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
144
209
 
145
210
  # conversion for properties [type = java.lang.Iterable]
146
211
  tmp = java.util.ArrayList.new
@@ -151,10 +216,13 @@ module Killbill
151
216
  end
152
217
  properties = tmp
153
218
 
219
+ # conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
220
+ paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
221
+
154
222
  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
155
223
  context = context.to_java unless context.nil?
156
224
  begin
157
- res = @real_java_api.create_purchase(account, directPaymentId, amount, currency, externalKey, properties, context)
225
+ res = @real_java_api.create_purchase_with_payment_control(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, paymentOptions, context)
158
226
  # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
159
227
  res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
160
228
  return res
@@ -163,8 +231,8 @@ module Killbill
163
231
  end
164
232
  end
165
233
 
166
- java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createVoid(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
167
- def create_void(account, directPaymentId, properties, context)
234
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createVoid(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
235
+ def create_void(account, directPaymentId, directPaymentTransactionExternalKey, properties, context)
168
236
 
169
237
  # conversion for account [type = org.killbill.billing.account.api.Account]
170
238
  account = account.to_java unless account.nil?
@@ -172,6 +240,95 @@ module Killbill
172
240
  # conversion for directPaymentId [type = java.util.UUID]
173
241
  directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
174
242
 
243
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
244
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
245
+
246
+ # conversion for properties [type = java.lang.Iterable]
247
+ tmp = java.util.ArrayList.new
248
+ (properties || []).each do |m|
249
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
250
+ m = m.to_java unless m.nil?
251
+ tmp.add(m)
252
+ end
253
+ properties = tmp
254
+
255
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
256
+ context = context.to_java unless context.nil?
257
+ begin
258
+ res = @real_java_api.create_void(account, directPaymentId, directPaymentTransactionExternalKey, properties, context)
259
+ # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
260
+ res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
261
+ return res
262
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
263
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
264
+ end
265
+ end
266
+
267
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createRefund(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
268
+ def create_refund(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
269
+
270
+ # conversion for account [type = org.killbill.billing.account.api.Account]
271
+ account = account.to_java unless account.nil?
272
+
273
+ # conversion for directPaymentId [type = java.util.UUID]
274
+ directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
275
+
276
+ # conversion for amount [type = java.math.BigDecimal]
277
+ if amount.nil?
278
+ amount = java.math.BigDecimal::ZERO
279
+ else
280
+ amount = java.math.BigDecimal.new(amount.to_s)
281
+ end
282
+
283
+ # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
284
+ currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
285
+
286
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
287
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
288
+
289
+ # conversion for properties [type = java.lang.Iterable]
290
+ tmp = java.util.ArrayList.new
291
+ (properties || []).each do |m|
292
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
293
+ m = m.to_java unless m.nil?
294
+ tmp.add(m)
295
+ end
296
+ properties = tmp
297
+
298
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
299
+ context = context.to_java unless context.nil?
300
+ begin
301
+ res = @real_java_api.create_refund(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, context)
302
+ # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
303
+ res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
304
+ return res
305
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
306
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
307
+ end
308
+ end
309
+
310
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createRefundWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
311
+ def create_refund_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, paymentOptions, context)
312
+
313
+ # conversion for account [type = org.killbill.billing.account.api.Account]
314
+ account = account.to_java unless account.nil?
315
+
316
+ # conversion for directPaymentId [type = java.util.UUID]
317
+ directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
318
+
319
+ # conversion for amount [type = java.math.BigDecimal]
320
+ if amount.nil?
321
+ amount = java.math.BigDecimal::ZERO
322
+ else
323
+ amount = java.math.BigDecimal.new(amount.to_s)
324
+ end
325
+
326
+ # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
327
+ currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
328
+
329
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
330
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
331
+
175
332
  # conversion for properties [type = java.lang.Iterable]
176
333
  tmp = java.util.ArrayList.new
177
334
  (properties || []).each do |m|
@@ -181,10 +338,13 @@ module Killbill
181
338
  end
182
339
  properties = tmp
183
340
 
341
+ # conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
342
+ paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
343
+
184
344
  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
185
345
  context = context.to_java unless context.nil?
186
346
  begin
187
- res = @real_java_api.create_void(account, directPaymentId, properties, context)
347
+ res = @real_java_api.create_refund_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, properties, paymentOptions, context)
188
348
  # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
189
349
  res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
190
350
  return res
@@ -193,12 +353,15 @@ module Killbill
193
353
  end
194
354
  end
195
355
 
196
- java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createCredit(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
197
- def create_credit(account, directPaymentId, amount, currency, properties, context)
356
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createCredit(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
357
+ def create_credit(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
198
358
 
199
359
  # conversion for account [type = org.killbill.billing.account.api.Account]
200
360
  account = account.to_java unless account.nil?
201
361
 
362
+ # conversion for paymentMethodId [type = java.util.UUID]
363
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
364
+
202
365
  # conversion for directPaymentId [type = java.util.UUID]
203
366
  directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
204
367
 
@@ -212,6 +375,12 @@ module Killbill
212
375
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
213
376
  currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
214
377
 
378
+ # conversion for directPaymentExternalKey [type = java.lang.String]
379
+ directPaymentExternalKey = directPaymentExternalKey.to_s unless directPaymentExternalKey.nil?
380
+
381
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
382
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
383
+
215
384
  # conversion for properties [type = java.lang.Iterable]
216
385
  tmp = java.util.ArrayList.new
217
386
  (properties || []).each do |m|
@@ -224,7 +393,41 @@ module Killbill
224
393
  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
225
394
  context = context.to_java unless context.nil?
226
395
  begin
227
- res = @real_java_api.create_credit(account, directPaymentId, amount, currency, properties, context)
396
+ res = @real_java_api.create_credit(account, paymentMethodId, directPaymentId, amount, currency, directPaymentExternalKey, directPaymentTransactionExternalKey, properties, context)
397
+ # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
398
+ res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
399
+ return res
400
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
401
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
402
+ end
403
+ end
404
+
405
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createChargeback(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::org.killbill.billing.util.callcontext.CallContext)'
406
+ def create_chargeback(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, context)
407
+
408
+ # conversion for account [type = org.killbill.billing.account.api.Account]
409
+ account = account.to_java unless account.nil?
410
+
411
+ # conversion for directPaymentId [type = java.util.UUID]
412
+ directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
413
+
414
+ # conversion for amount [type = java.math.BigDecimal]
415
+ if amount.nil?
416
+ amount = java.math.BigDecimal::ZERO
417
+ else
418
+ amount = java.math.BigDecimal.new(amount.to_s)
419
+ end
420
+
421
+ # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
422
+ currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
423
+
424
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
425
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
426
+
427
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
428
+ context = context.to_java unless context.nil?
429
+ begin
430
+ res = @real_java_api.create_chargeback(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, context)
228
431
  # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
229
432
  res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
230
433
  return res
@@ -233,16 +436,102 @@ module Killbill
233
436
  end
234
437
  end
235
438
 
236
- java_signature 'Java::java.util.List getAccountPayments(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
237
- def get_account_payments(accountId, context)
439
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment createChargebackWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.catalog.api.Currency, Java::java.lang.String, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
440
+ def create_chargeback_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, paymentOptions, context)
441
+
442
+ # conversion for account [type = org.killbill.billing.account.api.Account]
443
+ account = account.to_java unless account.nil?
444
+
445
+ # conversion for directPaymentId [type = java.util.UUID]
446
+ directPaymentId = java.util.UUID.fromString(directPaymentId.to_s) unless directPaymentId.nil?
447
+
448
+ # conversion for amount [type = java.math.BigDecimal]
449
+ if amount.nil?
450
+ amount = java.math.BigDecimal::ZERO
451
+ else
452
+ amount = java.math.BigDecimal.new(amount.to_s)
453
+ end
454
+
455
+ # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
456
+ currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{currency.to_s}") unless currency.nil?
457
+
458
+ # conversion for directPaymentTransactionExternalKey [type = java.lang.String]
459
+ directPaymentTransactionExternalKey = directPaymentTransactionExternalKey.to_s unless directPaymentTransactionExternalKey.nil?
460
+
461
+ # conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
462
+ paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
463
+
464
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
465
+ context = context.to_java unless context.nil?
466
+ begin
467
+ res = @real_java_api.create_chargeback_with_payment_control(account, directPaymentId, amount, currency, directPaymentTransactionExternalKey, paymentOptions, context)
468
+ # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
469
+ res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
470
+ return res
471
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
472
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
473
+ end
474
+ end
475
+
476
+ java_signature 'Java::void notifyPendingTransactionOfStateChanged(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::org.killbill.billing.util.callcontext.CallContext)'
477
+ def notify_pending_transaction_of_state_changed(account, directPaymentTransactionId, isSuccess, context)
478
+
479
+ # conversion for account [type = org.killbill.billing.account.api.Account]
480
+ account = account.to_java unless account.nil?
481
+
482
+ # conversion for directPaymentTransactionId [type = java.util.UUID]
483
+ directPaymentTransactionId = java.util.UUID.fromString(directPaymentTransactionId.to_s) unless directPaymentTransactionId.nil?
484
+
485
+ # conversion for isSuccess [type = boolean]
486
+ isSuccess = isSuccess.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(isSuccess)
487
+
488
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
489
+ context = context.to_java unless context.nil?
490
+ @real_java_api.notify_pending_transaction_of_state_changed(account, directPaymentTransactionId, isSuccess, context)
491
+ end
492
+
493
+ java_signature 'Java::void notifyPendingTransactionOfStateChangedWithPaymentControl(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::org.killbill.billing.payment.api.PaymentOptions, Java::org.killbill.billing.util.callcontext.CallContext)'
494
+ def notify_pending_transaction_of_state_changed_with_payment_control(account, directPaymentTransactionId, isSuccess, paymentOptions, context)
495
+
496
+ # conversion for account [type = org.killbill.billing.account.api.Account]
497
+ account = account.to_java unless account.nil?
498
+
499
+ # conversion for directPaymentTransactionId [type = java.util.UUID]
500
+ directPaymentTransactionId = java.util.UUID.fromString(directPaymentTransactionId.to_s) unless directPaymentTransactionId.nil?
501
+
502
+ # conversion for isSuccess [type = boolean]
503
+ isSuccess = isSuccess.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(isSuccess)
504
+
505
+ # conversion for paymentOptions [type = org.killbill.billing.payment.api.PaymentOptions]
506
+ paymentOptions = paymentOptions.to_java unless paymentOptions.nil?
507
+
508
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
509
+ context = context.to_java unless context.nil?
510
+ @real_java_api.notify_pending_transaction_of_state_changed_with_payment_control(account, directPaymentTransactionId, isSuccess, paymentOptions, context)
511
+ end
512
+
513
+ java_signature 'Java::java.util.List getAccountPayments(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
514
+ def get_account_payments(accountId, withPluginInfo, properties, context)
238
515
 
239
516
  # conversion for accountId [type = java.util.UUID]
240
517
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
241
518
 
519
+ # conversion for withPluginInfo [type = boolean]
520
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
521
+
522
+ # conversion for properties [type = java.lang.Iterable]
523
+ tmp = java.util.ArrayList.new
524
+ (properties || []).each do |m|
525
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
526
+ m = m.to_java unless m.nil?
527
+ tmp.add(m)
528
+ end
529
+ properties = tmp
530
+
242
531
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
243
532
  context = context.to_java unless context.nil?
244
533
  begin
245
- res = @real_java_api.get_account_payments(accountId, context)
534
+ res = @real_java_api.get_account_payments(accountId, withPluginInfo, properties, context)
246
535
  # conversion for res [type = java.util.List]
247
536
  tmp = []
248
537
  (res || []).each do |m|
@@ -287,8 +576,240 @@ module Killbill
287
576
  end
288
577
  end
289
578
 
290
- java_signature 'Java::org.killbill.billing.util.entity.Pagination getPayments(Java::java.lang.Long, Java::java.lang.Long, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
291
- def get_payments(offset, limit, properties, context)
579
+ java_signature 'Java::org.killbill.billing.payment.api.DirectPayment getPaymentByExternalKey(Java::java.lang.String, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
580
+ def get_payment_by_external_key(paymentExternalKey, withPluginInfo, properties, context)
581
+
582
+ # conversion for paymentExternalKey [type = java.lang.String]
583
+ paymentExternalKey = paymentExternalKey.to_s unless paymentExternalKey.nil?
584
+
585
+ # conversion for withPluginInfo [type = boolean]
586
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
587
+
588
+ # conversion for properties [type = java.lang.Iterable]
589
+ tmp = java.util.ArrayList.new
590
+ (properties || []).each do |m|
591
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
592
+ m = m.to_java unless m.nil?
593
+ tmp.add(m)
594
+ end
595
+ properties = tmp
596
+
597
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
598
+ context = context.to_java unless context.nil?
599
+ begin
600
+ res = @real_java_api.get_payment_by_external_key(paymentExternalKey, withPluginInfo, properties, context)
601
+ # conversion for res [type = org.killbill.billing.payment.api.DirectPayment]
602
+ res = Killbill::Plugin::Model::DirectPayment.new.to_ruby(res) unless res.nil?
603
+ return res
604
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
605
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
606
+ end
607
+ end
608
+
609
+ java_signature 'Java::org.killbill.billing.util.entity.Pagination getPayments(Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
610
+ def get_payments(offset, limit, withPluginInfo, properties, context)
611
+
612
+ # conversion for offset [type = java.lang.Long]
613
+ offset = offset
614
+
615
+ # conversion for limit [type = java.lang.Long]
616
+ limit = limit
617
+
618
+ # conversion for withPluginInfo [type = boolean]
619
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
620
+
621
+ # conversion for properties [type = java.lang.Iterable]
622
+ tmp = java.util.ArrayList.new
623
+ (properties || []).each do |m|
624
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
625
+ m = m.to_java unless m.nil?
626
+ tmp.add(m)
627
+ end
628
+ properties = tmp
629
+
630
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
631
+ context = context.to_java unless context.nil?
632
+ res = @real_java_api.get_payments(offset, limit, withPluginInfo, properties, context)
633
+ # conversion for res [type = org.killbill.billing.util.entity.Pagination]
634
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
635
+ return res
636
+ end
637
+
638
+ java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPayments(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
639
+ def search_payments(searchKey, offset, limit, withPluginInfo, properties, context)
640
+
641
+ # conversion for searchKey [type = java.lang.String]
642
+ searchKey = searchKey.to_s unless searchKey.nil?
643
+
644
+ # conversion for offset [type = java.lang.Long]
645
+ offset = offset
646
+
647
+ # conversion for limit [type = java.lang.Long]
648
+ limit = limit
649
+
650
+ # conversion for withPluginInfo [type = boolean]
651
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
652
+
653
+ # conversion for properties [type = java.lang.Iterable]
654
+ tmp = java.util.ArrayList.new
655
+ (properties || []).each do |m|
656
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
657
+ m = m.to_java unless m.nil?
658
+ tmp.add(m)
659
+ end
660
+ properties = tmp
661
+
662
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
663
+ context = context.to_java unless context.nil?
664
+ res = @real_java_api.search_payments(searchKey, offset, limit, withPluginInfo, properties, context)
665
+ # conversion for res [type = org.killbill.billing.util.entity.Pagination]
666
+ res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
667
+ return res
668
+ end
669
+
670
+ java_signature 'Java::java.util.UUID addPaymentMethod(Java::org.killbill.billing.account.api.Account, Java::java.lang.String, Java::java.lang.String, Java::boolean, Java::org.killbill.billing.payment.api.PaymentMethodPlugin, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
671
+ def add_payment_method(account, paymentMethodExternalKey, pluginName, setDefault, paymentMethodInfo, properties, context)
672
+
673
+ # conversion for account [type = org.killbill.billing.account.api.Account]
674
+ account = account.to_java unless account.nil?
675
+
676
+ # conversion for paymentMethodExternalKey [type = java.lang.String]
677
+ paymentMethodExternalKey = paymentMethodExternalKey.to_s unless paymentMethodExternalKey.nil?
678
+
679
+ # conversion for pluginName [type = java.lang.String]
680
+ pluginName = pluginName.to_s unless pluginName.nil?
681
+
682
+ # conversion for setDefault [type = boolean]
683
+ setDefault = setDefault.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(setDefault)
684
+
685
+ # conversion for paymentMethodInfo [type = org.killbill.billing.payment.api.PaymentMethodPlugin]
686
+ paymentMethodInfo = paymentMethodInfo.to_java unless paymentMethodInfo.nil?
687
+
688
+ # conversion for properties [type = java.lang.Iterable]
689
+ tmp = java.util.ArrayList.new
690
+ (properties || []).each do |m|
691
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
692
+ m = m.to_java unless m.nil?
693
+ tmp.add(m)
694
+ end
695
+ properties = tmp
696
+
697
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
698
+ context = context.to_java unless context.nil?
699
+ begin
700
+ res = @real_java_api.add_payment_method(account, paymentMethodExternalKey, pluginName, setDefault, paymentMethodInfo, properties, context)
701
+ # conversion for res [type = java.util.UUID]
702
+ res = res.nil? ? nil : res.to_s
703
+ return res
704
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
705
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
706
+ end
707
+ end
708
+
709
+ java_signature 'Java::java.util.List getAccountPaymentMethods(Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
710
+ def get_account_payment_methods(accountId, withPluginInfo, properties, context)
711
+
712
+ # conversion for accountId [type = java.util.UUID]
713
+ accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
714
+
715
+ # conversion for withPluginInfo [type = boolean]
716
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
717
+
718
+ # conversion for properties [type = java.lang.Iterable]
719
+ tmp = java.util.ArrayList.new
720
+ (properties || []).each do |m|
721
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
722
+ m = m.to_java unless m.nil?
723
+ tmp.add(m)
724
+ end
725
+ properties = tmp
726
+
727
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
728
+ context = context.to_java unless context.nil?
729
+ begin
730
+ res = @real_java_api.get_account_payment_methods(accountId, withPluginInfo, properties, context)
731
+ # conversion for res [type = java.util.List]
732
+ tmp = []
733
+ (res || []).each do |m|
734
+ # conversion for m [type = org.killbill.billing.payment.api.PaymentMethod]
735
+ m = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(m) unless m.nil?
736
+ tmp << m
737
+ end
738
+ res = tmp
739
+ return res
740
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
741
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
742
+ end
743
+ end
744
+
745
+ java_signature 'Java::org.killbill.billing.payment.api.PaymentMethod getPaymentMethodById(Java::java.util.UUID, Java::boolean, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
746
+ def get_payment_method_by_id(paymentMethodId, includedInactive, withPluginInfo, properties, context)
747
+
748
+ # conversion for paymentMethodId [type = java.util.UUID]
749
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
750
+
751
+ # conversion for includedInactive [type = boolean]
752
+ includedInactive = includedInactive.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includedInactive)
753
+
754
+ # conversion for withPluginInfo [type = boolean]
755
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
756
+
757
+ # conversion for properties [type = java.lang.Iterable]
758
+ tmp = java.util.ArrayList.new
759
+ (properties || []).each do |m|
760
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
761
+ m = m.to_java unless m.nil?
762
+ tmp.add(m)
763
+ end
764
+ properties = tmp
765
+
766
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
767
+ context = context.to_java unless context.nil?
768
+ begin
769
+ res = @real_java_api.get_payment_method_by_id(paymentMethodId, includedInactive, withPluginInfo, properties, context)
770
+ # conversion for res [type = org.killbill.billing.payment.api.PaymentMethod]
771
+ res = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(res) unless res.nil?
772
+ return res
773
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
774
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
775
+ end
776
+ end
777
+
778
+ java_signature 'Java::org.killbill.billing.payment.api.PaymentMethod getPaymentMethodByExternalKey(Java::java.lang.String, Java::boolean, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
779
+ def get_payment_method_by_external_key(paymentMethodExternalKey, includedInactive, withPluginInfo, properties, context)
780
+
781
+ # conversion for paymentMethodExternalKey [type = java.lang.String]
782
+ paymentMethodExternalKey = paymentMethodExternalKey.to_s unless paymentMethodExternalKey.nil?
783
+
784
+ # conversion for includedInactive [type = boolean]
785
+ includedInactive = includedInactive.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includedInactive)
786
+
787
+ # conversion for withPluginInfo [type = boolean]
788
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
789
+
790
+ # conversion for properties [type = java.lang.Iterable]
791
+ tmp = java.util.ArrayList.new
792
+ (properties || []).each do |m|
793
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
794
+ m = m.to_java unless m.nil?
795
+ tmp.add(m)
796
+ end
797
+ properties = tmp
798
+
799
+ # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
800
+ context = context.to_java unless context.nil?
801
+ begin
802
+ res = @real_java_api.get_payment_method_by_external_key(paymentMethodExternalKey, includedInactive, withPluginInfo, properties, context)
803
+ # conversion for res [type = org.killbill.billing.payment.api.PaymentMethod]
804
+ res = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(res) unless res.nil?
805
+ return res
806
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
807
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
808
+ end
809
+ end
810
+
811
+ java_signature 'Java::org.killbill.billing.util.entity.Pagination getPaymentMethods(Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
812
+ def get_payment_methods(offset, limit, withPluginInfo, properties, context)
292
813
 
293
814
  # conversion for offset [type = java.lang.Long]
294
815
  offset = offset
@@ -296,6 +817,9 @@ module Killbill
296
817
  # conversion for limit [type = java.lang.Long]
297
818
  limit = limit
298
819
 
820
+ # conversion for withPluginInfo [type = boolean]
821
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
822
+
299
823
  # conversion for properties [type = java.lang.Iterable]
300
824
  tmp = java.util.ArrayList.new
301
825
  (properties || []).each do |m|
@@ -307,14 +831,14 @@ module Killbill
307
831
 
308
832
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
309
833
  context = context.to_java unless context.nil?
310
- res = @real_java_api.get_payments(offset, limit, properties, context)
834
+ res = @real_java_api.get_payment_methods(offset, limit, withPluginInfo, properties, context)
311
835
  # conversion for res [type = org.killbill.billing.util.entity.Pagination]
312
836
  res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
313
837
  return res
314
838
  end
315
839
 
316
- java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPayments(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
317
- def search_payments(searchKey, offset, limit, properties, context)
840
+ java_signature 'Java::org.killbill.billing.util.entity.Pagination searchPaymentMethods(Java::java.lang.String, Java::java.lang.Long, Java::java.lang.Long, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.TenantContext)'
841
+ def search_payment_methods(searchKey, offset, limit, withPluginInfo, properties, context)
318
842
 
319
843
  # conversion for searchKey [type = java.lang.String]
320
844
  searchKey = searchKey.to_s unless searchKey.nil?
@@ -325,6 +849,9 @@ module Killbill
325
849
  # conversion for limit [type = java.lang.Long]
326
850
  limit = limit
327
851
 
852
+ # conversion for withPluginInfo [type = boolean]
853
+ withPluginInfo = withPluginInfo.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(withPluginInfo)
854
+
328
855
  # conversion for properties [type = java.lang.Iterable]
329
856
  tmp = java.util.ArrayList.new
330
857
  (properties || []).each do |m|
@@ -336,11 +863,96 @@ module Killbill
336
863
 
337
864
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
338
865
  context = context.to_java unless context.nil?
339
- res = @real_java_api.search_payments(searchKey, offset, limit, properties, context)
866
+ res = @real_java_api.search_payment_methods(searchKey, offset, limit, withPluginInfo, properties, context)
340
867
  # conversion for res [type = org.killbill.billing.util.entity.Pagination]
341
868
  res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
342
869
  return res
343
870
  end
871
+
872
+ java_signature 'Java::void deletePaymentMethod(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::boolean, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
873
+ def delete_payment_method(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, properties, context)
874
+
875
+ # conversion for account [type = org.killbill.billing.account.api.Account]
876
+ account = account.to_java unless account.nil?
877
+
878
+ # conversion for paymentMethodId [type = java.util.UUID]
879
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
880
+
881
+ # conversion for deleteDefaultPaymentMethodWithAutoPayOff [type = boolean]
882
+ deleteDefaultPaymentMethodWithAutoPayOff = deleteDefaultPaymentMethodWithAutoPayOff.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(deleteDefaultPaymentMethodWithAutoPayOff)
883
+
884
+ # conversion for properties [type = java.lang.Iterable]
885
+ tmp = java.util.ArrayList.new
886
+ (properties || []).each do |m|
887
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
888
+ m = m.to_java unless m.nil?
889
+ tmp.add(m)
890
+ end
891
+ properties = tmp
892
+
893
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
894
+ context = context.to_java unless context.nil?
895
+ @real_java_api.delete_payment_method(account, paymentMethodId, deleteDefaultPaymentMethodWithAutoPayOff, properties, context)
896
+ end
897
+
898
+ java_signature 'Java::void setDefaultPaymentMethod(Java::org.killbill.billing.account.api.Account, Java::java.util.UUID, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
899
+ def set_default_payment_method(account, paymentMethodId, properties, context)
900
+
901
+ # conversion for account [type = org.killbill.billing.account.api.Account]
902
+ account = account.to_java unless account.nil?
903
+
904
+ # conversion for paymentMethodId [type = java.util.UUID]
905
+ paymentMethodId = java.util.UUID.fromString(paymentMethodId.to_s) unless paymentMethodId.nil?
906
+
907
+ # conversion for properties [type = java.lang.Iterable]
908
+ tmp = java.util.ArrayList.new
909
+ (properties || []).each do |m|
910
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
911
+ m = m.to_java unless m.nil?
912
+ tmp.add(m)
913
+ end
914
+ properties = tmp
915
+
916
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
917
+ context = context.to_java unless context.nil?
918
+ @real_java_api.set_default_payment_method(account, paymentMethodId, properties, context)
919
+ end
920
+
921
+ java_signature 'Java::java.util.List refreshPaymentMethods(Java::org.killbill.billing.account.api.Account, Java::java.lang.String, Java::java.lang.Iterable, Java::org.killbill.billing.util.callcontext.CallContext)'
922
+ def refresh_payment_methods(account, pluginName, properties, context)
923
+
924
+ # conversion for account [type = org.killbill.billing.account.api.Account]
925
+ account = account.to_java unless account.nil?
926
+
927
+ # conversion for pluginName [type = java.lang.String]
928
+ pluginName = pluginName.to_s unless pluginName.nil?
929
+
930
+ # conversion for properties [type = java.lang.Iterable]
931
+ tmp = java.util.ArrayList.new
932
+ (properties || []).each do |m|
933
+ # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
934
+ m = m.to_java unless m.nil?
935
+ tmp.add(m)
936
+ end
937
+ properties = tmp
938
+
939
+ # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
940
+ context = context.to_java unless context.nil?
941
+ begin
942
+ res = @real_java_api.refresh_payment_methods(account, pluginName, properties, context)
943
+ # conversion for res [type = java.util.List]
944
+ tmp = []
945
+ (res || []).each do |m|
946
+ # conversion for m [type = org.killbill.billing.payment.api.PaymentMethod]
947
+ m = Killbill::Plugin::Model::PaymentMethod.new.to_ruby(m) unless m.nil?
948
+ tmp << m
949
+ end
950
+ res = tmp
951
+ return res
952
+ rescue Java::org.killbill.billing.payment.api.PaymentApiException => e
953
+ raise Killbill::Plugin::Model::PaymentApiException.new.to_ruby(e)
954
+ end
955
+ end
344
956
  end
345
957
  end
346
958
  end