killbill-client 2.3.0 → 2.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83130edfd69e4755b2870008a499dffbf8018514
4
- data.tar.gz: adc1f2acc20d39b5b360209ffc71141fe0863af9
3
+ metadata.gz: 403d07c57a0a99bf52f0f217a1c4c7378e5294f7
4
+ data.tar.gz: 4370530c0ea0d936fd0eebaed4b18fa8e91a857a
5
5
  SHA512:
6
- metadata.gz: c90240811ecbbc19b9ef1e390e2005d7fb2826d035490107d9f2d84335df929ed1d8451704169149dd1a21eccad2afb7c307294ed0b2ec6d76f980c833b59eb8
7
- data.tar.gz: d71174faf6cb5493963550de3dd2dde1542e74a6bc53b85282242a02d14c5cdf61f546c52d163d72ec831fb31049a43dfea586e844c2f3050b13b191b3b0df3a
6
+ metadata.gz: be815f450d26601ab84be6df5772f5c04d6f4d2098fd6d0073cf755ddc63993e4cf4f2d538bfd179a95f1f21d66b65af572f975deacb6b001e6379d3dc3d5d8d
7
+ data.tar.gz: beb28a9976f35f6b33c43739a137a4904db99f40171d2bfff0f63a1f3048191883595b12d974cc6dce680943e507e48074977168f94a4396b66051db7ad7945e
@@ -34,6 +34,16 @@ module KillBillClient
34
34
  options
35
35
  end
36
36
 
37
+ def find_by_invoice_item_id(invoice_item_id, with_items = true, with_children_items = false, audit = "NONE", options = {})
38
+ get "#{KILLBILL_API_INVOICES_PREFIX}/byItemId/#{invoice_item_id}",
39
+ {
40
+ :withChildrenItems => with_children_items,
41
+ :withItems => with_items,
42
+ :audit => audit
43
+ },
44
+ options
45
+ end
46
+
37
47
  def find_in_batches(offset = 0, limit = 100, options = {})
38
48
  get "#{KILLBILL_API_INVOICES_PREFIX}/#{Resource::KILLBILL_API_PAGINATION_PREFIX}",
39
49
  {
@@ -82,6 +82,18 @@ module KillBillClient
82
82
  :comment => comment,
83
83
  }.merge(options)
84
84
  end
85
+
86
+ def create_tax_item(auto_commit = false, user = nil, reason = nil, comment = nil, options = {})
87
+ created_tax_item = self.class.post "#{Invoice::KILLBILL_API_INVOICES_PREFIX}/taxes/#{account_id}",
88
+ [to_hash].to_json,
89
+ {:autoCommit => auto_commit},
90
+ {
91
+ :user => user,
92
+ :reason => reason,
93
+ :comment => comment,
94
+ }.merge(options)
95
+ created_tax_item.first.refresh(options, Invoice)
96
+ end
85
97
  end
86
98
  end
87
99
  end
@@ -45,6 +45,17 @@ module KillBillClient
45
45
  options
46
46
  end
47
47
 
48
+ def find_by_transaction_external_key(external_key, with_plugin_info = false, with_attempts = false, audit='NONE', options = {})
49
+ get "#{Transaction::KILLBILL_API_TRANSACTIONS_PREFIX}",
50
+ {
51
+ :audit => audit,
52
+ :transactionExternalKey => external_key,
53
+ :withAttempts => with_attempts,
54
+ :withPluginInfo => with_plugin_info
55
+ },
56
+ options
57
+ end
58
+
48
59
  def find_in_batches(offset = 0, limit = 100, options = {})
49
60
  get "#{KILLBILL_API_PAYMENTS_PREFIX}/#{Resource::KILLBILL_API_PAGINATION_PREFIX}",
50
61
  {
@@ -253,7 +253,11 @@ module KillBillClient
253
253
 
254
254
  def refresh(options = {}, clazz=self.class)
255
255
  if @uri
256
- self.class.get @uri, {}, options, clazz
256
+ # Need to decode in case an encoding is in place (e.g. /1.0/kb/security/users/Mad%20Max/roles) , since later on
257
+ # it will be encoded and can cause an undesired result on the call.
258
+ unecoded_uri = URI::DEFAULT_PARSER.unescape(@uri)
259
+
260
+ self.class.get unecoded_uri, {}, options, clazz
257
261
  else
258
262
  self
259
263
  end
@@ -1,7 +1,7 @@
1
1
  module KillBillClient
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 3
4
+ MINOR = 4
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
@@ -4,7 +4,7 @@ describe KillBillClient::Model do
4
4
  before do
5
5
  KillBillClient.return_full_stacktraces = true
6
6
 
7
- KillBillClient.api_key = Time.now.to_i.to_s + rand(100).to_s
7
+ KillBillClient.api_key = SecureRandom.uuid.to_s + rand(100).to_s
8
8
  KillBillClient.api_secret = KillBillClient.api_key
9
9
 
10
10
  tenant = KillBillClient::Model::Tenant.new
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.3.0
4
+ version: 2.4.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-06-04 00:00:00.000000000 Z
11
+ date: 2018-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake