forked from inloco/incognia-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequest_types.go
132 lines (115 loc) · 5.17 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
package incognia
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"`
AddressLine string `json:"address_line,omitempty"`
StructuredAddress *StructuredAddress `json:"structured_address,omitempty"`
Coordinates *Coordinates `json:"address_coordinates,omitempty"`
}
type FeedbackType string
const (
PaymentAccepted FeedbackType = "payment_accepted"
PaymentDeclined FeedbackType = "payment_declined"
PaymentDeclinedByRiskAnalysis FeedbackType = "payment_declined_by_risk_analysis"
PaymentDeclinedByAcquirer FeedbackType = "payment_declined_by_acquirer"
PaymentDeclinedByBusiness FeedbackType = "payment_declined_by_business"
PaymentDeclinedByManualReview FeedbackType = "payment_declined_by_manual_review"
PaymentAcceptedByThirdParty FeedbackType = "payment_accepted_by_third_party"
LoginAccepted FeedbackType = "login_accepted"
LoginDeclined FeedbackType = "login_declined"
SignupAccepted FeedbackType = "signup_accepted"
SignupDeclined FeedbackType = "signup_declined"
ChallengePassed FeedbackType = "challenge_passed"
ChallengeFailed FeedbackType = "challenge_failed"
PasswordChangedSuccessfully FeedbackType = "password_changed_successfully"
PasswordChangeFailed FeedbackType = "password_change_failed"
Verified FeedbackType = "verified"
NotVerified FeedbackType = "not_verified"
Chargeback FeedbackType = "chargeback"
PromotionAbuse FeedbackType = "promotion_abuse"
AccountTakeover FeedbackType = "account_takeover"
MposFraud FeedbackType = "mpos_fraud"
ChargebackNotification FeedbackType = "chargeback_notification"
)
type postFeedbackRequestBody struct {
Event FeedbackType `json:"event"`
Timestamp int64 `json:"timestamp"`
InstallationID string `json:"installation_id,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"`
}