killbill 4.4.0 → 5.0.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/Jarfile +8 -7
- data/Jarfile.lock +8 -7
- data/NEWS +4 -0
- data/gen_config/plugin_api.conf +4 -2
- data/generators/active_merchant/templates/Jarfile.rb +8 -7
- data/generators/active_merchant/templates/config.yml.rb +4 -1
- data/generators/active_merchant/templates/db/ddl.sql.rb +73 -73
- data/generators/active_merchant/templates/plugin.gemspec.rb +1 -0
- data/generators/active_merchant/templates/spec/integration_spec.rb +4 -3
- data/lib/killbill/entitlement.rb +23 -0
- data/lib/killbill/gen/api/entitlement_api.rb +72 -18
- data/lib/killbill/gen/plugin-api/control_result.rb +70 -0
- data/lib/killbill/gen/plugin-api/entitlement_context.rb +215 -0
- data/lib/killbill/gen/plugin-api/entitlement_plugin_api.rb +138 -0
- data/lib/killbill/gen/plugin-api/entitlement_plugin_api_exception.rb +51 -0
- data/lib/killbill/gen/plugin-api/{on_success_payment_routing_result.rb → on_failure_entitlement_result.rb} +3 -3
- data/lib/killbill/gen/plugin-api/{on_failure_payment_routing_result.rb → on_failure_payment_control_result.rb} +23 -4
- data/lib/killbill/gen/plugin-api/on_success_entitlement_result.rb +53 -0
- data/lib/killbill/gen/plugin-api/on_success_payment_control_result.rb +70 -0
- data/lib/killbill/gen/plugin-api/{payment_routing_api_exception.rb → payment_control_api_exception.rb} +2 -2
- data/lib/killbill/gen/plugin-api/{payment_routing_context.rb → payment_control_context.rb} +18 -23
- data/lib/killbill/gen/plugin-api/{payment_routing_plugin_api.rb → payment_control_plugin_api.rb} +15 -15
- data/lib/killbill/gen/plugin-api/prior_entitlement_result.rb +119 -0
- data/lib/killbill/gen/plugin-api/{prior_payment_routing_result.rb → prior_payment_control_result.rb} +21 -21
- data/lib/killbill/gen/plugin-api/require_gen.rb +13 -6
- data/lib/killbill/helpers/active_merchant/active_record/models/payment_method.rb +4 -5
- data/lib/killbill/helpers/active_merchant/active_record/models/response.rb +15 -2
- data/lib/killbill/helpers/active_merchant/configuration.rb +1 -1
- data/lib/killbill/helpers/active_merchant/payment_plugin.rb +1 -1
- data/lib/killbill/killbill_logger.rb +2 -0
- data/lib/killbill/payment_control.rb +4 -4
- data/lib/killbill/version.rb +1 -1
- data/spec/killbill/helpers/payment_method_spec.rb +2 -2
- data/spec/killbill/helpers/payment_plugin_spec.rb +11 -0
- data/spec/killbill/helpers/response_spec.rb +2 -2
- data/spec/killbill/killbill_logger_spec.rb +2 -0
- metadata +17 -9
data/lib/killbill/gen/plugin-api/{prior_payment_routing_result.rb → prior_payment_control_result.rb}
RENAMED
@@ -29,17 +29,26 @@ module Killbill
|
|
29
29
|
module Plugin
|
30
30
|
module Model
|
31
31
|
|
32
|
-
java_package 'org.killbill.billing.
|
33
|
-
class
|
32
|
+
java_package 'org.killbill.billing.control.plugin.api'
|
33
|
+
class PriorPaymentControlResult
|
34
34
|
|
35
|
-
include org.killbill.billing.
|
35
|
+
include org.killbill.billing.control.plugin.api.PriorPaymentControlResult
|
36
36
|
|
37
|
-
attr_accessor :is_aborted, :adjusted_amount, :adjusted_currency, :adjusted_payment_method_id
|
37
|
+
attr_accessor :adjusted_plugin_properties, :is_aborted, :adjusted_amount, :adjusted_currency, :adjusted_payment_method_id
|
38
38
|
|
39
39
|
def initialize()
|
40
40
|
end
|
41
41
|
|
42
42
|
def to_java()
|
43
|
+
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
44
|
+
tmp = java.util.ArrayList.new
|
45
|
+
(@adjusted_plugin_properties || []).each do |m|
|
46
|
+
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
47
|
+
m = m.to_java unless m.nil?
|
48
|
+
tmp.add(m)
|
49
|
+
end
|
50
|
+
@adjusted_plugin_properties = tmp
|
51
|
+
|
43
52
|
# conversion for is_aborted [type = boolean]
|
44
53
|
@is_aborted = @is_aborted.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(@is_aborted)
|
45
54
|
|
@@ -55,19 +64,20 @@ module Killbill
|
|
55
64
|
|
56
65
|
# conversion for adjusted_payment_method_id [type = java.util.UUID]
|
57
66
|
@adjusted_payment_method_id = java.util.UUID.fromString(@adjusted_payment_method_id.to_s) unless @adjusted_payment_method_id.nil?
|
67
|
+
self
|
68
|
+
end
|
58
69
|
|
70
|
+
def to_ruby(j_obj)
|
59
71
|
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
60
|
-
|
61
|
-
|
72
|
+
@adjusted_plugin_properties = j_obj.adjusted_plugin_properties
|
73
|
+
tmp = []
|
74
|
+
(@adjusted_plugin_properties.nil? ? [] : @adjusted_plugin_properties.iterator).each do |m|
|
62
75
|
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
63
|
-
m = m
|
64
|
-
tmp
|
76
|
+
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
77
|
+
tmp << m
|
65
78
|
end
|
66
79
|
@adjusted_plugin_properties = tmp
|
67
|
-
self
|
68
|
-
end
|
69
80
|
|
70
|
-
def to_ruby(j_obj)
|
71
81
|
# conversion for is_aborted [type = boolean]
|
72
82
|
@is_aborted = j_obj.is_aborted
|
73
83
|
if @is_aborted.nil?
|
@@ -88,16 +98,6 @@ module Killbill
|
|
88
98
|
# conversion for adjusted_payment_method_id [type = java.util.UUID]
|
89
99
|
@adjusted_payment_method_id = j_obj.adjusted_payment_method_id
|
90
100
|
@adjusted_payment_method_id = @adjusted_payment_method_id.nil? ? nil : @adjusted_payment_method_id.to_s
|
91
|
-
|
92
|
-
# conversion for adjusted_plugin_properties [type = java.lang.Iterable]
|
93
|
-
@adjusted_plugin_properties = j_obj.adjusted_plugin_properties
|
94
|
-
tmp = []
|
95
|
-
(@adjusted_plugin_properties.nil? ? [] : @adjusted_plugin_properties.iterator).each do |m|
|
96
|
-
# conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
|
97
|
-
m = Killbill::Plugin::Model::PluginProperty.new.to_ruby(m) unless m.nil?
|
98
|
-
tmp << m
|
99
|
-
end
|
100
|
-
@adjusted_plugin_properties = tmp
|
101
101
|
self
|
102
102
|
end
|
103
103
|
|
@@ -32,15 +32,22 @@ require 'killbill/gen/plugin-api/ext_bus_event'
|
|
32
32
|
require 'killbill/gen/plugin-api/notification_plugin_api'
|
33
33
|
require 'killbill/gen/plugin-api/invoice_plugin_api'
|
34
34
|
require 'killbill/gen/plugin-api/currency_plugin_api'
|
35
|
-
require 'killbill/gen/plugin-api/
|
36
|
-
require 'killbill/gen/plugin-api/
|
37
|
-
require 'killbill/gen/plugin-api/
|
38
|
-
require 'killbill/gen/plugin-api/
|
39
|
-
require 'killbill/gen/plugin-api/
|
40
|
-
require 'killbill/gen/plugin-api/
|
35
|
+
require 'killbill/gen/plugin-api/control_result'
|
36
|
+
require 'killbill/gen/plugin-api/on_failure_payment_control_result'
|
37
|
+
require 'killbill/gen/plugin-api/on_success_payment_control_result'
|
38
|
+
require 'killbill/gen/plugin-api/payment_control_api_exception'
|
39
|
+
require 'killbill/gen/plugin-api/payment_control_context'
|
40
|
+
require 'killbill/gen/plugin-api/payment_control_plugin_api'
|
41
|
+
require 'killbill/gen/plugin-api/prior_payment_control_result'
|
41
42
|
require 'killbill/gen/plugin-api/catalog_plugin_api'
|
42
43
|
require 'killbill/gen/plugin-api/standalone_plugin_catalog'
|
43
44
|
require 'killbill/gen/plugin-api/versioned_plugin_catalog'
|
45
|
+
require 'killbill/gen/plugin-api/entitlement_context'
|
46
|
+
require 'killbill/gen/plugin-api/entitlement_plugin_api'
|
47
|
+
require 'killbill/gen/plugin-api/entitlement_plugin_api_exception'
|
48
|
+
require 'killbill/gen/plugin-api/on_failure_entitlement_result'
|
49
|
+
require 'killbill/gen/plugin-api/on_success_entitlement_result'
|
50
|
+
require 'killbill/gen/plugin-api/prior_entitlement_result'
|
44
51
|
require 'killbill/gen/plugin-api/gateway_notification'
|
45
52
|
require 'killbill/gen/plugin-api/hosted_payment_page_form_descriptor'
|
46
53
|
require 'killbill/gen/plugin-api/payment_transaction_info_plugin'
|
@@ -45,14 +45,14 @@ module Killbill
|
|
45
45
|
|
46
46
|
def self.from_kb_account_id(kb_account_id, kb_tenant_id)
|
47
47
|
if kb_tenant_id.nil?
|
48
|
-
where("kb_account_id = #{@@quotes_cache[kb_account_id]} AND kb_tenant_id is NULL AND is_deleted = #{@@quotes_cache[false]}")
|
48
|
+
where("kb_account_id = #{@@quotes_cache[kb_account_id]} AND kb_tenant_id is NULL AND is_deleted = #{@@quotes_cache[false]}").order(:id)
|
49
49
|
else
|
50
|
-
where("kb_account_id = #{@@quotes_cache[kb_account_id]} AND kb_tenant_id = #{@@quotes_cache[kb_tenant_id]} AND is_deleted = #{@@quotes_cache[false]}")
|
50
|
+
where("kb_account_id = #{@@quotes_cache[kb_account_id]} AND kb_tenant_id = #{@@quotes_cache[kb_tenant_id]} AND is_deleted = #{@@quotes_cache[false]}").order(:id)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.from_kb_account_id_and_token(token, kb_account_id, kb_tenant_id)
|
55
|
-
from_kb_account_id(kb_account_id, kb_tenant_id).where("token = #{@@quotes_cache[token]}")
|
55
|
+
from_kb_account_id(kb_account_id, kb_tenant_id).where("token = #{@@quotes_cache[token]}").order(:id)
|
56
56
|
end
|
57
57
|
|
58
58
|
def self.from_kb_payment_method_id(kb_payment_method_id, kb_tenant_id)
|
@@ -103,16 +103,15 @@ module Killbill
|
|
103
103
|
|
104
104
|
if kb_tenant_id.nil?
|
105
105
|
query = t.where(search_where_clause(t, search_key))
|
106
|
-
.order(t[:id])
|
107
106
|
else
|
108
107
|
query = t.where(search_where_clause(t, search_key).and(t[:kb_tenant_id].eq(kb_tenant_id)))
|
109
|
-
.order(t[:id])
|
110
108
|
end
|
111
109
|
|
112
110
|
if offset.blank? and limit.blank?
|
113
111
|
# true is for count distinct
|
114
112
|
query.project(t[:id].count(true))
|
115
113
|
else
|
114
|
+
query.order(t[:id])
|
116
115
|
query.skip(offset) unless offset.blank?
|
117
116
|
query.take(limit) unless limit.blank?
|
118
117
|
query.project(t[Arel.star])
|
@@ -176,16 +176,15 @@ module Killbill
|
|
176
176
|
|
177
177
|
if kb_tenant_id.nil?
|
178
178
|
query = t.where(search_where_clause(t, search_key))
|
179
|
-
.order(t[:id])
|
180
179
|
else
|
181
180
|
query = t.where(search_where_clause(t, search_key).and(t[:kb_tenant_id].eq(kb_tenant_id)))
|
182
|
-
.order(t[:id])
|
183
181
|
end
|
184
182
|
|
185
183
|
if offset.blank? and limit.blank?
|
186
184
|
# true is for count distinct
|
187
185
|
query.project(t[:id].count(true))
|
188
186
|
else
|
187
|
+
query.order(t[:id])
|
189
188
|
query.skip(offset) unless offset.blank?
|
190
189
|
query.take(limit) unless limit.blank?
|
191
190
|
query.project(t[Arel.star])
|
@@ -239,6 +238,20 @@ module Killbill
|
|
239
238
|
nil
|
240
239
|
end
|
241
240
|
|
241
|
+
# authorization was the old name (reserved on PostgreSQL) - make sure we support both column names for backward compatibility
|
242
|
+
|
243
|
+
def authorization=(auth)
|
244
|
+
write_attribute(column_for_attribute('authorization').name, auth)
|
245
|
+
end
|
246
|
+
|
247
|
+
def authorization
|
248
|
+
read_attribute(column_for_attribute('authorization').name)
|
249
|
+
end
|
250
|
+
|
251
|
+
def column_for_attribute(name)
|
252
|
+
name == 'authorization' ? (super('authorisation') || super('authorization')) : super(name)
|
253
|
+
end
|
254
|
+
|
242
255
|
private
|
243
256
|
|
244
257
|
def create_plugin_property(key, value)
|
@@ -122,7 +122,7 @@ module Killbill
|
|
122
122
|
@@glob_config = {}
|
123
123
|
end
|
124
124
|
|
125
|
-
@@logger.
|
125
|
+
@@logger.level = Logger::DEBUG if (@@glob_config[:logger] || {})[:debug]
|
126
126
|
|
127
127
|
@@glob_currency_conversions = @@glob_config[:currency_conversions]
|
128
128
|
|
@@ -146,7 +146,7 @@ module Killbill
|
|
146
146
|
|
147
147
|
def search_payments(search_key, offset = 0, limit = 100, properties, context)
|
148
148
|
options = properties_to_hash(properties)
|
149
|
-
@response_model.search(search_key, context.tenant_id, offset, limit
|
149
|
+
@response_model.search(search_key, context.tenant_id, offset, limit)
|
150
150
|
end
|
151
151
|
|
152
152
|
def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context)
|
@@ -2,20 +2,20 @@ require 'killbill/plugin'
|
|
2
2
|
|
3
3
|
module Killbill
|
4
4
|
module Plugin
|
5
|
-
class
|
5
|
+
class PaymentControlPluginApi < Notification
|
6
6
|
|
7
7
|
class OperationUnsupportedByGatewayError < NotImplementedError
|
8
8
|
end
|
9
9
|
|
10
|
-
def prior_call(
|
10
|
+
def prior_call(control_context, properties)
|
11
11
|
raise OperationUnsupportedByGatewayError
|
12
12
|
end
|
13
13
|
|
14
|
-
def on_success_call(
|
14
|
+
def on_success_call(control_context, properties)
|
15
15
|
raise OperationUnsupportedByGatewayError
|
16
16
|
end
|
17
17
|
|
18
|
-
def on_failure_call(
|
18
|
+
def on_failure_call(control_context, properties)
|
19
19
|
raise OperationUnsupportedByGatewayError
|
20
20
|
end
|
21
21
|
end
|
data/lib/killbill/version.rb
CHANGED
@@ -182,7 +182,7 @@ describe Killbill::Plugin::ActiveMerchant::ActiveRecord::PaymentMethod do
|
|
182
182
|
|
183
183
|
it 'should generate the right SQL query' do
|
184
184
|
# Check count query (search query numeric)
|
185
|
-
expected_query = "SELECT COUNT(DISTINCT #{q('test_payment_methods')}.#{q('id')}) FROM #{q('test_payment_methods')} WHERE ((((((((((((((#{q('test_payment_methods')}.#{q('kb_account_id')} = '1234' OR #{q('test_payment_methods')}.#{q('kb_payment_method_id')} = '1234') OR #{q('test_payment_methods')}.#{q('token')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_type')} = '1234') OR #{q('test_payment_methods')}.#{q('state')} = '1234') OR #{q('test_payment_methods')}.#{q('zip')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_first_name')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('cc_last_name')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('address1')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('address2')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('city')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('country')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('cc_exp_month')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_exp_year')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_last_4')} = '1234') AND #{q('test_payment_methods')}.#{q('kb_tenant_id')} = '11-22-33'
|
185
|
+
expected_query = "SELECT COUNT(DISTINCT #{q('test_payment_methods')}.#{q('id')}) FROM #{q('test_payment_methods')} WHERE ((((((((((((((#{q('test_payment_methods')}.#{q('kb_account_id')} = '1234' OR #{q('test_payment_methods')}.#{q('kb_payment_method_id')} = '1234') OR #{q('test_payment_methods')}.#{q('token')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_type')} = '1234') OR #{q('test_payment_methods')}.#{q('state')} = '1234') OR #{q('test_payment_methods')}.#{q('zip')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_first_name')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('cc_last_name')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('address1')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('address2')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('city')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('country')} LIKE '%1234%') OR #{q('test_payment_methods')}.#{q('cc_exp_month')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_exp_year')} = '1234') OR #{q('test_payment_methods')}.#{q('cc_last_4')} = '1234') AND #{q('test_payment_methods')}.#{q('kb_tenant_id')} = '11-22-33'"
|
186
186
|
# Note that Kill Bill will pass a String, even for numeric types
|
187
187
|
::Killbill::Test::TestPaymentMethod.search_query('1234', '11-22-33').to_sql.should == expected_query
|
188
188
|
|
@@ -192,7 +192,7 @@ describe Killbill::Plugin::ActiveMerchant::ActiveRecord::PaymentMethod do
|
|
192
192
|
::Killbill::Test::TestPaymentMethod.search_query('1234', '11-22-33', 0, 10).to_sql.should == expected_query
|
193
193
|
|
194
194
|
# Check count query (search query string)
|
195
|
-
expected_query = "SELECT COUNT(DISTINCT #{q('test_payment_methods')}.#{q('id')}) FROM #{q('test_payment_methods')} WHERE (((((((((((#{q('test_payment_methods')}.#{q('kb_account_id')} = 'XXX' OR #{q('test_payment_methods')}.#{q('kb_payment_method_id')} = 'XXX') OR #{q('test_payment_methods')}.#{q('token')} = 'XXX') OR #{q('test_payment_methods')}.#{q('cc_type')} = 'XXX') OR #{q('test_payment_methods')}.#{q('state')} = 'XXX') OR #{q('test_payment_methods')}.#{q('zip')} = 'XXX') OR #{q('test_payment_methods')}.#{q('cc_first_name')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('cc_last_name')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('address1')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('address2')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('city')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('country')} LIKE '%XXX%') AND #{q('test_payment_methods')}.#{q('kb_tenant_id')} = '11-22-33'
|
195
|
+
expected_query = "SELECT COUNT(DISTINCT #{q('test_payment_methods')}.#{q('id')}) FROM #{q('test_payment_methods')} WHERE (((((((((((#{q('test_payment_methods')}.#{q('kb_account_id')} = 'XXX' OR #{q('test_payment_methods')}.#{q('kb_payment_method_id')} = 'XXX') OR #{q('test_payment_methods')}.#{q('token')} = 'XXX') OR #{q('test_payment_methods')}.#{q('cc_type')} = 'XXX') OR #{q('test_payment_methods')}.#{q('state')} = 'XXX') OR #{q('test_payment_methods')}.#{q('zip')} = 'XXX') OR #{q('test_payment_methods')}.#{q('cc_first_name')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('cc_last_name')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('address1')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('address2')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('city')} LIKE '%XXX%') OR #{q('test_payment_methods')}.#{q('country')} LIKE '%XXX%') AND #{q('test_payment_methods')}.#{q('kb_tenant_id')} = '11-22-33'"
|
196
196
|
::Killbill::Test::TestPaymentMethod.search_query('XXX', '11-22-33').to_sql.should == expected_query
|
197
197
|
|
198
198
|
# Check query with results (search query string)
|
@@ -308,6 +308,17 @@ describe Killbill::Plugin::ActiveMerchant::PaymentPlugin do
|
|
308
308
|
source.first_name.should == 'John'
|
309
309
|
source.last_name.should == 'Doe'
|
310
310
|
end
|
311
|
+
|
312
|
+
it "should support search_payments" do
|
313
|
+
response = ::Killbill::Test::TestResponse.create(
|
314
|
+
:api_call => :purchase, :kb_payment_id => @kb_payment_id,
|
315
|
+
:kb_account_id => @kb_account_id, :kb_tenant_id => @call_context.tenant_id,
|
316
|
+
:success => true, :created_at => Time.now, :updated_at => Time.now
|
317
|
+
)
|
318
|
+
results = plugin.search_payments(@kb_payment_id, 0, 100, [], @call_context).iterator.to_a
|
319
|
+
results.count.should == 1
|
320
|
+
results.last.kb_payment_id.to_s.should == response.kb_payment_id
|
321
|
+
end
|
311
322
|
end
|
312
323
|
|
313
324
|
context 'with a dummy gateway' do
|
@@ -137,7 +137,7 @@ describe Killbill::Plugin::ActiveMerchant::ActiveRecord::Response do
|
|
137
137
|
|
138
138
|
it 'should generate the right SQL query' do
|
139
139
|
# Check count query (search query numeric)
|
140
|
-
expected_query = "SELECT COUNT(DISTINCT #{q('test_responses')}.#{q('id')}) FROM #{q('test_responses')} WHERE ((((#{q('test_responses')}.#{q('kb_payment_id')} = '1234' OR #{q('test_responses')}.#{q('kb_payment_transaction_id')} = '1234') OR #{q('test_responses')}.#{q('message')} = '1234') OR #{q('test_responses')}.#{q('authorization')} = '1234') OR #{q('test_responses')}.#{q('fraud_review')} = '1234') AND #{q('test_responses')}.#{q('success')} = #{qtrue} AND #{q('test_responses')}.#{q('kb_tenant_id')} = '11-22-33'
|
140
|
+
expected_query = "SELECT COUNT(DISTINCT #{q('test_responses')}.#{q('id')}) FROM #{q('test_responses')} WHERE ((((#{q('test_responses')}.#{q('kb_payment_id')} = '1234' OR #{q('test_responses')}.#{q('kb_payment_transaction_id')} = '1234') OR #{q('test_responses')}.#{q('message')} = '1234') OR #{q('test_responses')}.#{q('authorization')} = '1234') OR #{q('test_responses')}.#{q('fraud_review')} = '1234') AND #{q('test_responses')}.#{q('success')} = #{qtrue} AND #{q('test_responses')}.#{q('kb_tenant_id')} = '11-22-33'"
|
141
141
|
# Note that Kill Bill will pass a String, even for numeric types
|
142
142
|
::Killbill::Test::TestResponse.search_query('1234', '11-22-33').to_sql.should == expected_query
|
143
143
|
|
@@ -147,7 +147,7 @@ describe Killbill::Plugin::ActiveMerchant::ActiveRecord::Response do
|
|
147
147
|
::Killbill::Test::TestResponse.search_query('1234', '11-22-33', 0, 10).to_sql.should == expected_query
|
148
148
|
|
149
149
|
# Check count query (search query string)
|
150
|
-
expected_query = "SELECT COUNT(DISTINCT #{q('test_responses')}.#{q('id')}) FROM #{q('test_responses')} WHERE ((((#{q('test_responses')}.#{q('kb_payment_id')} = 'XXX' OR #{q('test_responses')}.#{q('kb_payment_transaction_id')} = 'XXX') OR #{q('test_responses')}.#{q('message')} = 'XXX') OR #{q('test_responses')}.#{q('authorization')} = 'XXX') OR #{q('test_responses')}.#{q('fraud_review')} = 'XXX') AND #{q('test_responses')}.#{q('success')} = #{qtrue} AND #{q('test_responses')}.#{q('kb_tenant_id')} = '11-22-33'
|
150
|
+
expected_query = "SELECT COUNT(DISTINCT #{q('test_responses')}.#{q('id')}) FROM #{q('test_responses')} WHERE ((((#{q('test_responses')}.#{q('kb_payment_id')} = 'XXX' OR #{q('test_responses')}.#{q('kb_payment_transaction_id')} = 'XXX') OR #{q('test_responses')}.#{q('message')} = 'XXX') OR #{q('test_responses')}.#{q('authorization')} = 'XXX') OR #{q('test_responses')}.#{q('fraud_review')} = 'XXX') AND #{q('test_responses')}.#{q('success')} = #{qtrue} AND #{q('test_responses')}.#{q('kb_tenant_id')} = '11-22-33'"
|
151
151
|
::Killbill::Test::TestResponse.search_query('XXX', '11-22-33').to_sql.should == expected_query
|
152
152
|
|
153
153
|
# Check query with results (search query string)
|
@@ -8,6 +8,8 @@ describe Killbill::Plugin::KillbillLogger do
|
|
8
8
|
logger.error "Argument #{@foo} mismatch."
|
9
9
|
logger.info('initialize') { 'Initializing...' }
|
10
10
|
logger.add(Logger::FATAL) { 'Fatal error!' }
|
11
|
+
logger.level = ::Logger::DEBUG
|
12
|
+
logger.log_level.should == ::Logger::DEBUG
|
11
13
|
logger.close
|
12
14
|
end
|
13
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: killbill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kill Bill core team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -343,6 +343,7 @@ files:
|
|
343
343
|
- lib/killbill/catalog.rb
|
344
344
|
- lib/killbill/creator.rb
|
345
345
|
- lib/killbill/currency.rb
|
346
|
+
- lib/killbill/entitlement.rb
|
346
347
|
- lib/killbill/ext/active_merchant/typhoeus_connection.rb
|
347
348
|
- lib/killbill/gen/api/account.rb
|
348
349
|
- lib/killbill/gen/api/account_api_exception.rb
|
@@ -468,22 +469,29 @@ files:
|
|
468
469
|
- lib/killbill/gen/api/usage_record.rb
|
469
470
|
- lib/killbill/gen/api/usage_user_api.rb
|
470
471
|
- lib/killbill/gen/plugin-api/catalog_plugin_api.rb
|
472
|
+
- lib/killbill/gen/plugin-api/control_result.rb
|
471
473
|
- lib/killbill/gen/plugin-api/currency_plugin_api.rb
|
474
|
+
- lib/killbill/gen/plugin-api/entitlement_context.rb
|
475
|
+
- lib/killbill/gen/plugin-api/entitlement_plugin_api.rb
|
476
|
+
- lib/killbill/gen/plugin-api/entitlement_plugin_api_exception.rb
|
472
477
|
- lib/killbill/gen/plugin-api/ext_bus_event.rb
|
473
478
|
- lib/killbill/gen/plugin-api/gateway_notification.rb
|
474
479
|
- lib/killbill/gen/plugin-api/hosted_payment_page_form_descriptor.rb
|
475
480
|
- lib/killbill/gen/plugin-api/invoice_plugin_api.rb
|
476
481
|
- lib/killbill/gen/plugin-api/notification_plugin_api.rb
|
477
|
-
- lib/killbill/gen/plugin-api/
|
478
|
-
- lib/killbill/gen/plugin-api/
|
482
|
+
- lib/killbill/gen/plugin-api/on_failure_entitlement_result.rb
|
483
|
+
- lib/killbill/gen/plugin-api/on_failure_payment_control_result.rb
|
484
|
+
- lib/killbill/gen/plugin-api/on_success_entitlement_result.rb
|
485
|
+
- lib/killbill/gen/plugin-api/on_success_payment_control_result.rb
|
486
|
+
- lib/killbill/gen/plugin-api/payment_control_api_exception.rb
|
487
|
+
- lib/killbill/gen/plugin-api/payment_control_context.rb
|
488
|
+
- lib/killbill/gen/plugin-api/payment_control_plugin_api.rb
|
479
489
|
- lib/killbill/gen/plugin-api/payment_method_info_plugin.rb
|
480
490
|
- lib/killbill/gen/plugin-api/payment_plugin_api.rb
|
481
491
|
- lib/killbill/gen/plugin-api/payment_plugin_api_exception.rb
|
482
|
-
- lib/killbill/gen/plugin-api/payment_routing_api_exception.rb
|
483
|
-
- lib/killbill/gen/plugin-api/payment_routing_context.rb
|
484
|
-
- lib/killbill/gen/plugin-api/payment_routing_plugin_api.rb
|
485
492
|
- lib/killbill/gen/plugin-api/payment_transaction_info_plugin.rb
|
486
|
-
- lib/killbill/gen/plugin-api/
|
493
|
+
- lib/killbill/gen/plugin-api/prior_entitlement_result.rb
|
494
|
+
- lib/killbill/gen/plugin-api/prior_payment_control_result.rb
|
487
495
|
- lib/killbill/gen/plugin-api/require_gen.rb
|
488
496
|
- lib/killbill/gen/plugin-api/standalone_plugin_catalog.rb
|
489
497
|
- lib/killbill/gen/plugin-api/versioned_plugin_catalog.rb
|
@@ -573,7 +581,7 @@ requirements:
|
|
573
581
|
- jar 'org.kill-bill.billing:killbill-api'
|
574
582
|
- jar 'org.kill-bill.billing:killbill-util:tests'
|
575
583
|
rubyforge_project:
|
576
|
-
rubygems_version: 2.4.
|
584
|
+
rubygems_version: 2.4.8
|
577
585
|
signing_key:
|
578
586
|
specification_version: 4
|
579
587
|
summary: Framework to write Kill Bill plugins in Ruby.
|