diff --git a/lib/stripe/errors.rb b/lib/stripe/errors.rb index d4865655f..c91422c12 100644 --- a/lib/stripe/errors.rb +++ b/lib/stripe/errors.rb @@ -27,7 +27,7 @@ def initialize(message = nil, http_status: nil, http_body: nil, @http_headers = http_headers || {} @json_body = json_body @code = code - @request_id = @http_headers[:request_id] + @request_id = @http_headers["request-id"] @error = construct_error_object end diff --git a/test/stripe/errors_test.rb b/test/stripe/errors_test.rb index 817ea13ef..a32c7685e 100644 --- a/test/stripe/errors_test.rb +++ b/test/stripe/errors_test.rb @@ -22,7 +22,7 @@ class StripeErrorTest < Test::Unit::TestCase e = StripeError.new("message", http_status: 200) assert_equal "(Status 200) message", e.to_s - e = StripeError.new("message", http_status: nil, http_body: nil, json_body: nil, http_headers: { request_id: "request-id" }) + e = StripeError.new("message", http_status: nil, http_body: nil, json_body: nil, http_headers: { "request-id" => "request-id" }) assert_equal "(Request request-id) message", e.to_s end end