diff --git a/lib/eway_rapid/rapid_client.rb b/lib/eway_rapid/rapid_client.rb index a5b34d3..51d99fb 100644 --- a/lib/eway_rapid/rapid_client.rb +++ b/lib/eway_rapid/rapid_client.rb @@ -298,7 +298,7 @@ def settlement_search(search_request) # @param [String] language The 2 letter code for the language to translate to (only en at this time) # @return [String] Error message def self.user_display_message(code, language = 'en') - find_error_code(code, language) + find_error_code(code, language.downcase) end # Gets the valid status of this Rapid client diff --git a/test/eway_rapid/rapid_client_test.rb b/test/eway_rapid/rapid_client_test.rb index 4d0e608..fdd6185 100644 --- a/test/eway_rapid/rapid_client_test.rb +++ b/test/eway_rapid/rapid_client_test.rb @@ -109,4 +109,10 @@ def test_find_error_code error_code = 'S9991' assert_equal('Library does not have PublicAPI key initialised, or Key is Invalid', EwayRapid::RapidClient.user_display_message(error_code)) end + + def test_find_error_code_with_langugage + error_code = 'S9991' + assert_equal('Library does not have PublicAPI key initialised, or Key is Invalid', EwayRapid::RapidClient.user_display_message(error_code, 'en')) + assert_equal('Library does not have PublicAPI key initialised, or Key is Invalid', EwayRapid::RapidClient.user_display_message(error_code, 'EN')) + end end \ No newline at end of file