minfraud.*MinFraud.Factors   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
package minfraud
2
3
// Factors executes Factors API.
4
func (s *MinFraud) Factors(req BaseRequest) (*FactorsResponse, error) {
5
	resp := FactorsResponse{}
6
	err := s.client.CallPOST("/v2.0/factors", req, &resp)
7
	if err != nil {
8
		return nil, err
9
	}
10
	return &resp, nil
11
}
12
13
// FactorsResponse has response from Factors API.
14
type FactorsResponse struct {
15
	BaseResponse
16
	IPAddress       IPAddress       `json:"ip_address"`
17
	BillingAddress  BillingAddress  `json:"billing_address"`
18
	CreditCard      CreditCard      `json:"credit_card"`
19
	Device          Device          `json:"device"`
20
	Email           Email           `json:"email"`
21
	ShippingAddress ShippingAddress `json:"shipping_address"`
22
	Subscores       Subscores       `json:"subscores"`
23
}
24
25
func (r FactorsResponse) APIResponse() APIResponse {
26
	return APIResponse(r)
27
}
28