diff --git a/README.md b/README.md index 00e529cf..7cbfd151 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ $ gem install minfraud ## Configuration -User Id and License Key are required to work with minFraud API +Account ID and License Key are required to work with minFraud API ```ruby Minfraud.configure do |c| @@ -86,7 +86,7 @@ class RequestFormatError < BaseError; end # Raised if IP address is absent / it is reserved / JSON body can not be decoded class ClientError < BaseError; end -# Raised if there are some problems with the user id and / or license key +# Raised if there are some problems with the account ID and / or license key class AuthorizationError < BaseError; end # Raised if minFraud returns an error, or if there is an HTTP error diff --git a/lib/minfraud.rb b/lib/minfraud.rb index 5674524e..9d1faf2d 100644 --- a/lib/minfraud.rb +++ b/lib/minfraud.rb @@ -27,7 +27,7 @@ module Minfraud class << self # @!attribute user_id - # @return [String] MaxMind username that is used for authorization + # @return [String] MaxMind account ID that is used for authorization attr_accessor :user_id # @!attribute license_key diff --git a/lib/minfraud/error_handler.rb b/lib/minfraud/error_handler.rb index 27ce1b92..abf6c893 100644 --- a/lib/minfraud/error_handler.rb +++ b/lib/minfraud/error_handler.rb @@ -24,14 +24,17 @@ def inspect(response) JSON_INVALID: [ ClientError, 'JSON body cannot be decoded' ], + ACCOUNT_ID_REQUIRED: [ + AuthorizationError, 'You have not supplied a account ID' + ], AUTHORIZATION_INVALID: [ - AuthorizationError, 'Invalid license key and / or user id' + AuthorizationError, 'Invalid license key and / or account ID' ], LICENSE_KEY_REQUIRED: [ AuthorizationError, 'You have not supplied a license key' ], USER_ID_REQUIRED: [ - AuthorizationError, 'You have not supplied a user id' + AuthorizationError, 'You have not supplied a account id' ], INSUFFICIENT_FUNDS: [ ClientError, 'The license key you have provided does not have a sufficient funds to use this service'