From c2a7955197740e34ac3b5b19e0859a8bfb3a1ef0 Mon Sep 17 00:00:00 2001 From: Kyle Le Date: Wed, 6 Mar 2024 21:47:32 +0700 Subject: [PATCH] Sync Admin APIs with Killbill --- lib/killbill_client/models/admin.rb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/killbill_client/models/admin.rb b/lib/killbill_client/models/admin.rb index 4f57af7..1f34aeb 100644 --- a/lib/killbill_client/models/admin.rb +++ b/lib/killbill_client/models/admin.rb @@ -8,22 +8,27 @@ class Admin < AdminPaymentAttributes KILLBILL_API_CLOCK_PREFIX = "#{KILLBILL_API_PREFIX}/test/clock" class << self - def get_queues_entries(account_id, options = {}) + def get_queues_entries(account_id, queue_name = '', service_name = '', with_history = true, min_date = '', max_date = '', with_in_processing = true, with_bus_events = true, with_notifications = true, options = {}) get KILLBILL_API_QUEUES_PREFIX, { :accountId => account_id, - :withHistory => options[:withHistory], - :minDate => options[:minDate], - :maxDate => options[:maxDate] + :queueName => queue_name, + :serviceName => service_name, + :withHistory => with_history, + :minDate => min_date, + :maxDate => max_date, + :withInProcessing => with_in_processing, + :withBusEvents => with_bus_events, + :withNotifications => with_notifications }, { :accept => 'application/octet-stream' }.merge(options) end - def fix_transaction_state(payment_id, transaction_id, transaction_status, user = nil, reason = nil, comment = nil, options = {}) + def fix_transaction_state(payment_id, transaction_id, transaction_status, payment_state_param = {}, user = nil, reason = nil, comment = nil, options = {}) put "#{KILLBILL_API_ADMIN_PREFIX}/payments/#{payment_id}/transactions/#{transaction_id}", - {:transactionStatus => transaction_status}.to_json, + {:transactionStatus => transaction_status}.merge(payment_state_param).to_json, {}, { :user => user, @@ -32,15 +37,18 @@ def fix_transaction_state(payment_id, transaction_id, transaction_status, user = }.merge(options) end - def trigger_invoice_generation_for_parked_accounts(offset = 0, limit = 100, user =nil, options = {}) + def trigger_invoice_generation_for_parked_accounts(offset = 0, limit = 100, plugin_property = [], user = nil, reason = nil, comment = nil, options = {}) post "#{KILLBILL_API_ADMIN_PREFIX}/invoices", {}, { :offset => offset, - :limit => limit + :limit => limit, + :pluginProperty => plugin_property }, { - :user => user + :user => user, + :reason => reason, + :comment => comment, }.merge(options) end