killbill 9.4.0 → 9.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a5f16eb8d2d7d84e106cd72a7641f4c5df8e1c1
4
- data.tar.gz: 808645deb5a84812d8cdd31e3333d07c25288d83
3
+ metadata.gz: b2ed9bf17849149d7c821a00f0b72a71944bf65e
4
+ data.tar.gz: 00e2b87c71e9840ffea55aaf5b1c81bec35d6459
5
5
  SHA512:
6
- metadata.gz: 984159049756726d30838852e556628bf8357b3700ac176dd19aece003f79e625778cf5a326ab08f0fd04463f249fe672619173685fa662d67d4a7e0d8020e88
7
- data.tar.gz: 268ee0eb07937c1cd1664d23daf43bd43591fa280c1e64db6c40504eaf869f8890a088578517e8cc02aeeecc48e2c7498d2df06ebef10b58bbf48f86717a4bcc
6
+ metadata.gz: 6c4bbbea7c699ab7a6bb98bbd8942a6fdb0c29eeaca8e18707029eede4bbd650b36ac1bff3a90bcf2220a65904a73c13c9fbeb299d1f4cb04a4ed7ee827b1358
7
+ data.tar.gz: b5837953b7f37a6cdd46ebf4feaa35113fd510012d319fbe8bbc710f1c8aef0a0744796e7cd5b03ca54e74d54ef3e58ef84a04a76f37a68352fcc7595270ff68
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- killbill (9.4.0)
4
+ killbill (9.4.1)
5
5
  rack (>= 1.5.2)
6
6
  sinatra (~> 1.3.4)
7
7
  typhoeus (~> 0.6.9)
data/NEWS CHANGED
@@ -1,3 +1,7 @@
1
+ 9.4.1
2
+ Make max_nb_records query configurable
3
+ https://github.com/killbill/killbill-plugin-framework-ruby/issues/54
4
+
1
5
  9.4.0
2
6
  Update to Kill Bill 0.19.18 APIs
3
7
 
@@ -164,13 +164,13 @@ module Killbill
164
164
  # conversion for time_zone [type = org.joda.time.DateTimeZone]
165
165
  @time_zone = j_obj.time_zone
166
166
  if !@time_zone.nil?
167
- @time_zone = TZInfo::Timezone.get(@time_zone.get_id)
167
+ @time_zone = TZInfo::Timezone.get(@time_zone.get_id) rescue @time_zone.get_id
168
168
  end
169
169
 
170
170
  # conversion for fixed_offset_time_zone [type = org.joda.time.DateTimeZone]
171
171
  @fixed_offset_time_zone = j_obj.fixed_offset_time_zone
172
172
  if !@fixed_offset_time_zone.nil?
173
- @fixed_offset_time_zone = TZInfo::Timezone.get(@fixed_offset_time_zone.get_id)
173
+ @fixed_offset_time_zone = TZInfo::Timezone.get(@fixed_offset_time_zone.get_id) rescue @fixed_offset_time_zone.get_id
174
174
  end
175
175
 
176
176
  # conversion for reference_time [type = org.joda.time.DateTime]
@@ -148,7 +148,7 @@ module Killbill
148
148
  # conversion for time_zone [type = org.joda.time.DateTimeZone]
149
149
  @time_zone = j_obj.time_zone
150
150
  if !@time_zone.nil?
151
- @time_zone = TZInfo::Timezone.get(@time_zone.get_id)
151
+ @time_zone = TZInfo::Timezone.get(@time_zone.get_id) rescue @time_zone.get_id
152
152
  end
153
153
 
154
154
  # conversion for locale [type = java.lang.String]
@@ -82,13 +82,13 @@ module Killbill
82
82
  # conversion for time_zone [type = org.joda.time.DateTimeZone]
83
83
  @time_zone = j_obj.time_zone
84
84
  if !@time_zone.nil?
85
- @time_zone = TZInfo::Timezone.get(@time_zone.get_id)
85
+ @time_zone = TZInfo::Timezone.get(@time_zone.get_id) rescue @time_zone.get_id
86
86
  end
87
87
 
88
88
  # conversion for fixed_offset_time_zone [type = org.joda.time.DateTimeZone]
89
89
  @fixed_offset_time_zone = j_obj.fixed_offset_time_zone
90
90
  if !@fixed_offset_time_zone.nil?
91
- @fixed_offset_time_zone = TZInfo::Timezone.get(@fixed_offset_time_zone.get_id)
91
+ @fixed_offset_time_zone = TZInfo::Timezone.get(@fixed_offset_time_zone.get_id) rescue @fixed_offset_time_zone.get_id
92
92
  end
93
93
 
94
94
  # conversion for reference_time [type = org.joda.time.DateTime]
@@ -148,7 +148,7 @@ module Killbill
148
148
  # conversion for time_zone [type = org.joda.time.DateTimeZone]
149
149
  @time_zone = j_obj.time_zone
150
150
  if !@time_zone.nil?
151
- @time_zone = TZInfo::Timezone.get(@time_zone.get_id)
151
+ @time_zone = TZInfo::Timezone.get(@time_zone.get_id) rescue @time_zone.get_id
152
152
  end
153
153
 
154
154
  # conversion for locale [type = java.lang.String]
@@ -198,7 +198,7 @@ module Killbill
198
198
  pagination = ::Killbill::Plugin::Model::Pagination.new
199
199
  pagination.current_offset = offset
200
200
  pagination.total_nb_records = self.count_by_sql(self.search_query(search_key, kb_tenant_id))
201
- pagination.max_nb_records = self.where(:success => true).count
201
+ pagination.max_nb_records = self.max_nb_records
202
202
  pagination.next_offset = (!pagination.total_nb_records.nil? && offset + limit >= pagination.total_nb_records) ? nil : offset + limit
203
203
  # Reduce the limit if the specified value is larger than the number of records
204
204
  actual_limit = [pagination.max_nb_records, limit].min
@@ -218,6 +218,10 @@ module Killbill
218
218
  []
219
219
  end
220
220
 
221
+ def self.max_nb_records
222
+ self.where(:success => true).count
223
+ end
224
+
221
225
  # Override in your plugin if needed
222
226
  def txn_id
223
227
  authorization
@@ -1,3 +1,3 @@
1
1
  module Killbill
2
- VERSION = '9.4.0'
2
+ VERSION = '9.4.1'
3
3
  end
@@ -53,6 +53,51 @@ describe Killbill::Plugin do
53
53
  check_notification(jgw_notification2)
54
54
  end
55
55
 
56
+ it 'should be able to handle UTC as the fixed offset timezone' do
57
+ jaccount = ::Killbill::Plugin::Model::Account.new
58
+ jaccount.id = java.util.UUID.fromString('cf5a597a-cf15-45d3-8f02-95371be7f927')
59
+ jaccount.time_zone = org.joda.time.DateTimeZone.forID('Etc/UTC')
60
+ jaccount.reference_time = org.joda.time.DateTime.new('2015-09-01T08:01:01.000Z')
61
+ jaccount.fixed_offset_time_zone = org.killbill.billing.util.account.AccountDateTimeUtils.getFixedOffsetTimeZone(jaccount)
62
+
63
+ raccount = Killbill::Plugin::Model::Account.new.to_ruby(jaccount)
64
+ raccount.id.should == 'cf5a597a-cf15-45d3-8f02-95371be7f927'
65
+ raccount.time_zone.should be_an_instance_of TZInfo::DataTimezone
66
+ raccount.time_zone.to_s.should == 'Etc - UTC'
67
+ raccount.reference_time.should == '2015-09-01T08:01:01.000Z'
68
+ raccount.fixed_offset_time_zone.should be_an_instance_of TZInfo::DataTimezone
69
+ raccount.fixed_offset_time_zone.to_s.should == 'UTC'
70
+
71
+ jaccount2 = raccount.to_java
72
+ jaccount2.id.should == jaccount.id
73
+ jaccount2.time_zone.should == jaccount.time_zone
74
+ jaccount2.reference_time.to_s.should == '2015-09-01T08:01:01.000Z'
75
+ jaccount2.fixed_offset_time_zone.should == jaccount.fixed_offset_time_zone
76
+ end
77
+
78
+ it 'should be able to handle a non-UTC fixed offset timezone' do
79
+ jaccount = ::Killbill::Plugin::Model::Account.new
80
+ jaccount.id = java.util.UUID.fromString('cf5a597a-cf15-45d3-8f02-95371be7f927')
81
+ # Alaska Standard Time
82
+ jaccount.time_zone = org.joda.time.DateTimeZone.forID('America/Juneau')
83
+ # Time zone is AKDT (UTC-8h) between March and November
84
+ jaccount.reference_time = org.joda.time.DateTime.new('2015-09-01T08:01:01.000Z')
85
+ jaccount.fixed_offset_time_zone = org.killbill.billing.util.account.AccountDateTimeUtils.getFixedOffsetTimeZone(jaccount)
86
+
87
+ raccount = Killbill::Plugin::Model::Account.new.to_ruby(jaccount)
88
+ raccount.id.should == 'cf5a597a-cf15-45d3-8f02-95371be7f927'
89
+ raccount.time_zone.should be_an_instance_of TZInfo::DataTimezone
90
+ raccount.time_zone.to_s.should == 'America - Juneau'
91
+ raccount.reference_time.should == '2015-09-01T08:01:01.000Z'
92
+ raccount.fixed_offset_time_zone.should == '-08:00'
93
+
94
+ jaccount2 = raccount.to_java
95
+ jaccount2.id.should == jaccount.id
96
+ jaccount2.time_zone.should == jaccount.time_zone
97
+ jaccount2.reference_time.to_s.should == '2015-09-01T08:01:01.000Z'
98
+ jaccount2.fixed_offset_time_zone.should == jaccount.fixed_offset_time_zone
99
+ end
100
+
56
101
  private
57
102
 
58
103
  def check_notification(notification)
@@ -367,6 +367,14 @@ describe Killbill::Plugin::ActiveMerchant::PaymentPlugin do
367
367
  results.count.should == 1
368
368
  results.last.kb_payment_id.to_s.should == response.kb_payment_id
369
369
  end
370
+
371
+ it "supports decimal currencies" do
372
+ plugin.to_cents(BigDecimal.new('100'), 'USD').should == 10000
373
+ end
374
+
375
+ it "supports non-decimal currencies" do
376
+ plugin.to_cents(BigDecimal.new('100'), 'JPY').should == 100
377
+ end
370
378
  end
371
379
 
372
380
  context 'with a dummy gateway' do
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: 9.4.0
4
+ version: 9.4.1
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: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement