From d9401b40fc88c6992a0de998e52a65341f183fee Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 21 Feb 2018 15:14:17 -0800 Subject: [PATCH 1/2] Handle ACCOUNT_ID_REQUIRED error --- lib/minfraud/error_handler.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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' From f318da199a98547394138b123051c237d0747931 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Wed, 21 Feb 2018 15:14:39 -0800 Subject: [PATCH 2/2] Standardize text to refer to account ID --- README.md | 4 ++-- lib/minfraud.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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