| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 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 |