killbill-client 0.10.0 → 0.10.1

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: 75bf7d59e96e17a390cffc8edfb8ab7f90065d45
4
- data.tar.gz: e7c652361b59eec8d6652fff1e9121791e00399d
3
+ metadata.gz: 788d7065b7237d50be776ddc91dc1e3735e3d3bf
4
+ data.tar.gz: ae5f33685d7efd5bef9bc05d940769462706b45e
5
5
  SHA512:
6
- metadata.gz: 57412421f060377af41b315788714decf20a9c76fcbe2aa3222fd784ad03d848371ca72e0e846887523d147f2021fb46d0a4f8322296101bfd9cc5f56aec7726
7
- data.tar.gz: 862723977d20540820b53c2d3c26ad3665cdac65d133b53850d8b8868cafdea5c0993cdc83a8989635d57f8534b99bccc9a1b98f6fcca3c5c7c2999f7425eb04
6
+ metadata.gz: 9d261e396f79d562f0ac4b154d0b578389adf48a86e6fc6ff3ef286b44b622416e6f897b0d93539283c9b40a50dccc77a5bc7fb3169d91ada93e4a20a4c6cb4d
7
+ data.tar.gz: 2987504288ee8ef3958c3b531a2febe5a87ad01414a7768ed6a377a60fd75a43c7f7d51ed4389b35b5747913314394c08c4a8251312c995fc5c4425d9fc9767d
@@ -186,6 +186,109 @@ module KillBillClient
186
186
  end
187
187
  end
188
188
 
189
+
190
+ def get_invoice_template(is_manual_pay, options = {})
191
+ if options[:api_key].nil? || options[:api_secret].nil?
192
+ raise ArgumentError, "Retrieving an invoice template supported in multi-tenant mode"
193
+ end
194
+
195
+ get "#{KILLBILL_API_INVOICES_PREFIX}/#{is_manual_pay ? "manualPayTemplate" : "template"}",
196
+ {},
197
+ {
198
+ :head => {'Accept' => 'text/html'},
199
+ }.merge(options)
200
+ end
201
+
202
+ def upload_invoice_template(invoice_template, is_manual_pay, delete_if_exists, user = nil, reason = nil, comment = nil, options = {})
203
+ if options[:api_key].nil? || options[:api_secret].nil?
204
+ raise ArgumentError, "Uploading a invoice template is only supported in multi-tenant mode"
205
+ end
206
+
207
+ params = {}
208
+ params[:deleteIfExists] = delete_if_exists if delete_if_exists
209
+
210
+ post "#{KILLBILL_API_INVOICES_PREFIX}/#{is_manual_pay ? "manualPayTemplate" : "template"}",
211
+ invoice_template,
212
+ params,
213
+ {
214
+ :head => {'Accept' => 'text/html'},
215
+ :content_type => 'text/html',
216
+ :user => user,
217
+ :reason => reason,
218
+ :comment => comment,
219
+ }.merge(options)
220
+ get_invoice_template(is_manual_pay, options)
221
+ end
222
+
223
+ def get_invoice_translation(locale, options = {})
224
+ if options[:api_key].nil? || options[:api_secret].nil?
225
+ raise ArgumentError, "Retrieving an invoice template supported in multi-tenant mode"
226
+ end
227
+
228
+ get "#{KILLBILL_API_INVOICES_PREFIX}/translation/#{locale}",
229
+ {},
230
+ {
231
+ :head => {'Accept' => 'text/plain'},
232
+ }.merge(options)
233
+ end
234
+
235
+ def upload_invoice_translation(invoice_translation, locale, delete_if_exists, user = nil, reason = nil, comment = nil, options = {})
236
+ if options[:api_key].nil? || options[:api_secret].nil?
237
+ raise ArgumentError, "Uploading a invoice template is only supported in multi-tenant mode"
238
+ end
239
+
240
+ params = {}
241
+ params[:deleteIfExists] = delete_if_exists if delete_if_exists
242
+
243
+ post "#{KILLBILL_API_INVOICES_PREFIX}/translation/#{locale}",
244
+ invoice_translation,
245
+ params,
246
+ {
247
+ :head => {'Accept' => 'text/plain'},
248
+ :content_type => 'text/plain',
249
+ :user => user,
250
+ :reason => reason,
251
+ :comment => comment,
252
+ }.merge(options)
253
+ get_invoice_translation(locale, options)
254
+ end
255
+
256
+
257
+ def get_catalog_translation(locale, options = {})
258
+ if options[:api_key].nil? || options[:api_secret].nil?
259
+ raise ArgumentError, "Retrieving a catalog translation is only supported in multi-tenant mode"
260
+ end
261
+
262
+ get "#{KILLBILL_API_INVOICES_PREFIX}/catalogTranslation/#{locale}",
263
+ {},
264
+ {
265
+ :head => {'Accept' => 'text/plain'},
266
+ }.merge(options)
267
+ end
268
+
269
+ def upload_catalog_translation(catalog_translation, locale, delete_if_exists, user = nil, reason = nil, comment = nil, options = {})
270
+ if options[:api_key].nil? || options[:api_secret].nil?
271
+ raise ArgumentError, "Uploading a catalog translation is only supported in multi-tenant mode"
272
+ end
273
+
274
+ params = {}
275
+ params[:deleteIfExists] = delete_if_exists if delete_if_exists
276
+
277
+ post "#{KILLBILL_API_INVOICES_PREFIX}/catalogTranslation/#{locale}",
278
+ catalog_translation,
279
+ params,
280
+ {
281
+ :head => {'Accept' => 'text/plain'},
282
+ :content_type => 'text/plain',
283
+ :user => user,
284
+ :reason => reason,
285
+ :comment => comment,
286
+ }.merge(options)
287
+ get_catalog_translation(locale, options)
288
+ end
289
+
290
+
291
+
189
292
  end
190
293
 
191
294
  def payments(with_plugin_info = false, audit = 'NONE', options = {})
@@ -58,7 +58,9 @@ module KillBillClient
58
58
  def from_response(resource_class, response)
59
59
  case response['Content-Type']
60
60
  when %r{application/pdf}
61
+ response.body
61
62
  when %r{text/html}
63
+ response.body
62
64
  when %r{text/plain}
63
65
  response.body
64
66
  when %r{application/xml}
@@ -2,7 +2,7 @@ module KillBillClient
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 10
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  VERSION = [MAJOR, MINOR, PATCH, PRE].compact.join('.').freeze
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: 0.10.0
4
+ version: 0.10.1
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: 2014-12-19 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json