killbill 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/Jarfile +4 -2
  2. data/VERSION +1 -1
  3. data/lib/killbill.rb +69 -13
  4. data/lib/killbill/creator.rb +16 -2
  5. data/lib/killbill/enum.rb +72 -0
  6. data/lib/killbill/gen/account.rb +43 -0
  7. data/lib/killbill/gen/account_data.rb +39 -0
  8. data/lib/killbill/gen/account_email.rb +25 -0
  9. data/lib/killbill/gen/audit_log.rb +28 -0
  10. data/lib/killbill/gen/blocking_state.rb +32 -0
  11. data/lib/killbill/gen/call_context.rb +29 -0
  12. data/lib/killbill/gen/call_origin.rb +34 -0
  13. data/lib/killbill/gen/currency.rb +34 -0
  14. data/lib/killbill/gen/custom_field.rb +27 -0
  15. data/lib/killbill/gen/date_time_zone.rb +35 -0
  16. data/lib/killbill/gen/ext_bus_event.rb +25 -0
  17. data/lib/killbill/gen/ext_bus_event_type.rb +34 -0
  18. data/lib/killbill/gen/invoice.rb +39 -0
  19. data/lib/killbill/gen/invoice_item.rb +37 -0
  20. data/lib/killbill/gen/invoice_payment.rb +31 -0
  21. data/lib/killbill/gen/invoice_payment_type.rb +34 -0
  22. data/lib/killbill/gen/object_type.rb +34 -0
  23. data/lib/killbill/gen/payment.rb +36 -0
  24. data/lib/killbill/gen/payment_attempt.rb +27 -0
  25. data/lib/killbill/gen/payment_info_plugin.rb +28 -0
  26. data/lib/killbill/gen/payment_method_info_plugin.rb +24 -0
  27. data/lib/killbill/gen/payment_method_kv_info.rb +21 -0
  28. data/lib/killbill/gen/payment_method_plugin.rb +36 -0
  29. data/lib/killbill/gen/payment_plugin_status.rb +34 -0
  30. data/lib/killbill/gen/refund.rb +29 -0
  31. data/lib/killbill/gen/refund_info_plugin.rb +27 -0
  32. data/lib/killbill/gen/refund_plugin_status.rb +34 -0
  33. data/lib/killbill/gen/require_gen.rb +38 -0
  34. data/lib/killbill/gen/subscription.rb +44 -0
  35. data/lib/killbill/gen/subscription_bundle.rb +27 -0
  36. data/lib/killbill/gen/subscription_source_type.rb +34 -0
  37. data/lib/killbill/gen/subscription_state.rb +34 -0
  38. data/lib/killbill/gen/tag.rb +26 -0
  39. data/lib/killbill/gen/tag_definition.rb +27 -0
  40. data/lib/killbill/gen/tenant_context.rb +21 -0
  41. data/lib/killbill/gen/user_type.rb +34 -0
  42. data/lib/killbill/gen/uuid.rb +22 -0
  43. data/lib/killbill/http_servlet.rb +10 -3
  44. data/lib/killbill/jconverter.rb +540 -0
  45. data/lib/killbill/jkillbill_api.rb +137 -0
  46. data/lib/killbill/jnotification.rb +0 -1
  47. data/lib/killbill/jpayment.rb +7 -19
  48. data/lib/killbill/jplugin.rb +27 -16
  49. data/lib/killbill/killbill_api.rb +28 -0
  50. data/lib/killbill/killbill_logger.rb +31 -8
  51. data/lib/killbill/notification.rb +0 -1
  52. data/lib/killbill/payment.rb +0 -5
  53. data/lib/killbill/plugin.rb +4 -46
  54. data/spec/killbill/base_plugin_spec.rb +2 -1
  55. data/spec/killbill/{jresponse/jconverter_spec.rb → jconverter_spec.rb} +46 -90
  56. data/spec/killbill/jnotification_spec.rb +2 -1
  57. data/spec/killbill/jpayment_spec.rb +17 -16
  58. data/spec/killbill/killbill_integration_spec.rb +1 -1
  59. data/spec/killbill/killbillapi_spec.rb +49 -0
  60. data/spec/killbill/payment_test.rb +5 -5
  61. data/spec/killbill/rack_handler_spec.rb +1 -2
  62. data/spec/spec_helper.rb +3 -0
  63. data/tools/java2ruby.rb +440 -0
  64. metadata +48 -26
  65. data/lib/killbill/jresponse/jconverter.rb +0 -126
  66. data/lib/killbill/jresponse/jevent.rb +0 -58
  67. data/lib/killbill/jresponse/jpayment_method_response.rb +0 -148
  68. data/lib/killbill/jresponse/jpayment_method_response_internal.rb +0 -54
  69. data/lib/killbill/jresponse/jpayment_response.rb +0 -74
  70. data/lib/killbill/jresponse/jrefund_response.rb +0 -68
  71. data/lib/killbill/response/event.rb +0 -18
  72. data/lib/killbill/response/payment_method_response.rb +0 -50
  73. data/lib/killbill/response/payment_method_response_internal.rb +0 -20
  74. data/lib/killbill/response/payment_response.rb +0 -26
  75. data/lib/killbill/response/payment_status.rb +0 -10
  76. data/lib/killbill/response/refund_response.rb +0 -25
  77. data/spec/killbill/jresponse/jevent_spec.rb +0 -18
  78. data/spec/killbill/jresponse/jpayment_method_response_internal_spec.rb +0 -34
  79. data/spec/killbill/jresponse/jpayment_method_response_spec.rb +0 -53
  80. data/spec/killbill/jresponse/jpayment_response_spec.rb +0 -41
  81. data/spec/killbill/jresponse/jrefund_response_spec.rb +0 -41
@@ -0,0 +1,34 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class Currency
10
+
11
+ @@admissible_values = [:GBP, :MXN, :BRL, :EUR, :AUD, :USD]
12
+ attr_reader :enum
13
+
14
+ def initialize(value)
15
+ raise ArgumentError.new("Enum Currency does not have such value : #{value}") if ! Currency.is_admissible_value?(value)
16
+ @enum = value
17
+ end
18
+
19
+ def ==(other)
20
+ return false if other.nil?
21
+ self.enum == other.enum
22
+ end
23
+
24
+ def self.is_admissible_value?(value)
25
+ @@admissible_values.include?(value)
26
+ end
27
+
28
+ def self.admissible_values
29
+ @@admissible_values
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class CustomField
10
+
11
+ include com.ning.billing.util.customfield.CustomField
12
+
13
+ attr_reader :id, :created_date, :updated_date, :object_id, :object_type, :field_name, :field_value
14
+
15
+ def initialize(id, created_date, updated_date, object_id, object_type, field_name, field_value)
16
+ @id = id
17
+ @created_date = created_date
18
+ @updated_date = updated_date
19
+ @object_id = object_id
20
+ @object_type = object_type
21
+ @field_name = field_name
22
+ @field_value = field_value
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,35 @@
1
+
2
+
3
+ #
4
+ # TODO STEPH Should have been generated--- but not yet
5
+ #
6
+ module Killbill
7
+ module Plugin
8
+ module Model
9
+
10
+ class DateTimeZone
11
+
12
+ @@admissible_values = [:UTC]
13
+ attr_reader :enum
14
+
15
+ def initialize(value)
16
+ raise ArgumentError.new("Enum DateTimeZone does not have such value : #{value}") if ! DateTimeZone.is_admissible_value?(value)
17
+ @enum = value
18
+ end
19
+
20
+ def ==(other)
21
+ return false if other.nil?
22
+ self.enum == other.enum
23
+ end
24
+
25
+ def self.is_admissible_value?(value)
26
+ @@admissible_values.include?(value)
27
+ end
28
+
29
+ def self.admissible_values
30
+ @@admissible_values
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class ExtBusEvent
10
+
11
+ include com.ning.billing.beatrix.bus.api.ExtBusEvent
12
+
13
+ attr_reader :event_type, :object_type, :object_id, :account_id, :tenant_id
14
+
15
+ def initialize(event_type, object_type, object_id, account_id, tenant_id)
16
+ @event_type = event_type
17
+ @object_type = object_type
18
+ @object_id = object_id
19
+ @account_id = account_id
20
+ @tenant_id = tenant_id
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,34 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class ExtBusEventType
10
+
11
+ @@admissible_values = [:ACCOUNT_CREATION, :ACCOUNT_CHANGE, :SUBSCRIPTION_CREATION, :SUBSCRIPTION_PHASE, :SUBSCRIPTION_CHANGE, :SUBSCRIPTION_CANCEL, :SUBSCRIPTION_UNCANCEL, :OVERDUE_CHANGE, :INVOICE_CREATION, :INVOICE_ADJUSTMENT, :PAYMENT_SUCCESS, :PAYMENT_FAILED, :TAG_CREATION, :TAG_DELETION, :CUSTOM_FIELD_CREATION, :CUSTOM_FIELD_DELETION]
12
+ attr_reader :enum
13
+
14
+ def initialize(value)
15
+ raise ArgumentError.new("Enum ExtBusEventType does not have such value : #{value}") if ! ExtBusEventType.is_admissible_value?(value)
16
+ @enum = value
17
+ end
18
+
19
+ def ==(other)
20
+ return false if other.nil?
21
+ self.enum == other.enum
22
+ end
23
+
24
+ def self.is_admissible_value?(value)
25
+ @@admissible_values.include?(value)
26
+ end
27
+
28
+ def self.admissible_values
29
+ @@admissible_values
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,39 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class Invoice
10
+
11
+ include com.ning.billing.invoice.api.Invoice
12
+
13
+ attr_reader :id, :created_date, :updated_date, :invoice_items, :number_of_items, :payments, :number_of_payments, :account_id, :invoice_number, :invoice_date, :target_date, :currency, :paid_amount, :original_charged_amount, :charged_amount, :credited_amount, :refunded_amount, :balance, :is_migration_invoice
14
+
15
+ def initialize(id, created_date, updated_date, invoice_items, number_of_items, payments, number_of_payments, account_id, invoice_number, invoice_date, target_date, currency, paid_amount, original_charged_amount, charged_amount, credited_amount, refunded_amount, balance, is_migration_invoice)
16
+ @id = id
17
+ @created_date = created_date
18
+ @updated_date = updated_date
19
+ @invoice_items = invoice_items
20
+ @number_of_items = number_of_items
21
+ @payments = payments
22
+ @number_of_payments = number_of_payments
23
+ @account_id = account_id
24
+ @invoice_number = invoice_number
25
+ @invoice_date = invoice_date
26
+ @target_date = target_date
27
+ @currency = currency
28
+ @paid_amount = paid_amount
29
+ @original_charged_amount = original_charged_amount
30
+ @charged_amount = charged_amount
31
+ @credited_amount = credited_amount
32
+ @refunded_amount = refunded_amount
33
+ @balance = balance
34
+ @is_migration_invoice = is_migration_invoice
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,37 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class InvoiceItem
10
+
11
+ include com.ning.billing.invoice.api.InvoiceItem
12
+
13
+ attr_reader :id, :created_date, :updated_date, :invoice_item_type, :invoice_id, :account_id, :start_date, :end_date, :amount, :currency, :description, :bundle_id, :subscription_id, :plan_name, :phase_name, :rate, :linked_item_id
14
+
15
+ def initialize(id, created_date, updated_date, invoice_item_type, invoice_id, account_id, start_date, end_date, amount, currency, description, bundle_id, subscription_id, plan_name, phase_name, rate, linked_item_id)
16
+ @id = id
17
+ @created_date = created_date
18
+ @updated_date = updated_date
19
+ @invoice_item_type = invoice_item_type
20
+ @invoice_id = invoice_id
21
+ @account_id = account_id
22
+ @start_date = start_date
23
+ @end_date = end_date
24
+ @amount = amount
25
+ @currency = currency
26
+ @description = description
27
+ @bundle_id = bundle_id
28
+ @subscription_id = subscription_id
29
+ @plan_name = plan_name
30
+ @phase_name = phase_name
31
+ @rate = rate
32
+ @linked_item_id = linked_item_id
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,31 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class InvoicePayment
10
+
11
+ include com.ning.billing.invoice.api.InvoicePayment
12
+
13
+ attr_reader :id, :created_date, :updated_date, :payment_id, :type, :invoice_id, :payment_date, :amount, :currency, :linked_invoice_payment_id, :payment_cookie_id
14
+
15
+ def initialize(id, created_date, updated_date, payment_id, type, invoice_id, payment_date, amount, currency, linked_invoice_payment_id, payment_cookie_id)
16
+ @id = id
17
+ @created_date = created_date
18
+ @updated_date = updated_date
19
+ @payment_id = payment_id
20
+ @type = type
21
+ @invoice_id = invoice_id
22
+ @payment_date = payment_date
23
+ @amount = amount
24
+ @currency = currency
25
+ @linked_invoice_payment_id = linked_invoice_payment_id
26
+ @payment_cookie_id = payment_cookie_id
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,34 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class InvoicePaymentType
10
+
11
+ @@admissible_values = [:ATTEMPT, :CHARGED_BACK, :REFUND]
12
+ attr_reader :enum
13
+
14
+ def initialize(value)
15
+ raise ArgumentError.new("Enum InvoicePaymentType does not have such value : #{value}") if ! InvoicePaymentType.is_admissible_value?(value)
16
+ @enum = value
17
+ end
18
+
19
+ def ==(other)
20
+ return false if other.nil?
21
+ self.enum == other.enum
22
+ end
23
+
24
+ def self.is_admissible_value?(value)
25
+ @@admissible_values.include?(value)
26
+ end
27
+
28
+ def self.admissible_values
29
+ @@admissible_values
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class ObjectType
10
+
11
+ @@admissible_values = [:ACCOUNT, :ACCOUNT_EMAIL, :BLOCKING_STATES, :BUNDLE, :CUSTOM_FIELD, :INVOICE, :PAYMENT, :INVOICE_ITEM, :INVOICE_PAYMENT, :SUBSCRIPTION, :SUBSCRIPTION_EVENT, :PAYMENT_ATTEMPT, :PAYMENT_METHOD, :REFUND, :TAG, :TAG_DEFINITION, :TENANT, :TENANT_KVS]
12
+ attr_reader :enum
13
+
14
+ def initialize(value)
15
+ raise ArgumentError.new("Enum ObjectType does not have such value : #{value}") if ! ObjectType.is_admissible_value?(value)
16
+ @enum = value
17
+ end
18
+
19
+ def ==(other)
20
+ return false if other.nil?
21
+ self.enum == other.enum
22
+ end
23
+
24
+ def self.is_admissible_value?(value)
25
+ @@admissible_values.include?(value)
26
+ end
27
+
28
+ def self.admissible_values
29
+ @@admissible_values
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,36 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class Payment
10
+
11
+ include com.ning.billing.payment.api.Payment
12
+
13
+ attr_reader :id, :created_date, :updated_date, :account_id, :invoice_id, :payment_method_id, :payment_number, :amount, :paid_amount, :effective_date, :currency, :payment_status, :attempts, :ext_first_payment_id_ref, :ext_second_payment_id_ref, :payment_info_plugin
14
+
15
+ def initialize(id, created_date, updated_date, account_id, invoice_id, payment_method_id, payment_number, amount, paid_amount, effective_date, currency, payment_status, attempts, ext_first_payment_id_ref, ext_second_payment_id_ref, payment_info_plugin)
16
+ @id = id
17
+ @created_date = created_date
18
+ @updated_date = updated_date
19
+ @account_id = account_id
20
+ @invoice_id = invoice_id
21
+ @payment_method_id = payment_method_id
22
+ @payment_number = payment_number
23
+ @amount = amount
24
+ @paid_amount = paid_amount
25
+ @effective_date = effective_date
26
+ @currency = currency
27
+ @payment_status = payment_status
28
+ @attempts = attempts
29
+ @ext_first_payment_id_ref = ext_first_payment_id_ref
30
+ @ext_second_payment_id_ref = ext_second_payment_id_ref
31
+ @payment_info_plugin = payment_info_plugin
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,27 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class PaymentAttempt
10
+
11
+ include com.ning.billing.payment.api.PaymentAttempt
12
+
13
+ attr_reader :id, :created_date, :updated_date, :effective_date, :gateway_error_code, :gateway_error_msg, :payment_status
14
+
15
+ def initialize(id, created_date, updated_date, effective_date, gateway_error_code, gateway_error_msg, payment_status)
16
+ @id = id
17
+ @created_date = created_date
18
+ @updated_date = updated_date
19
+ @effective_date = effective_date
20
+ @gateway_error_code = gateway_error_code
21
+ @gateway_error_msg = gateway_error_msg
22
+ @payment_status = payment_status
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,28 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class PaymentInfoPlugin
10
+
11
+ include com.ning.billing.payment.plugin.api.PaymentInfoPlugin
12
+
13
+ attr_reader :amount, :created_date, :effective_date, :status, :gateway_error, :gateway_error_code, :first_payment_reference_id, :second_payment_reference_id
14
+
15
+ def initialize(amount, created_date, effective_date, status, gateway_error, gateway_error_code, first_payment_reference_id, second_payment_reference_id)
16
+ @amount = amount
17
+ @created_date = created_date
18
+ @effective_date = effective_date
19
+ @status = status
20
+ @gateway_error = gateway_error
21
+ @gateway_error_code = gateway_error_code
22
+ @first_payment_reference_id = first_payment_reference_id
23
+ @second_payment_reference_id = second_payment_reference_id
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,24 @@
1
+
2
+ #
3
+ # Ruby classes automatically generated from java classes-- don't edit
4
+ #
5
+ module Killbill
6
+ module Plugin
7
+ module Model
8
+
9
+ class PaymentMethodInfoPlugin
10
+
11
+ include com.ning.billing.payment.plugin.api.PaymentMethodInfoPlugin
12
+
13
+ attr_reader :account_id, :payment_method_id, :is_default, :external_payment_method_id
14
+
15
+ def initialize(account_id, payment_method_id, is_default, external_payment_method_id)
16
+ @account_id = account_id
17
+ @payment_method_id = payment_method_id
18
+ @is_default = is_default
19
+ @external_payment_method_id = external_payment_method_id
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end