Documentation
¶
Index ¶
- type APIResponse
- type AccountData
- type BaseRequest
- type BaseResponse
- type BillingAddress
- type BillingData
- type City
- type Confidence
- type Continent
- type Country
- type CountryData
- type CreditCard
- type CreditCardData
- type Device
- type DeviceData
- type Disposition
- type Domain
- type Email
- type EmailData
- type ErrData
- type EventData
- type FactorsResponse
- type GeoNameID
- type IPAddress
- type InsightsResponse
- type Issuer
- type Location
- type MinFraud
- func (s *MinFraud) Factors(req BaseRequest) (*FactorsResponse, error)
- func (s *MinFraud) Insights(req BaseRequest) (*InsightsResponse, error)
- func (s *MinFraud) InsightsByIP(ipaddr string) (*InsightsResponse, error)
- func (s *MinFraud) Score(req BaseRequest) (*ScoreResponse, error)
- func (s *MinFraud) ScoreByIP(ipaddr string) (*ScoreResponse, error)
- func (s *MinFraud) SetLogger(logger log.Logger)
- type Names
- type OrderData
- type PaymentData
- type Postal
- type RegisteredCountry
- type RepresentedCountry
- type RiskReason
- type ScoreResponse
- type ShippingAddress
- type ShippingData
- type ShoppingCartData
- type Subdivision
- type Subscores
- type Traits
- type Warning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse struct {
BaseResponse
IPAddress IPAddress `json:"ip_address"`
BillingAddress BillingAddress `json:"billing_address"`
CreditCard CreditCard `json:"credit_card"`
Device Device `json:"device"`
Email Email `json:"email"`
ShippingAddress ShippingAddress `json:"shipping_address"`
Subscores Subscores `json:"subscores"`
}
APIResponse is used to align the type from API request.
type AccountData ¶
type BaseRequest ¶
type BaseRequest struct {
Account *AccountData `json:"account,omitempty"`
Billing *BillingData `json:"billing,omitempty"`
CreditCard *CreditCardData `json:"credit_card,omitempty"`
Device *DeviceData `json:"device,omitempty"`
Email *EmailData `json:"email,omitempty"`
Event *EventData `json:"event,omitempty"`
Order *OrderData `json:"order,omitempty"`
Payment *PaymentData `json:"payment,omitempty"`
Shipping *ShippingData `json:"shipping,omitempty"`
ShoppingCart []ShoppingCartData `json:"shopping_cart,omitempty"`
// ref: https://support.maxmind.com/custom-inputs-guide/
CustomInputs interface{} `json:"custom_inputs,omitempty"`
}
BaseRequest is common request of minFraud API. ref: https://dev.maxmind.com/minfraud/api-documentation/requests
type BaseResponse ¶
type BaseResponse struct {
ErrData
Disposition Disposition `json:"disposition"`
FundsRemaining float64 `json:"funds_remaining"`
ID string `json:"id"`
QueriesRemaining int64 `json:"queries_remaining"`
RiskScore float64 `json:"risk_score"` // from 0.01 to 99
Warnings []Warning `json:"warnings"`
}
BaseResponse is common response of minFraud API. ref: https://dev.maxmind.com/minfraud/api-documentation/responses
func (BaseResponse) HasError ¶
func (r BaseResponse) HasError() bool
type BillingAddress ¶
type BillingData ¶
type BillingData struct {
Address string `json:"address,omitempty"`
Address2 string `json:"address_2,omitempty"`
City string `json:"city,omitempty"`
Company string `json:"company,omitempty"`
Country string `json:"country,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
PhoneCountryCode string `json:"phone_country_code,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
Postal string `json:"postal,omitempty"`
Region string `json:"region,omitempty"`
}
type City ¶
type City struct {
Confidence Confidence `json:"confidence"`
GeoNameID GeoNameID `json:"geoname_id"`
Names Names `json:"names"`
}
type Country ¶
type Country struct {
Confidence Confidence `json:"confidence"`
CountryData
}
type CountryData ¶
type CountryData struct {
GeoNameID GeoNameID `json:"geoname_id"`
IsInEuropeanUnion bool `json:"is_in_european_union"`
ISOCode string `json:"iso_code"` // ISO 3166-1 alpha-2
Names Names `json:"names"`
}
common data for country type object.
type CreditCard ¶
type CreditCard struct {
Brand string `json:"brand"`
Country string `json:"country"`
IsBusiness bool `json:"is_business"`
IsIssuedInBillingAddressCountry bool `json:"is_issued_in_billing_address_country"`
IsPrepaid bool `json:"is_prepaid"`
IsVirtual bool `json:"is_virtual"`
Issuer Issuer `json:"issuer"`
Type string `json:"type"`
}
type CreditCardData ¶
type CreditCardData struct {
AVSResult string `json:"avs_result,omitempty"`
BankName string `json:"bank_name,omitempty"`
BankPhoneCountryCode string `json:"bank_phone_country_code,omitempty"`
BankPhoneNumber string `json:"bank_phone_number,omitempty"`
CVVResult string `json:"cvv_result,omitempty"`
IssuerIDNumber string `json:"issuer_id_number,omitempty"`
Last4Digits string `json:"last_4_digits,omitempty"`
Token string `json:"token,omitempty"`
Was3DSecureSuccessful *bool `json:"was_3d_secure_successful,omitempty"`
}
type Device ¶
type Device struct {
Confidence Confidence `json:"confidence"`
ID string `json:"id"`
LastSeen string `json:"last_seen"`
LocalTime string `json:"local_time"`
}
type DeviceData ¶
type Disposition ¶
type FactorsResponse ¶
type FactorsResponse struct {
BaseResponse
IPAddress IPAddress `json:"ip_address"`
BillingAddress BillingAddress `json:"billing_address"`
CreditCard CreditCard `json:"credit_card"`
Device Device `json:"device"`
Email Email `json:"email"`
ShippingAddress ShippingAddress `json:"shipping_address"`
Subscores Subscores `json:"subscores"`
}
FactorsResponse has response from Factors API.
func (FactorsResponse) APIResponse ¶
func (r FactorsResponse) APIResponse() APIResponse
type IPAddress ¶
type IPAddress struct {
Risk float64 `json:"risk"` // from 0.01 to 99
City City `json:"city"`
Continent Continent `json:"continent"`
Country Country `json:"country"`
Location Location `json:"location"`
Postal Postal `json:"postal"`
RegisteredCountry RegisteredCountry `json:"registered_country"`
RepresentedCountry RepresentedCountry `json:"represented_country"`
RiskReasons []RiskReason `json:"risk_reasons"`
Subdivisions []Subdivision `json:"subdivisions"`
Traits Traits `json:"traits"`
}
type InsightsResponse ¶
type InsightsResponse struct {
BaseResponse
IPAddress IPAddress `json:"ip_address"`
BillingAddress BillingAddress `json:"billing_address"`
CreditCard CreditCard `json:"credit_card"`
Device Device `json:"device"`
Email Email `json:"email"`
ShippingAddress ShippingAddress `json:"shipping_address"`
}
InsightsResponse has response from Insights API.
func (InsightsResponse) APIResponse ¶
func (r InsightsResponse) APIResponse() APIResponse
type Location ¶
type Location struct {
AccuracyRadius int64 `json:"accuracy_radius"` // in Killometers
AverageIncome float64 `json:"average_income"` // in USD
Latitude float64 `json:"latitude"`
LocalTime string `json:"local_time"`
Longitude float64 `json:"longitude"`
MetroCode int64 `json:"metro_code"`
PopulationDensity int64 `json:"population_density"` // only for US
TimeZone string `json:"time_zone"`
}
type MinFraud ¶
type MinFraud struct {
// contains filtered or unexported fields
}
MinFraud is service struct for MinFraud API.
func (*MinFraud) Factors ¶
func (s *MinFraud) Factors(req BaseRequest) (*FactorsResponse, error)
Factors executes Factors API.
func (*MinFraud) Insights ¶
func (s *MinFraud) Insights(req BaseRequest) (*InsightsResponse, error)
Insights executes Insights API.
func (*MinFraud) InsightsByIP ¶
func (s *MinFraud) InsightsByIP(ipaddr string) (*InsightsResponse, error)
InsightsByIP executes Insights API with only ip address parameter.
func (*MinFraud) Score ¶
func (s *MinFraud) Score(req BaseRequest) (*ScoreResponse, error)
Score executes Score API.
type OrderData ¶
type OrderData struct {
AffiliateID string `json:"affiliateID,omitempty"`
Amount *float64 `json:"amount,omitempty"`
Currency string `json:"currency,omitempty"`
DiscountCode string `json:"discount_code,omitempty"`
HasGiftMessage *bool `json:"has_gift_message,omitempty"`
IsGift *bool `json:"is_gift,omitempty"`
ReferrerURI string `json:"referrer_uri,omitempty"`
SubaffiliateID string `json:"subaffiliate_id,omitempty"`
}
type PaymentData ¶
type Postal ¶
type Postal struct {
Code string `json:"code"`
Confidence Confidence `json:"confidence"`
}
type RegisteredCountry ¶
type RegisteredCountry struct {
CountryData
}
type RepresentedCountry ¶
type RepresentedCountry struct {
CountryData
Type string `json:"type"`
}
type RiskReason ¶
type ScoreResponse ¶
type ScoreResponse struct {
BaseResponse
IPAddress IPAddress `json:"ip_address"`
}
ScoreResponse has response from Score API.
func (ScoreResponse) APIResponse ¶
func (r ScoreResponse) APIResponse() APIResponse
type ShippingAddress ¶
type ShippingAddress struct {
DistanceToBillingAddress int64 `json:"distance_to_billing_address"`
DistanceToIPLocation int64 `json:"distance_to_ip_location"`
IsHighRisk bool `json:"is_high_risk"`
IsInIPCountry bool `json:"is_in_ip_country"`
IsPostalInCity bool `json:"is_postal_in_city"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
}
type ShippingData ¶
type ShippingData struct {
Address string `json:"address,omitempty"`
Address2 string `json:"address_2,omitempty"`
City string `json:"city,omitempty"`
Company string `json:"company,omitempty"`
Country string `json:"country,omitempty"`
DeliverySpeed string `json:"delivery_speed,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
PhoneCountryCode string `json:"phone_country_code,omitempty"`
PhoneNumber string `json:"phone_number,omitempty"`
Postal string `json:"postal,omitempty"`
Region string `json:"region,omitempty"`
}
type ShoppingCartData ¶
type Subdivision ¶
type Subdivision struct {
GeoNameID GeoNameID `json:"geoname_id"`
ISOCode string `json:"iso_code"` // ISO 3166-1 alpha-2
Names Names `json:"names"`
Confidence Confidence `json:"confidence"`
}
type Subscores ¶
type Subscores struct {
AVSResult float64 `json:"avs_result"`
BillingAddress float64 `json:"billing_address"`
BillingAddressDistanceToIPLocation float64 `json:"billing_address_distance_to_ip_location"`
Browser float64 `json:"browser"`
Chargeback float64 `json:"chargeback"`
Country float64 `json:"country"`
CountryMismatch float64 `json:"country_mismatch"`
CVVResult float64 `json:"cvv_result"`
Device float64 `json:"device"`
EmailAddress float64 `json:"email_address"`
EmailDomain float64 `json:"email_domain"`
EmailLocalPart float64 `json:"email_local_part"`
IssuerIDNumber float64 `json:"issuer_id_number"`
OrderAmount float64 `json:"order_amount"`
PhoneNumber float64 `json:"phone_number"`
ShippingAddress float64 `json:"shipping_address"`
ShippingAddressDistanceToIPLocation float64 `json:"shipping_address_distance_to_ip_location"`
TimeOfDay float64 `json:"time_of_day"`
}
type Traits ¶
type Traits struct {
AutonomousSystemNumber int64 `json:"autonomous_system_number"`
AutonomousSystemOrganization string `json:"autonomous_system_organization"`
Domain string `json:"domain"`
IPAddress string `json:"ip_address"`
IsAnonymous bool `json:"is_anonymous"`
IsAnonymousVPN bool `json:"is_anonymous_vpn"`
IsHostingProvider bool `json:"is_hosting_provider"`
IsPublicProxy bool `json:"is_public_proxy"`
IsResidentialProxy bool `json:"is_residential_proxy"`
IsTorExitNode bool `json:"is_tor_exit_node"`
ISP string `json:"isp"`
Network string `json:"network"`
Organization string `json:"organization"`
StaticIPScore float64 `json:"static_ip_score"` // 0 ~ 99.99
UserCount int64 `json:"user_count"`
UserType string `json:"user_type"`
}