Skip to content

Commit dd9c433

Browse files
Merge pull request #105 from tungleduyxyz/issue_88_add_new_invoices_apis
Issue 88 Sync with Killbill Invoices APIs
2 parents 05fbd96 + c12495e commit dd9c433

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

lib/killbill_client/models/invoice.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,40 @@ def create_migration_invoice(account_id, invoices, target_date, user = nil, reas
321321
}.merge(options)
322322
end
323323

324+
def trigger_invoice_group_run(account_id, target_date = nil, plugin_property = nil, user = nil, reason = nil, comment = nil, options = {})
325+
query_map = {:accountId => account_id}
326+
query_map[:targetDate] = target_date if !target_date.nil?
327+
query_map[:pluginProperty] = plugin_property if !plugin_property.nil?
328+
329+
res = post "#{KILLBILL_API_INVOICES_PREFIX}/group",
330+
{},
331+
query_map,
332+
{
333+
:user => user,
334+
:reason => reason,
335+
:comment => comment,
336+
}.merge(options)
337+
end
338+
339+
def retrieve_invoice_group(account_id, group_id, with_children_items = false, audit = "NONE", options = {})
340+
res = get "#{KILLBILL_API_INVOICES_PREFIX}/#{group_id}/group",
341+
{
342+
:accountId => account_id,
343+
:withChildrenItems => with_children_items,
344+
:audit => audit
345+
},
346+
options
347+
end
348+
349+
def retrieve_payments_for_invoice(invoice_id, with_plugin_info = false, with_attempts = false, audit = "NONE", options = {})
350+
res = get "#{KILLBILL_API_INVOICES_PREFIX}/#{invoice_id}/payments",
351+
{
352+
:withPluginInfo => with_plugin_info,
353+
:withAttempts => with_attempts,
354+
:audit => audit
355+
},
356+
options
357+
end
324358
end
325359

326360
def commit(user = nil, reason = nil, comment = nil, options = {})

0 commit comments

Comments
 (0)