killbill 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
  # #
@@ -32,7 +33,7 @@ module Killbill
32
33
 
33
34
  include org.killbill.billing.payment.api.DirectPaymentTransaction
34
35
 
35
- attr_accessor :id, :created_date, :updated_date, :direct_payment_id, :transaction_type, :effective_date, :amount, :currency, :gateway_error_code, :gateway_error_msg, :payment_status, :payment_info_plugin
36
+ attr_accessor :id, :created_date, :updated_date, :direct_payment_id, :external_key, :transaction_type, :effective_date, :amount, :currency, :processed_amount, :processed_currency, :gateway_error_code, :gateway_error_msg, :transaction_status, :payment_info_plugin
36
37
 
37
38
  def initialize()
38
39
  end
@@ -56,6 +57,9 @@ module Killbill
56
57
  # conversion for direct_payment_id [type = java.util.UUID]
57
58
  @direct_payment_id = java.util.UUID.fromString(@direct_payment_id.to_s) unless @direct_payment_id.nil?
58
59
 
60
+ # conversion for external_key [type = java.lang.String]
61
+ @external_key = @external_key.to_s unless @external_key.nil?
62
+
59
63
  # conversion for transaction_type [type = org.killbill.billing.payment.api.TransactionType]
60
64
  @transaction_type = Java::org.killbill.billing.payment.api.TransactionType.value_of("#{@transaction_type.to_s}") unless @transaction_type.nil?
61
65
 
@@ -75,16 +79,26 @@ module Killbill
75
79
  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
76
80
  @currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@currency.to_s}") unless @currency.nil?
77
81
 
82
+ # conversion for processed_amount [type = java.math.BigDecimal]
83
+ if @processed_amount.nil?
84
+ @processed_amount = java.math.BigDecimal::ZERO
85
+ else
86
+ @processed_amount = java.math.BigDecimal.new(@processed_amount.to_s)
87
+ end
88
+
89
+ # conversion for processed_currency [type = org.killbill.billing.catalog.api.Currency]
90
+ @processed_currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@processed_currency.to_s}") unless @processed_currency.nil?
91
+
78
92
  # conversion for gateway_error_code [type = java.lang.String]
79
93
  @gateway_error_code = @gateway_error_code.to_s unless @gateway_error_code.nil?
80
94
 
81
95
  # conversion for gateway_error_msg [type = java.lang.String]
82
96
  @gateway_error_msg = @gateway_error_msg.to_s unless @gateway_error_msg.nil?
83
97
 
84
- # conversion for payment_status [type = org.killbill.billing.payment.api.PaymentStatus]
85
- @payment_status = Java::org.killbill.billing.payment.api.PaymentStatus.value_of("#{@payment_status.to_s}") unless @payment_status.nil?
98
+ # conversion for transaction_status [type = org.killbill.billing.payment.api.TransactionStatus]
99
+ @transaction_status = Java::org.killbill.billing.payment.api.TransactionStatus.value_of("#{@transaction_status.to_s}") unless @transaction_status.nil?
86
100
 
87
- # conversion for payment_info_plugin [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
101
+ # conversion for payment_info_plugin [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
88
102
  @payment_info_plugin = @payment_info_plugin.to_java unless @payment_info_plugin.nil?
89
103
  self
90
104
  end
@@ -114,6 +128,9 @@ module Killbill
114
128
  @direct_payment_id = j_obj.direct_payment_id
115
129
  @direct_payment_id = @direct_payment_id.nil? ? nil : @direct_payment_id.to_s
116
130
 
131
+ # conversion for external_key [type = java.lang.String]
132
+ @external_key = j_obj.external_key
133
+
117
134
  # conversion for transaction_type [type = org.killbill.billing.payment.api.TransactionType]
118
135
  @transaction_type = j_obj.transaction_type
119
136
  @transaction_type = @transaction_type.to_s.to_sym unless @transaction_type.nil?
@@ -134,19 +151,27 @@ module Killbill
134
151
  @currency = j_obj.currency
135
152
  @currency = @currency.to_s.to_sym unless @currency.nil?
136
153
 
154
+ # conversion for processed_amount [type = java.math.BigDecimal]
155
+ @processed_amount = j_obj.processed_amount
156
+ @processed_amount = @processed_amount.nil? ? 0 : BigDecimal.new(@processed_amount.to_s)
157
+
158
+ # conversion for processed_currency [type = org.killbill.billing.catalog.api.Currency]
159
+ @processed_currency = j_obj.processed_currency
160
+ @processed_currency = @processed_currency.to_s.to_sym unless @processed_currency.nil?
161
+
137
162
  # conversion for gateway_error_code [type = java.lang.String]
138
163
  @gateway_error_code = j_obj.gateway_error_code
139
164
 
140
165
  # conversion for gateway_error_msg [type = java.lang.String]
141
166
  @gateway_error_msg = j_obj.gateway_error_msg
142
167
 
143
- # conversion for payment_status [type = org.killbill.billing.payment.api.PaymentStatus]
144
- @payment_status = j_obj.payment_status
145
- @payment_status = @payment_status.to_s.to_sym unless @payment_status.nil?
168
+ # conversion for transaction_status [type = org.killbill.billing.payment.api.TransactionStatus]
169
+ @transaction_status = j_obj.transaction_status
170
+ @transaction_status = @transaction_status.to_s.to_sym unless @transaction_status.nil?
146
171
 
147
- # conversion for payment_info_plugin [type = org.killbill.billing.payment.plugin.api.PaymentInfoPlugin]
172
+ # conversion for payment_info_plugin [type = org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin]
148
173
  @payment_info_plugin = j_obj.payment_info_plugin
149
- @payment_info_plugin = Killbill::Plugin::Model::PaymentInfoPlugin.new.to_ruby(@payment_info_plugin) unless @payment_info_plugin.nil?
174
+ @payment_info_plugin = Killbill::Plugin::Model::PaymentTransactionInfoPlugin.new.to_ruby(@payment_info_plugin) unless @payment_info_plugin.nil?
150
175
  self
151
176
  end
152
177
 
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -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
  # #
@@ -81,8 +82,8 @@ module Killbill
81
82
  # conversion for linked_invoice_payment_id [type = java.util.UUID]
82
83
  @linked_invoice_payment_id = java.util.UUID.fromString(@linked_invoice_payment_id.to_s) unless @linked_invoice_payment_id.nil?
83
84
 
84
- # conversion for payment_cookie_id [type = java.util.UUID]
85
- @payment_cookie_id = java.util.UUID.fromString(@payment_cookie_id.to_s) unless @payment_cookie_id.nil?
85
+ # conversion for payment_cookie_id [type = java.lang.String]
86
+ @payment_cookie_id = @payment_cookie_id.to_s unless @payment_cookie_id.nil?
86
87
 
87
88
  # conversion for processed_currency [type = org.killbill.billing.catalog.api.Currency]
88
89
  @processed_currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@processed_currency.to_s}") unless @processed_currency.nil?
@@ -142,9 +143,8 @@ module Killbill
142
143
  @linked_invoice_payment_id = j_obj.linked_invoice_payment_id
143
144
  @linked_invoice_payment_id = @linked_invoice_payment_id.nil? ? nil : @linked_invoice_payment_id.to_s
144
145
 
145
- # conversion for payment_cookie_id [type = java.util.UUID]
146
+ # conversion for payment_cookie_id [type = java.lang.String]
146
147
  @payment_cookie_id = j_obj.payment_cookie_id
147
- @payment_cookie_id = @payment_cookie_id.nil? ? nil : @payment_cookie_id.to_s
148
148
 
149
149
  # conversion for processed_currency [type = org.killbill.billing.catalog.api.Currency]
150
150
  @processed_currency = j_obj.processed_currency
@@ -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,44 +38,6 @@ module Killbill
37
38
  end
38
39
 
39
40
 
40
- java_signature 'Java::java.util.List getAllInvoicesByAccount(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
41
- def get_all_invoices_by_account(accountId, context)
42
-
43
- # conversion for accountId [type = java.util.UUID]
44
- accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
45
-
46
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
47
- context = context.to_java unless context.nil?
48
- res = @real_java_api.get_all_invoices_by_account(accountId, context)
49
- # conversion for res [type = java.util.List]
50
- tmp = []
51
- (res || []).each do |m|
52
- # conversion for m [type = org.killbill.billing.invoice.api.Invoice]
53
- m = Killbill::Plugin::Model::Invoice.new.to_ruby(m) unless m.nil?
54
- tmp << m
55
- end
56
- res = tmp
57
- return res
58
- end
59
-
60
- java_signature 'Java::org.killbill.billing.invoice.api.Invoice getInvoice(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
61
- def get_invoice(invoiceId, context)
62
-
63
- # conversion for invoiceId [type = java.util.UUID]
64
- invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?
65
-
66
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
67
- context = context.to_java unless context.nil?
68
- begin
69
- res = @real_java_api.get_invoice(invoiceId, context)
70
- # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
71
- res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
72
- return res
73
- rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
74
- raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
75
- end
76
- end
77
-
78
41
  java_signature 'Java::java.util.List getInvoicePayments(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
79
42
  def get_invoice_payments(paymentId, context)
80
43
 
@@ -95,106 +58,15 @@ module Killbill
95
58
  return res
96
59
  end
97
60
 
98
- java_signature 'Java::org.killbill.billing.invoice.api.InvoicePayment getInvoicePaymentForAttempt(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
99
- def get_invoice_payment_for_attempt(paymentId, context)
100
-
101
- # conversion for paymentId [type = java.util.UUID]
102
- paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
103
-
104
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
105
- context = context.to_java unless context.nil?
106
- res = @real_java_api.get_invoice_payment_for_attempt(paymentId, context)
107
- # conversion for res [type = org.killbill.billing.invoice.api.InvoicePayment]
108
- res = Killbill::Plugin::Model::InvoicePayment.new.to_ruby(res) unless res.nil?
109
- return res
110
- end
111
-
112
- java_signature 'Java::org.killbill.billing.invoice.api.InvoicePayment createChargeback(Java::java.util.UUID, Java::java.math.BigDecimal, Java::org.killbill.billing.util.callcontext.CallContext)'
113
- def create_chargeback(invoicePaymentId, amount, context)
114
-
115
- # conversion for invoicePaymentId [type = java.util.UUID]
116
- invoicePaymentId = java.util.UUID.fromString(invoicePaymentId.to_s) unless invoicePaymentId.nil?
117
-
118
- # conversion for amount [type = java.math.BigDecimal]
119
- if amount.nil?
120
- amount = java.math.BigDecimal::ZERO
121
- else
122
- amount = java.math.BigDecimal.new(amount.to_s)
123
- end
124
-
125
- # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
126
- context = context.to_java unless context.nil?
127
- begin
128
- res = @real_java_api.create_chargeback(invoicePaymentId, amount, context)
129
- # conversion for res [type = org.killbill.billing.invoice.api.InvoicePayment]
130
- res = Killbill::Plugin::Model::InvoicePayment.new.to_ruby(res) unless res.nil?
131
- return res
132
- rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
133
- raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
134
- end
135
- end
136
-
137
- java_signature 'Java::java.math.BigDecimal getRemainingAmountPaid(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
138
- def get_remaining_amount_paid(invoicePaymentId, context)
139
-
140
- # conversion for invoicePaymentId [type = java.util.UUID]
141
- invoicePaymentId = java.util.UUID.fromString(invoicePaymentId.to_s) unless invoicePaymentId.nil?
142
-
143
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
144
- context = context.to_java unless context.nil?
145
- res = @real_java_api.get_remaining_amount_paid(invoicePaymentId, context)
146
- # conversion for res [type = java.math.BigDecimal]
147
- res = res.nil? ? 0 : BigDecimal.new(res.to_s)
148
- return res
149
- end
150
-
151
- java_signature 'Java::java.util.List getChargebacksByAccountId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
152
- def get_chargebacks_by_account_id(accountId, context)
61
+ java_signature 'Java::java.util.List getInvoicePaymentsByAccount(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
62
+ def get_invoice_payments_by_account(accountId, context)
153
63
 
154
64
  # conversion for accountId [type = java.util.UUID]
155
65
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?
156
66
 
157
67
  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
158
68
  context = context.to_java unless context.nil?
159
- res = @real_java_api.get_chargebacks_by_account_id(accountId, context)
160
- # conversion for res [type = java.util.List]
161
- tmp = []
162
- (res || []).each do |m|
163
- # conversion for m [type = org.killbill.billing.invoice.api.InvoicePayment]
164
- m = Killbill::Plugin::Model::InvoicePayment.new.to_ruby(m) unless m.nil?
165
- tmp << m
166
- end
167
- res = tmp
168
- return res
169
- end
170
-
171
- java_signature 'Java::java.util.UUID getAccountIdFromInvoicePaymentId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
172
- def get_account_id_from_invoice_payment_id(uuid, context)
173
-
174
- # conversion for uuid [type = java.util.UUID]
175
- uuid = java.util.UUID.fromString(uuid.to_s) unless uuid.nil?
176
-
177
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
178
- context = context.to_java unless context.nil?
179
- begin
180
- res = @real_java_api.get_account_id_from_invoice_payment_id(uuid, context)
181
- # conversion for res [type = java.util.UUID]
182
- res = res.nil? ? nil : res.to_s
183
- return res
184
- rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
185
- raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
186
- end
187
- end
188
-
189
- java_signature 'Java::java.util.List getChargebacksByPaymentId(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
190
- def get_chargebacks_by_payment_id(paymentId, context)
191
-
192
- # conversion for paymentId [type = java.util.UUID]
193
- paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?
194
-
195
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
196
- context = context.to_java unless context.nil?
197
- res = @real_java_api.get_chargebacks_by_payment_id(paymentId, context)
69
+ res = @real_java_api.get_invoice_payments_by_account(accountId, context)
198
70
  # conversion for res [type = java.util.List]
199
71
  tmp = []
200
72
  (res || []).each do |m|
@@ -205,24 +77,6 @@ module Killbill
205
77
  res = tmp
206
78
  return res
207
79
  end
208
-
209
- java_signature 'Java::org.killbill.billing.invoice.api.InvoicePayment getChargebackById(Java::java.util.UUID, Java::org.killbill.billing.util.callcontext.TenantContext)'
210
- def get_chargeback_by_id(chargebackId, context)
211
-
212
- # conversion for chargebackId [type = java.util.UUID]
213
- chargebackId = java.util.UUID.fromString(chargebackId.to_s) unless chargebackId.nil?
214
-
215
- # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
216
- context = context.to_java unless context.nil?
217
- begin
218
- res = @real_java_api.get_chargeback_by_id(chargebackId, context)
219
- # conversion for res [type = org.killbill.billing.invoice.api.InvoicePayment]
220
- res = Killbill::Plugin::Model::InvoicePayment.new.to_ruby(res) unless res.nil?
221
- return res
222
- rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
223
- raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
224
- end
225
- end
226
80
  end
227
81
  end
228
82
  end