Skip to content

Commit b2cf04e

Browse files
committed
Fix failure cases with integration test
1 parent 41b8af9 commit b2cf04e

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/killbill_client/api/net_http_adapter.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def encode_params(options = {})
157157
options[:params][:withStackTrace] = true
158158
end
159159

160-
pairs = options[:params].filter_map { |key, value|
160+
pairs = options[:params].map { |key, value|
161161
next if value.nil?
162162

163163
# If the value is an array, we 'demultiplex' into several
@@ -169,7 +169,7 @@ def encode_params(options = {})
169169
else
170170
"#{CGI.escape key.to_s}=#{CGI.escape value.to_s}"
171171
end
172-
}
172+
}.compact
173173
pairs.flatten!
174174
return nil if pairs.empty?
175175
"?#{pairs.join '&'}"
@@ -197,7 +197,10 @@ def request(method, relative_uri, options = {})
197197
head.update options[:head] if options[:head]
198198
head.delete_if { |_, value| value.nil? }
199199

200+
puts "Tung====================#{relative_uri} #{options}"
200201
uri = build_uri(relative_uri, options)
202+
203+
puts "Tung====================#{uri}"
201204
request = METHODS[method].new uri.request_uri, head
202205

203206
# Configure multi-tenancy headers, if enabled
@@ -276,6 +279,9 @@ def request(method, relative_uri, options = {})
276279
end
277280

278281
response = http.start { http.request request }
282+
puts "Tungrequest====================#{request.to_hash}"
283+
puts "Tungrequest====================#{request.body}"
284+
puts "Tungresponse====================#{response.body}"
279285
code = response.code.to_i
280286

281287
# Add profiling data if required

lib/killbill_client/models/invoice.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def cancel_subscription_dry_run(account_id, bundle_id, subscription_id, target_d
212212
def get_invoice_template(is_manual_pay, locale = nil, options = {})
213213

214214
require_multi_tenant_options!(options, "Retrieving an invoice template supported in multi-tenant mode")
215-
215+
locale ||= 'en'
216216

217217
get "#{KILLBILL_API_INVOICES_PREFIX}/#{is_manual_pay ? "manualPayTemplate/#{locale}" : "template"}",
218218
{},

0 commit comments

Comments
 (0)