diff --git a/lib/killbill_client/api/net_http_adapter.rb b/lib/killbill_client/api/net_http_adapter.rb index c5359fc..68b23c7 100644 --- a/lib/killbill_client/api/net_http_adapter.rb +++ b/lib/killbill_client/api/net_http_adapter.rb @@ -157,7 +157,7 @@ def encode_params(options = {}) options[:params][:withStackTrace] = true end - pairs = options[:params].filter_map { |key, value| + pairs = options[:params].map { |key, value| next if value.nil? # If the value is an array, we 'demultiplex' into several @@ -169,7 +169,7 @@ def encode_params(options = {}) else "#{CGI.escape key.to_s}=#{CGI.escape value.to_s}" end - } + }.compact pairs.flatten! return nil if pairs.empty? "?#{pairs.join '&'}" diff --git a/lib/killbill_client/models/invoice.rb b/lib/killbill_client/models/invoice.rb index d0b0e6f..8832576 100644 --- a/lib/killbill_client/models/invoice.rb +++ b/lib/killbill_client/models/invoice.rb @@ -212,7 +212,7 @@ def cancel_subscription_dry_run(account_id, bundle_id, subscription_id, target_d def get_invoice_template(is_manual_pay, locale = nil, options = {}) require_multi_tenant_options!(options, "Retrieving an invoice template supported in multi-tenant mode") - + locale ||= 'en' get "#{KILLBILL_API_INVOICES_PREFIX}/#{is_manual_pay ? "manualPayTemplate/#{locale}" : "template"}", {},