-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrequest_types.go
149 lines (131 loc) · 6.44 KB
/
request_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package incognia
import "time"
type Coordinates struct {
Lat float64 `json:"lat"`
Lng float64 `json:"lng"`
}
type StructuredAddress struct {
Locale string `json:"locale"`
CountryName string `json:"country_name"`
CountryCode string `json:"country_code"`
State string `json:"state"`
City string `json:"city"`
Borough string `json:"borough"`
Neighborhood string `json:"neighborhood"`
Street string `json:"street"`
Number string `json:"number"`
Complements string `json:"complements"`
PostalCode string `json:"postal_code"`
}
type postAssessmentRequestBody struct {
InstallationID string `json:"installation_id,omitempty"`
RequestToken string `json:"request_token,omitempty"`
SessionToken string `json:"session_token,omitempty"`
AddressLine string `json:"address_line,omitempty"`
StructuredAddress *StructuredAddress `json:"structured_address,omitempty"`
Coordinates *Coordinates `json:"address_coordinates,omitempty"`
AccountID string `json:"account_id,omitempty"`
PolicyID string `json:"policy_id,omitempty"`
ExternalID string `json:"external_id,omitempty"`
CustomProperties map[string]interface{} `json:"custom_properties,omitempty"`
}
type FeedbackType string
const (
AccountAllowed FeedbackType = "account_allowed"
DeviceAllowed FeedbackType = "device_allowed"
Verified FeedbackType = "verified"
Reset FeedbackType = "reset"
AccountTakeover FeedbackType = "account_takeover"
IdentityFraud FeedbackType = "identity_fraud"
Chargeback FeedbackType = "chargeback"
ChargebackNotification FeedbackType = "chargeback_notification"
PromotionAbuse FeedbackType = "promotion_abuse"
LoginAccepted FeedbackType = "login_accepted"
LoginAcceptedByDeviceVerification FeedbackType = "login_accepted_by_device_verification"
LoginAcceptedByFacialBiometrics FeedbackType = "login_accepted_by_facial_biometrics"
LoginAcceptedByManualReview FeedbackType = "login_accepted_by_manual_review"
LoginDeclined FeedbackType = "login_declined"
LoginDeclinedByFacialBiometrics FeedbackType = "login_declined_by_facial_biometrics"
LoginDeclinedByManualReview FeedbackType = "login_declined_by_manual_review"
PaymentAccepted FeedbackType = "payment_accepted"
PaymentAcceptedByControlGroup FeedbackType = "payment_accepted_by_control_group"
PaymentAcceptedByThirdParty FeedbackType = "payment_accepted_by_third_party"
PaymentDeclined FeedbackType = "payment_declined"
PaymentDeclinedByAcquirer FeedbackType = "payment_declined_by_acquirer"
PaymentDeclinedByBusiness FeedbackType = "payment_declined_by_business"
PaymentDeclinedByManualReview FeedbackType = "payment_declined_by_manual_review"
PaymentDeclinedByRiskAnalysis FeedbackType = "payment_declined_by_risk_analysis"
SignupAccepted FeedbackType = "signup_accepted"
SignupDeclined FeedbackType = "signup_declined"
)
type postFeedbackRequestBody struct {
Event FeedbackType `json:"event"`
OccurredAt *time.Time `json:"occurred_at,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
InstallationID string `json:"installation_id,omitempty"`
SessionToken string `json:"session_token,omitempty"`
RequestToken string `json:"request_token,omitempty"`
LoginID string `json:"login_id,omitempty"`
PaymentID string `json:"payment_id,omitempty"`
SignupID string `json:"signup_id,omitempty"`
AccountID string `json:"account_id,omitempty"`
ExternalID string `json:"external_id,omitempty"`
}
type AddressType string
const (
Shipping AddressType = "shipping"
Billing AddressType = "billing"
Home AddressType = "home"
)
type transactionType string
const (
loginType transactionType = "login"
paymentType transactionType = "payment"
)
type TransactionAddress struct {
Type AddressType `json:"type"`
Coordinates *Coordinates `json:"address_coordinates"`
StructuredAddress *StructuredAddress `json:"structured_address"`
AddressLine string `json:"address_line"`
}
type PaymentValue struct {
Amount float64 `json:"amount"`
Currency string `json:"currency"`
}
type paymentMethodType string
const (
CreditCard paymentMethodType = "credit_card"
DebitCard paymentMethodType = "debit_card"
GooglePay paymentMethodType = "google_pay"
ApplePay paymentMethodType = "apple_pay"
NuPay paymentMethodType = "nu_pay"
Pix paymentMethodType = "pix"
MealVoucher paymentMethodType = "meal_voucher"
AccountBalance paymentMethodType = "account_balance"
)
type CardInfo struct {
Bin string `json:"bin"`
LastFourDigits string `json:"last_four_digits"`
ExpiryYear string `json:"expiry_year,omitempty"`
ExpiryMonth string `json:"expiry_month,omitempty"`
}
type PaymentMethod struct {
Identifier string `json:"identifier,omitempty"`
Type paymentMethodType `json:"type"`
CreditCard *CardInfo `json:"credit_card_info,omitempty"`
DebitCard *CardInfo `json:"debit_card_info,omitempty"`
}
type postTransactionRequestBody struct {
ExternalID string `json:"external_id,omitempty"`
PolicyID string `json:"policy_id,omitempty"`
InstallationID *string `json:"installation_id,omitempty"`
PaymentMethodIdentifier string `json:"payment_method_identifier,omitempty"`
Type transactionType `json:"type"`
AccountID string `json:"account_id"`
Addresses []*TransactionAddress `json:"addresses,omitempty"`
PaymentValue *PaymentValue `json:"payment_value,omitempty"`
PaymentMethods []*PaymentMethod `json:"payment_methods,omitempty"`
SessionToken *string `json:"session_token,omitempty"`
RequestToken string `json:"request_token,omitempty"`
CustomProperties map[string]interface{} `json:"custom_properties,omitempty"`
}