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,152 +0,0 @@
1
- ###################################################################################
2
- # #
3
- # Copyright 2010-2013 Ning, Inc. #
4
- # #
5
- # Ning licenses this file to you under the Apache License, version 2.0 #
6
- # (the "License"); you may not use this file except in compliance with the #
7
- # License. You may obtain a copy of the License at: #
8
- # #
9
- # http://www.apache.org/licenses/LICENSE-2.0 #
10
- # #
11
- # Unless required by applicable law or agreed to in writing, software #
12
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
13
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #
14
- # License for the specific language governing permissions and limitations #
15
- # under the License. #
16
- # #
17
- ###################################################################################
18
-
19
-
20
- #
21
- # DO NOT EDIT!!!
22
- # File automatically generated by killbill-java-parser (git@github.com:killbill/killbill-java-parser.git)
23
- #
24
-
25
-
26
- module Killbill
27
- module Plugin
28
- module Model
29
-
30
- java_package 'org.killbill.billing.payment.plugin.api'
31
- class RefundInfoPlugin
32
-
33
- include org.killbill.billing.payment.plugin.api.RefundInfoPlugin
34
-
35
- attr_accessor :kb_payment_id, :amount, :currency, :created_date, :effective_date, :status, :gateway_error, :gateway_error_code, :first_refund_reference_id, :second_refund_reference_id, :properties
36
-
37
- def initialize()
38
- end
39
-
40
- def to_java()
41
- # conversion for kb_payment_id [type = java.util.UUID]
42
- @kb_payment_id = java.util.UUID.fromString(@kb_payment_id.to_s) unless @kb_payment_id.nil?
43
-
44
- # conversion for amount [type = java.math.BigDecimal]
45
- if @amount.nil?
46
- @amount = java.math.BigDecimal::ZERO
47
- else
48
- @amount = java.math.BigDecimal.new(@amount.to_s)
49
- end
50
-
51
- # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
52
- @currency = Java::org.killbill.billing.catalog.api.Currency.value_of("#{@currency.to_s}") unless @currency.nil?
53
-
54
- # conversion for created_date [type = org.joda.time.DateTime]
55
- if !@created_date.nil?
56
- @created_date = (@created_date.kind_of? Time) ? DateTime.parse(@created_date.to_s) : @created_date
57
- @created_date = Java::org.joda.time.DateTime.new(@created_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
58
- end
59
-
60
- # conversion for effective_date [type = org.joda.time.DateTime]
61
- if !@effective_date.nil?
62
- @effective_date = (@effective_date.kind_of? Time) ? DateTime.parse(@effective_date.to_s) : @effective_date
63
- @effective_date = Java::org.joda.time.DateTime.new(@effective_date.to_s, Java::org.joda.time.DateTimeZone::UTC)
64
- end
65
-
66
- # conversion for status [type = org.killbill.billing.payment.plugin.api.RefundPluginStatus]
67
- @status = Java::org.killbill.billing.payment.plugin.api.RefundPluginStatus.value_of("#{@status.to_s}") unless @status.nil?
68
-
69
- # conversion for gateway_error [type = java.lang.String]
70
- @gateway_error = @gateway_error.to_s unless @gateway_error.nil?
71
-
72
- # conversion for gateway_error_code [type = java.lang.String]
73
- @gateway_error_code = @gateway_error_code.to_s unless @gateway_error_code.nil?
74
-
75
- # conversion for first_refund_reference_id [type = java.lang.String]
76
- @first_refund_reference_id = @first_refund_reference_id.to_s unless @first_refund_reference_id.nil?
77
-
78
- # conversion for second_refund_reference_id [type = java.lang.String]
79
- @second_refund_reference_id = @second_refund_reference_id.to_s unless @second_refund_reference_id.nil?
80
-
81
- # conversion for properties [type = java.util.List]
82
- tmp = java.util.ArrayList.new
83
- (@properties || []).each do |m|
84
- # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
85
- m = m.to_java unless m.nil?
86
- tmp.add(m)
87
- end
88
- @properties = tmp
89
- self
90
- end
91
-
92
- def to_ruby(j_obj)
93
- # conversion for kb_payment_id [type = java.util.UUID]
94
- @kb_payment_id = j_obj.kb_payment_id
95
- @kb_payment_id = @kb_payment_id.nil? ? nil : @kb_payment_id.to_s
96
-
97
- # conversion for amount [type = java.math.BigDecimal]
98
- @amount = j_obj.amount
99
- @amount = @amount.nil? ? 0 : BigDecimal.new(@amount.to_s)
100
-
101
- # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
102
- @currency = j_obj.currency
103
- @currency = @currency.to_s.to_sym unless @currency.nil?
104
-
105
- # conversion for created_date [type = org.joda.time.DateTime]
106
- @created_date = j_obj.created_date
107
- if !@created_date.nil?
108
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
109
- str = fmt.print(@created_date)
110
- @created_date = DateTime.iso8601(str)
111
- end
112
-
113
- # conversion for effective_date [type = org.joda.time.DateTime]
114
- @effective_date = j_obj.effective_date
115
- if !@effective_date.nil?
116
- fmt = Java::org.joda.time.format.ISODateTimeFormat.date_time_no_millis # See https://github.com/killbill/killbill-java-parser/issues/3
117
- str = fmt.print(@effective_date)
118
- @effective_date = DateTime.iso8601(str)
119
- end
120
-
121
- # conversion for status [type = org.killbill.billing.payment.plugin.api.RefundPluginStatus]
122
- @status = j_obj.status
123
- @status = @status.to_s.to_sym unless @status.nil?
124
-
125
- # conversion for gateway_error [type = java.lang.String]
126
- @gateway_error = j_obj.gateway_error
127
-
128
- # conversion for gateway_error_code [type = java.lang.String]
129
- @gateway_error_code = j_obj.gateway_error_code
130
-
131
- # conversion for first_refund_reference_id [type = java.lang.String]
132
- @first_refund_reference_id = j_obj.first_refund_reference_id
133
-
134
- # conversion for second_refund_reference_id [type = java.lang.String]
135
- @second_refund_reference_id = j_obj.second_refund_reference_id
136
-
137
- # conversion for properties [type = java.util.List]
138
- @properties = j_obj.properties
139
- tmp = []
140
- (@properties || []).each do |m|
141
- # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
142
- m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
143
- tmp << m
144
- end
145
- @properties = tmp
146
- self
147
- end
148
-
149
- end
150
- end
151
- end
152
- end