killbill-client 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ceb8b0864f66479c25d4642ef31864325304bce
4
- data.tar.gz: 274cf455f5228eb2ca616accae4458fdbf1ab36c
3
+ metadata.gz: 8ddae95b2a38eea5300104fce0e92606184bed34
4
+ data.tar.gz: 669f913923892eef204cb64ddff346dfe9fb76b2
5
5
  SHA512:
6
- metadata.gz: a786b42ba432dcfebd288a6c9484ab90c301d5708ccc0ef7b56fd9b9b4d3664f66726a930d1ac9890e18eaf2d3f674581998646a84f53836e116896c1a32024c
7
- data.tar.gz: 24200a5c6168ba05533a8887347679b296bd50a2f12e88e651c1c049d22ea10cd9004520998addc63fd66af43c4ceb1a0cc3b77295bfde0365b068a57ea00124
6
+ metadata.gz: 2c95bcc347ce08c76f84ab3a306227cc3829a3f5462a91f8738343e2d9ea01b868186c8e6f460ce1bc5e91b256b3caf8cf35f5bc94dd393f19a0e3d2c78c7ef4
7
+ data.tar.gz: cc831b9690d0e06d2b0b2ca0dcaacd19bb5f42bf4ca601b28215bec2379fccfe3197ca3ea7a533c20f491b7e1a3ee944560fbc47db316c6d190fef7dca5a6d3b
data/README.md CHANGED
@@ -10,7 +10,8 @@ Kill Bill compatibility
10
10
  | -------------: | ----------------: |
11
11
  | 0.x.y | 0.16.z |
12
12
  | 1.x.y | 0.18.z |
13
- | 2.x.y | 0.19.z |
13
+ | 2.x.y | 0.20.z |
14
+ | 3.x.y | 0.21.z |
14
15
 
15
16
  Installation
16
17
  ------------
@@ -65,6 +65,14 @@ module KillBillClient
65
65
  },
66
66
  options
67
67
  end
68
+
69
+ def blocking_state_audit_logs_with_history(blocking_state_id, options = {})
70
+ get "#{KILLBILL_API_ACCOUNTS_PREFIX}/block/#{blocking_state_id}/auditLogsWithHistory",
71
+ {},
72
+ options,
73
+ AuditLog
74
+ end
75
+
68
76
  end
69
77
 
70
78
  def create(user = nil, reason = nil, comment = nil, options = {})
@@ -370,6 +378,7 @@ module KillBillClient
370
378
  options,
371
379
  AuditLog
372
380
  end
381
+
373
382
  end
374
383
  end
375
384
  end
@@ -0,0 +1,131 @@
1
+ module KillBillClient
2
+ module Model
3
+ class Admin < AdminPaymentAttributes
4
+
5
+ KILLBILL_API_ADMIN_PREFIX = "#{KILLBILL_API_PREFIX}/admin"
6
+ KILLBILL_API_QUEUES_PREFIX = "#{KILLBILL_API_ADMIN_PREFIX}/queues"
7
+
8
+ KILLBILL_API_CLOCK_PREFIX = "#{KILLBILL_API_PREFIX}/test/clock"
9
+
10
+ class << self
11
+ def get_queues_entries(account_id, options = {})
12
+ get KILLBILL_API_QUEUES_PREFIX,
13
+ {
14
+ :accountId => account_id,
15
+ :withHistory => options[:withHistory],
16
+ :minDate => options[:minDate],
17
+ :maxDate => options[:maxDate]
18
+ },
19
+ {
20
+ :accept => 'application/octet-stream'
21
+ }.merge(options)
22
+ end
23
+
24
+ def fix_transaction_state(payment_id, transaction_id, transaction_status, user = nil, reason = nil, comment = nil, options = {})
25
+ put "#{KILLBILL_API_ADMIN_PREFIX}/payments/#{payment_id}/transactions/#{transaction_id}",
26
+ {:transactionStatus => transaction_status}.to_json,
27
+ {},
28
+ {
29
+ :user => user,
30
+ :reason => reason,
31
+ :comment => comment,
32
+ }.merge(options)
33
+ end
34
+
35
+ def trigger_invoice_generation_for_parked_accounts(offset = 0, limit = 100, user =nil, options = {})
36
+ post "#{KILLBILL_API_ADMIN_PREFIX}/invoices",
37
+ {},
38
+ {
39
+ :offset => offset,
40
+ :limit => limit
41
+ },
42
+ {
43
+ :user => user
44
+ }.merge(options)
45
+ end
46
+
47
+ def put_in_rotation(options = {})
48
+ put "#{KILLBILL_API_ADMIN_PREFIX}/healthcheck",
49
+ {},
50
+ {},
51
+ {}.merge(options)
52
+ end
53
+
54
+ def put_out_of_rotation(options = {})
55
+ delete "#{KILLBILL_API_ADMIN_PREFIX}/healthcheck",
56
+ {},
57
+ {},
58
+ {}.merge(options)
59
+ end
60
+
61
+ def invalidates_cache(cache_name = nil, options = {})
62
+ delete "#{KILLBILL_API_ADMIN_PREFIX}/cache",
63
+ {},
64
+ {
65
+ :cacheName => cache_name
66
+ },
67
+ {}.merge(options)
68
+ end
69
+
70
+ def invalidates_cache_by_account(account_id = nil, options = {})
71
+ delete "#{KILLBILL_API_ADMIN_PREFIX}/cache/accounts/#{account_id}",
72
+ {},
73
+ {},
74
+ {}.merge(options)
75
+ end
76
+
77
+ def invalidates_cache_by_tenant(options = {})
78
+ delete "#{KILLBILL_API_ADMIN_PREFIX}/cache/tenants",
79
+ {},
80
+ {},
81
+ {}.merge(options)
82
+ end
83
+
84
+ def get_clock(time_zone, options)
85
+ params = {}
86
+ params[:timeZone] = time_zone unless time_zone.nil?
87
+
88
+ res = get KILLBILL_API_CLOCK_PREFIX,
89
+ params,
90
+ options
91
+ JSON.parse res.body
92
+ end
93
+
94
+ def set_clock(requested_date, time_zone, options)
95
+ params = {}
96
+ params[:requestedDate] = requested_date unless requested_date.nil?
97
+ params[:timeZone] = time_zone unless time_zone.nil?
98
+
99
+ # The default 5s is not always enough
100
+ params[:timeoutSec] ||= 10
101
+
102
+ res = post KILLBILL_API_CLOCK_PREFIX,
103
+ {},
104
+ params,
105
+ {}.merge(options)
106
+ JSON.parse res.body
107
+ end
108
+
109
+ def increment_kb_clock(days, weeks, months, years, time_zone, options)
110
+ params = {}
111
+ params[:days] = days unless days.nil?
112
+ params[:weeks] = weeks unless weeks.nil?
113
+ params[:months] = months unless months.nil?
114
+ params[:years] = years unless years.nil?
115
+ params[:timeZone] = time_zone unless time_zone.nil?
116
+
117
+ # The default 5s is not always enough
118
+ params[:timeoutSec] ||= 10
119
+
120
+ res = put KILLBILL_API_CLOCK_PREFIX,
121
+ {},
122
+ params,
123
+ {}.merge(options)
124
+
125
+ JSON.parse res.body
126
+ end
127
+
128
+ end
129
+ end
130
+ end
131
+ end
@@ -6,12 +6,14 @@ module KillBillClient
6
6
 
7
7
  include KillBillClient::Model::TagHelper
8
8
  include KillBillClient::Model::CustomFieldHelper
9
+ include KillBillClient::Model::AuditLogWithHistoryHelper
9
10
 
10
11
  has_custom_fields KILLBILL_API_BUNDLES_PREFIX, :bundle_id
11
12
  has_tags KILLBILL_API_BUNDLES_PREFIX, :bundle_id
12
13
 
13
14
  has_many :subscriptions, KillBillClient::Model::Subscription
14
15
  has_many :audit_logs, KillBillClient::Model::AuditLog
16
+ has_audit_logs_with_history KILLBILL_API_BUNDLES_PREFIX, :bundle_id
15
17
 
16
18
  class << self
17
19
  def find_in_batches(offset = 0, limit = 100, options = {})
@@ -4,6 +4,7 @@ module KillBillClient
4
4
 
5
5
  include KillBillClient::Model::CustomFieldHelper
6
6
  include KillBillClient::Model::TagHelper
7
+ include KillBillClient::Model::AuditLogWithHistoryHelper
7
8
 
8
9
  KILLBILL_API_INVOICES_PREFIX = "#{KILLBILL_API_PREFIX}/invoices"
9
10
  KILLBILL_API_DRY_RUN_INVOICES_PREFIX = "#{KILLBILL_API_INVOICES_PREFIX}/dryRun"
@@ -14,6 +15,8 @@ module KillBillClient
14
15
 
15
16
  has_custom_fields KILLBILL_API_INVOICES_PREFIX, :invoice_id
16
17
  has_tags KILLBILL_API_INVOICES_PREFIX, :invoice_id
18
+ has_audit_logs_with_history KILLBILL_API_INVOICES_PREFIX, :invoice_id
19
+
17
20
 
18
21
  class << self
19
22
  def find_by_id(invoice_id, with_items = true, audit = "NONE", options = {})
@@ -6,12 +6,15 @@ module KillBillClient
6
6
 
7
7
  include KillBillClient::Model::TagHelper
8
8
  include KillBillClient::Model::CustomFieldHelper
9
+ include KillBillClient::Model::AuditLogWithHistoryHelper
9
10
 
10
11
  has_custom_fields KILLBILL_API_INVOICE_ITEMS_PREFIX, :invoice_item_id
11
12
  has_tags KILLBILL_API_INVOICE_ITEMS_PREFIX, :invoice_item_id
12
-
13
13
  has_many :audit_logs, KillBillClient::Model::AuditLog
14
14
 
15
+ has_audit_logs_with_history KILLBILL_API_INVOICE_ITEMS_PREFIX, :invoice_item_id
16
+
17
+
15
18
  # DO NOT DELETE THIS METHOD
16
19
  def tags(included_deleted = false, audit = 'NONE', options = {})
17
20
  params = {}
@@ -4,6 +4,7 @@ module KillBillClient
4
4
 
5
5
  include KillBillClient::Model::CustomFieldHelper
6
6
  include KillBillClient::Model::TagHelper
7
+ include KillBillClient::Model::AuditLogWithHistoryHelper
7
8
 
8
9
  KILLBILL_API_INVOICE_PAYMENTS_PREFIX = "#{KILLBILL_API_PREFIX}/invoicePayments"
9
10
 
@@ -14,6 +15,8 @@ module KillBillClient
14
15
  has_custom_fields KILLBILL_API_INVOICE_PAYMENTS_PREFIX, :payment_id
15
16
  has_tags KILLBILL_API_INVOICE_PAYMENTS_PREFIX, :payment_id
16
17
 
18
+ has_audit_logs_with_history KILLBILL_API_INVOICE_PAYMENTS_PREFIX, :payment_id
19
+
17
20
  class << self
18
21
  def find_by_id(payment_id, with_plugin_info = false, with_attempts = false, options = {})
19
22
  get "#{KILLBILL_API_INVOICE_PAYMENTS_PREFIX}/#{payment_id}",
@@ -42,6 +42,7 @@ require 'killbill_client/models/usage_record'
42
42
  require 'killbill_client/models/rolled_up_usage'
43
43
  require 'killbill_client/models/account_timeline'
44
44
  require 'killbill_client/models/nodes_info'
45
+ require 'killbill_client/models/admin'
45
46
 
46
47
  require 'killbill_client/models/export'
47
48
 
@@ -4,6 +4,7 @@ module KillBillClient
4
4
 
5
5
  include KillBillClient::Model::TagHelper
6
6
  include KillBillClient::Model::CustomFieldHelper
7
+ include KillBillClient::Model::AuditLogWithHistoryHelper
7
8
 
8
9
  KILLBILL_API_ENTITLEMENT_PREFIX = "#{KILLBILL_API_PREFIX}/subscriptions"
9
10
 
@@ -13,12 +14,22 @@ module KillBillClient
13
14
  has_custom_fields KILLBILL_API_ENTITLEMENT_PREFIX, :subscription_id
14
15
  has_tags KILLBILL_API_ENTITLEMENT_PREFIX, :subscription_id
15
16
 
17
+ has_audit_logs_with_history KILLBILL_API_ENTITLEMENT_PREFIX, :subscription_id
18
+
16
19
  class << self
17
20
  def find_by_id(subscription_id, options = {})
18
21
  get "#{KILLBILL_API_ENTITLEMENT_PREFIX}/#{subscription_id}",
19
22
  {},
20
23
  options
21
24
  end
25
+
26
+ def event_audit_logs_with_history(event_id, options = {})
27
+ get "#{KILLBILL_API_ENTITLEMENT_PREFIX}/events/#{event_id}/auditLogsWithHistory",
28
+ {},
29
+ options,
30
+ AuditLog
31
+ end
32
+
22
33
  end
23
34
  #
24
35
  # Create a new entitlement
@@ -196,6 +207,7 @@ module KillBillClient
196
207
  :comment => comment,
197
208
  }.merge(options)
198
209
  end
210
+
199
211
  end
200
212
  end
201
213
  end
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
- MAJOR = 2
4
- MINOR = 5
3
+ MAJOR = 3
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill 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-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -63,6 +63,7 @@ files:
63
63
  - lib/killbill_client/api/net_http_adapter.rb
64
64
  - lib/killbill_client/models/account.rb
65
65
  - lib/killbill_client/models/account_timeline.rb
66
+ - lib/killbill_client/models/admin.rb
66
67
  - lib/killbill_client/models/audit_log.rb
67
68
  - lib/killbill_client/models/bulk_subscription.rb
68
69
  - lib/killbill_client/models/bundle.rb