killbill-client 2.2.2 → 2.2.3

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: d4ba3d6fe46c4834ecf4a07d9478c84a7a1f2da3
4
- data.tar.gz: e6c95190aea365b25dc1c635495320963fbda811
3
+ metadata.gz: '090e46016d6dc90be768bc6a3cbfea49b915371b'
4
+ data.tar.gz: c46832276e369c9e98a178998ba293805c7734bc
5
5
  SHA512:
6
- metadata.gz: aeecba9a272ac0d0b3983aaaaaa8f746448f6dc4c8631a407856e4adde4473304d2480947f53e3f8060f75302bffdce39931bd6a39086b8978ef4aa7bee828b5
7
- data.tar.gz: b411ce93126ccd566eec52ceffe9a91ba1ddfe29602bb8934fa09574e96489ce8c235516bbbf6f0358fd18e72da1da2b4d9b9c4bef80cc3599ed2a2e0a2123bd
6
+ metadata.gz: ac458f17fa4d8a794aa63ea8cbfc0e462c4d897b18d013dc2dbbfc871f2c427ef05fb1dd15fce976dfa481fe404418cff27cdcd0d878f7a1bc7c945266b16e0f
7
+ data.tar.gz: a88991d5d604182320d92f5440728cfa2690094785c8759e5fbf0fd6fd182f9fe1d9e94493a0467cef1f37d94f76a7f042c4c6eb10021c922fd669ac8ca15eed
@@ -6,9 +6,11 @@ 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_ACCOUNTS_PREFIX, :account_id
11
12
  has_tags KILLBILL_API_ACCOUNTS_PREFIX, :account_id
13
+ has_audit_logs_with_history KILLBILL_API_ACCOUNTS_PREFIX, :account_id
12
14
 
13
15
  has_many :audit_logs, KillBillClient::Model::AuditLog
14
16
 
@@ -275,6 +277,13 @@ module KillBillClient
275
277
  AccountEmailAttributes
276
278
  end
277
279
 
280
+ def email_audit_logs_with_history(account_email_id, options = {})
281
+ self.class.get "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/emails/#{account_email_id}/auditLogsWithHistory",
282
+ {},
283
+ options,
284
+ AuditLog
285
+ end
286
+
278
287
  def email_notifications(options = {})
279
288
  self.class.get "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/emailNotifications",
280
289
  {},
@@ -371,6 +380,13 @@ module KillBillClient
371
380
  options,
372
381
  InvoicePayment
373
382
  end
383
+
384
+ def audit(options = {})
385
+ self.class.get "#{KILLBILL_API_ACCOUNTS_PREFIX}/#{account_id}/auditLogs",
386
+ {},
387
+ options,
388
+ AuditLog
389
+ end
374
390
  end
375
391
  end
376
392
  end
@@ -1,6 +1,6 @@
1
1
  module KillBillClient
2
2
  module Model
3
- class BulkSubscription < BulkBaseSubscriptionAndAddOnsAttributes
3
+ class BulkSubscription < BulkSubscriptionsBundleAttributes
4
4
 
5
5
  include KillBillClient::Model::CustomFieldHelper
6
6
 
@@ -2,10 +2,14 @@ module KillBillClient
2
2
  module Model
3
3
  class CustomField < CustomFieldAttributes
4
4
 
5
+ include KillBillClient::Model::AuditLogWithHistoryHelper
6
+
5
7
  KILLBILL_API_CUSTOM_FIELDS_PREFIX = "#{KILLBILL_API_PREFIX}/customFields"
6
8
 
7
9
  has_many :audit_logs, KillBillClient::Model::AuditLog
8
10
 
11
+ has_audit_logs_with_history KILLBILL_API_CUSTOM_FIELDS_PREFIX, :custom_field_id
12
+
9
13
  class << self
10
14
  def find_in_batches(offset = 0, limit = 100, options = {})
11
15
  get "#{KILLBILL_API_CUSTOM_FIELDS_PREFIX}/#{Resource::KILLBILL_API_PAGINATION_PREFIX}",
@@ -30,10 +30,13 @@ module KillBillClient
30
30
  class AuditLogAttributes < Resource
31
31
  attribute :change_type
32
32
  attribute :change_date
33
+ attribute :object_type
34
+ attribute :object_id
33
35
  attribute :changed_by
34
36
  attribute :reason_code
35
37
  attribute :comments
36
38
  attribute :user_token
39
+ attribute :history
37
40
  end
38
41
  end
39
42
  end
@@ -27,7 +27,7 @@
27
27
 
28
28
  module KillBillClient
29
29
  module Model
30
- class BulkBaseSubscriptionAndAddOnsAttributes < Resource
30
+ class BulkSubscriptionsBundleAttributes < Resource
31
31
  attribute :base_entitlement_and_add_ons
32
32
  end
33
33
  end
@@ -35,6 +35,7 @@ module KillBillClient
35
35
  attribute :effective_date
36
36
  attribute :account_id
37
37
  attribute :description
38
+ attribute :item_details
38
39
  attribute :audit_logs
39
40
  end
40
41
  end
@@ -31,7 +31,6 @@ require 'killbill_client/models/gen/account_email_attributes'
31
31
  require 'killbill_client/models/gen/tag_attributes'
32
32
  require 'killbill_client/models/gen/invoice_attributes'
33
33
  require 'killbill_client/models/gen/plugin_property_attributes'
34
- require 'killbill_client/models/gen/bulk_base_subscription_and_add_ons_attributes'
35
34
  require 'killbill_client/models/gen/account_timeline_attributes'
36
35
  require 'killbill_client/models/gen/overdue_state_attributes'
37
36
  require 'killbill_client/models/gen/user_roles_attributes'
@@ -43,6 +42,7 @@ require 'killbill_client/models/gen/plugin_info_attributes'
43
42
  require 'killbill_client/models/gen/tag_definition_attributes'
44
43
  require 'killbill_client/models/gen/account_attributes'
45
44
  require 'killbill_client/models/gen/hosted_payment_page_form_descriptor_attributes'
45
+ require 'killbill_client/models/gen/bulk_subscriptions_bundle_attributes'
46
46
  require 'killbill_client/models/gen/blocking_state_attributes'
47
47
  require 'killbill_client/models/gen/invoice_item_attributes'
48
48
  require 'killbill_client/models/gen/role_definition_attributes'
@@ -0,0 +1,23 @@
1
+ module KillBillClient
2
+ module Model
3
+ module AuditLogWithHistoryHelper
4
+
5
+ module ClassMethods
6
+ def has_audit_logs_with_history(url_prefix, id_alias)
7
+ define_method('audit_logs_with_history') do |*args|
8
+ options = args[0] || {}
9
+
10
+ self.class.get "#{url_prefix}/#{send(id_alias)}/auditLogsWithHistory",
11
+ {},
12
+ options,
13
+ AuditLog
14
+ end
15
+ end
16
+ end
17
+
18
+ def self.included(klass)
19
+ klass.extend ClassMethods
20
+ end
21
+ end
22
+ end
23
+ end
@@ -5,6 +5,7 @@ require 'killbill_client/models/gen/require_gen'
5
5
 
6
6
  require 'killbill_client/models/helpers/tag_helper'
7
7
  require 'killbill_client/models/helpers/custom_field_helper'
8
+ require 'killbill_client/models/helpers/audit_log_with_history_helper'
8
9
 
9
10
  require 'killbill_client/models/audit_log'
10
11
  require 'killbill_client/models/event_subscription'
@@ -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_PAYMENTS_PREFIX = "#{KILLBILL_API_PREFIX}/payments"
9
10
 
@@ -13,6 +14,7 @@ module KillBillClient
13
14
 
14
15
  has_custom_fields KILLBILL_API_PAYMENTS_PREFIX, :payment_id
15
16
  has_tags KILLBILL_API_PAYMENTS_PREFIX, :payment_id
17
+ has_audit_logs_with_history KILLBILL_API_PAYMENTS_PREFIX, :payment_id
16
18
 
17
19
  class << self
18
20
  def find_by_id(payment_id, with_plugin_info = false, with_attempts = false, options = {})
@@ -60,6 +62,13 @@ module KillBillClient
60
62
  },
61
63
  options
62
64
  end
65
+
66
+ def attempt_audit_logs_with_history(payment_attempt_id, options = {})
67
+ get "#{KILLBILL_API_PAYMENTS_PREFIX}/attempts/#{payment_attempt_id}/auditLogsWithHistory",
68
+ {},
69
+ options,
70
+ AuditLog
71
+ end
63
72
  end
64
73
  end
65
74
  end
@@ -1,11 +1,16 @@
1
1
  module KillBillClient
2
2
  module Model
3
3
  class PaymentMethod < PaymentMethodAttributes
4
+
5
+ include KillBillClient::Model::AuditLogWithHistoryHelper
6
+
4
7
  KILLBILL_API_PAYMENT_METHODS_PREFIX = "#{KILLBILL_API_PREFIX}/paymentMethods"
5
8
  EXTERNAL_PAYMENT = '__EXTERNAL_PAYMENT__'.freeze
6
9
 
7
10
  has_many :audit_logs, KillBillClient::Model::AuditLog
8
11
 
12
+ has_audit_logs_with_history KILLBILL_API_PAYMENT_METHODS_PREFIX, :payment_method_id
13
+
9
14
  class << self
10
15
  def find_by_id(payment_method_id, with_plugin_info = false, options = {})
11
16
  get "#{KILLBILL_API_PAYMENT_METHODS_PREFIX}/#{payment_method_id}",
@@ -2,10 +2,14 @@ module KillBillClient
2
2
  module Model
3
3
  class Tag < TagAttributes
4
4
 
5
+ include KillBillClient::Model::AuditLogWithHistoryHelper
6
+
5
7
  KILLBILL_API_TAGS_PREFIX = "#{KILLBILL_API_PREFIX}/tags"
6
8
 
7
9
  has_many :audit_logs, KillBillClient::Model::AuditLog
8
10
 
11
+ has_audit_logs_with_history KILLBILL_API_TAGS_PREFIX, :tag_id
12
+
9
13
  class << self
10
14
  def find_in_batches(offset = 0, limit = 100, options = {})
11
15
  get "#{KILLBILL_API_TAGS_PREFIX}/#{Resource::KILLBILL_API_PAGINATION_PREFIX}",
@@ -1,8 +1,13 @@
1
1
  module KillBillClient
2
2
  module Model
3
3
  class TagDefinition < TagDefinitionAttributes
4
+
5
+ include KillBillClient::Model::AuditLogWithHistoryHelper
6
+
4
7
  KILLBILL_API_TAG_DEFINITIONS_PREFIX = "#{KILLBILL_API_PREFIX}/tagDefinitions"
5
8
 
9
+ has_audit_logs_with_history KILLBILL_API_TAG_DEFINITIONS_PREFIX, :id
10
+
6
11
  class << self
7
12
  def all(audit = 'NONE', options = {})
8
13
  get KILLBILL_API_TAG_DEFINITIONS_PREFIX,
@@ -4,11 +4,15 @@ module KillBillClient
4
4
  module Model
5
5
  class Transaction < PaymentTransactionAttributes
6
6
 
7
+ include KillBillClient::Model::AuditLogWithHistoryHelper
8
+
7
9
  KILLBILL_API_TRANSACTIONS_PREFIX = "#{KILLBILL_API_PREFIX}/paymentTransactions"
8
10
 
9
11
  has_many :properties, KillBillClient::Model::PluginPropertyAttributes
10
12
  has_many :audit_logs, KillBillClient::Model::AuditLog
11
13
 
14
+ has_audit_logs_with_history KILLBILL_API_TRANSACTIONS_PREFIX, :transaction_id
15
+
12
16
  def auth(account_id, payment_method_id = nil, user = nil, reason = nil, comment = nil, options = {}, refresh_options = nil)
13
17
  @transaction_type = 'AUTHORIZE'
14
18
  query_map = {}
@@ -2,7 +2,7 @@ module KillBillClient
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 2
5
- PATCH = 2
5
+ PATCH = 3
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
@@ -21,10 +21,10 @@ describe KillBillClient::API do
21
21
  KillBillClient.return_full_stacktraces = true
22
22
  tenant.create(true, 'KillBill Spec test')
23
23
  fail
24
- rescue KillBillClient::API::InternalServerError => e
24
+ rescue KillBillClient::API::Conflict => e
25
25
  billing_exception = JSON.parse(e.response.body)
26
- expect(billing_exception['className']).to eq('java.lang.RuntimeException')
27
- expect(billing_exception['stackTrace'].size).to be >= 90
26
+ expect(billing_exception['className']).to eq('org.killbill.billing.tenant.api.TenantApiException')
27
+ expect(billing_exception['stackTrace'].size).to be >= 70
28
28
  ensure
29
29
  KillBillClient.return_full_stacktraces = false
30
30
  end
@@ -32,18 +32,18 @@ describe KillBillClient::API do
32
32
  begin
33
33
  tenant.create(true, 'KillBill Spec test')
34
34
  fail
35
- rescue KillBillClient::API::InternalServerError => e
35
+ rescue KillBillClient::API::Conflict => e
36
36
  billing_exception = JSON.parse(e.response.body)
37
- expect(billing_exception['className']).to eq('java.lang.RuntimeException')
37
+ expect(billing_exception['className']).to eq('org.killbill.billing.tenant.api.TenantApiException')
38
38
  expect(billing_exception['stackTrace'].size).to be == 0
39
39
  end
40
40
 
41
41
  begin
42
42
  tenant.create(true, 'KillBill Spec test', nil, nil, {:return_full_stacktraces => true})
43
43
  fail
44
- rescue KillBillClient::API::InternalServerError => e
44
+ rescue KillBillClient::API::Conflict => e
45
45
  billing_exception = JSON.parse(e.response.body)
46
- expect(billing_exception['className']).to eq('java.lang.RuntimeException')
46
+ expect(billing_exception['className']).to eq('org.killbill.billing.tenant.api.TenantApiException')
47
47
  expect(billing_exception['stackTrace'].size).to be >= 50
48
48
  end
49
49
  end
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.2.2
4
+ version: 2.2.3
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-04-10 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -81,7 +81,7 @@ files:
81
81
  - lib/killbill_client/models/gen/billing_exception_attributes.rb
82
82
  - lib/killbill_client/models/gen/block_price_override_attributes.rb
83
83
  - lib/killbill_client/models/gen/blocking_state_attributes.rb
84
- - lib/killbill_client/models/gen/bulk_base_subscription_and_add_ons_attributes.rb
84
+ - lib/killbill_client/models/gen/bulk_subscriptions_bundle_attributes.rb
85
85
  - lib/killbill_client/models/gen/bundle_attributes.rb
86
86
  - lib/killbill_client/models/gen/bundle_timeline_attributes.rb
87
87
  - lib/killbill_client/models/gen/catalog_attributes.rb
@@ -151,6 +151,7 @@ files:
151
151
  - lib/killbill_client/models/gen/usage_price_override_attributes.rb
152
152
  - lib/killbill_client/models/gen/usage_record_attributes.rb
153
153
  - lib/killbill_client/models/gen/user_roles_attributes.rb
154
+ - lib/killbill_client/models/helpers/audit_log_with_history_helper.rb
154
155
  - lib/killbill_client/models/helpers/custom_field_helper.rb
155
156
  - lib/killbill_client/models/helpers/tag_helper.rb
156
157
  - lib/killbill_client/models/hosted_payment_page.rb