Compatible with version minFraud API v1.3 minFraud API documentation minFraud
Your license key is how MaxMind will identify you, so it is required.
Minfraud.configure do |c|
c.license_key = 'abcd1234'
c.requested_type = 'standard'
end
requested_type
can be set during configuration to use that default value or it can be set on the transaction. If unset minFraud will default to the highest level of service available to you.
transaction = Minfraud::Transaction.new do |t|
# Required fields
# Other fields listed later in documentation are optional
t.ip = '1.2.3.4'
t.city = 'richmond'
t.state = 'virginia'
t.postal = '12345'
t.country = 'US' # http://en.wikipedia.org/wiki/ISO_3166-1
# ...
end
transaction.risk_score
# => 3.48
There are four different exceptions that this gem may raise. Please be prepared to handle them:
# Raised if configuration is invalid
class ConfigurationError < ArgumentError; end
# Raised if a transaction is invalid
class TransactionError < ArgumentError; end
# Raised if minFraud returns a client-side error
class ResponseError < StandardError; end
# Raised if minFraud returns a server-side error
class ServerError < StandardError; end
name | type (length) | example | description |
---|---|---|---|
ip | string | t.ip = '1.2.3.4' |
Customer IP address |
city | string | t.city = 'new york' |
Customer city |
state | string | t.state = 'new york' |
Customer state/province/region |
postal | string | t.postal = '10014' |
Customer zip/postal code |
country | string | t.country = 'US' |
Customer ISO 3166-1 country code |
name | type (length) | description |
---|---|---|
ship_addr | string | |
ship_city | string | |
ship_state | string | |
ship_postal | string | |
ship_country | string | |
string | We will hash the email for you | |
phone | string | Any format acceptable |
bin | string | CC bin number (first 6 digits) |
session_id | string | Used for linking transactions |
user_agent | string | Used for linking transactions |
accept_language | string | Used for linking transactions |
txn_id | string | Transaction/order id |
amount | string | Transaction amount |
currency | string | ISO 4217 currency code |
txn_type | string | creditcard/debitcard/paypal/google/other/lead/survey/sitereg |
avs_result | string | Standard AVS response code |
cvv_result | string | Y/N |
requested_type | string | standard/premium |
forwarded_ip | string | The end user’s IP address, as forwarded by a transparent proxy |
- Fork it ( http://github.com/rdpitts/minfraud-ruby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request