-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathresponse.go
112 lines (102 loc) · 4.39 KB
/
response.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
package kredivo
//CheckoutResponse
type CheckoutResponse struct {
Status string `json:"status"`
Message string `json:"message"`
RedirectURL string `json:"redirect_url"`
CheckoutErrorResponse *CheckoutErrorResponse `json:"error,omitempty"`
}
//CheckoutErrorResponse
type CheckoutErrorResponse struct {
Message string `json:"message"`
Kind string `json:"kind"`
}
//Payment response
type PaymentResponse struct {
Status string `json:"status"`
Message string `json:"message"`
Payments []Payment `json:"payments"`
}
//Payment response
type Payment struct {
DownPayment float64 `json:"down_payment"`
Name string `json:"name"`
Amount float64 `json:"amount"`
InstallmentAmount float64 `json:"installment_amount"`
Rate float64 `json:"rate"`
MonthlyInstallment float64 `json:"monthly_installment"`
DiscountedMonthlyInstallment float64 `json:"discounted_monthly_installment"`
Tenure int `json:"tenure"`
ID string `json:"id"`
InterestRateTransitionTerm float64 `json:"interest_rate_transition_term,omitempty"`
}
//Notification response, for handle payment Notification from Kredivo
type Notification struct {
Status string `json:"status"`
Amount string `json:"amount"`
PaymentType string `json:"payment_type"`
TransactionStatus string `json:"transaction_status"`
OrderID string `json:"order_id"`
Message string `json:"message"`
ShippingAddress ShippingAddress `json:"shipping_address"`
TransactionTime int `json:"transaction_time"`
TransactionID string `json:"transaction_id"`
SignatureKey string `json:"signature_key"`
}
//ShippingAddress of the customer/shopper
type ShippingAddress struct {
City string `json:"city"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Countrycode string `json:"countrycode"`
CreationDate string `json:"creation_date"`
Phone string `json:"phone"`
State string `json:"state"`
Transaction int `json:"transaction"`
Postcode string `json:"postcode"`
LocationDetails string `json:"location_details"`
}
//StatusMessage, response status send to Kredivo
type StatusMessage struct {
Status string `json:"status"`
Message string `json:"message"`
}
//ConfirmationResponse, response status from update transaction
type ConfirmationResponse struct {
Status string `json:"status"`
LegalName string `json:"legal_name"`
FraudStatus string `json:"fraud_status"`
OrderID string `json:"order_id"`
TransactionTime int `json:"transaction_time"`
Amount string `json:"amount"`
PaymentType string `json:"payment_type"`
TransactionStatus string `json:"transaction_status"`
Message string `json:"message"`
TransactionID string `json:"transaction_id"`
}
//CancelResponse, response status from cancel transaction
type CancelResponse struct {
Status string `json:"status,omitempty"`
FraudStatus string `json:"fraud_status,omitempty"`
OrderID string `json:"order_id,omitempty"`
TransactionTime int `json:"transaction_time,omitempty"`
Amount string `json:"amount,omitempty"`
PaymentType string `json:"payment_type,omitempty"`
TransactionStatus string `json:"transaction_status,omitempty"`
Message string `json:"message,omitempty"`
TransactionID string `json:"transaction_id,omitempty"`
}
//TransactionStatusResponse for response
type TransactionStatusResponse struct {
Status string `json:"status,omitempty"`
LegalName string `json:"legal_name,omitempty"`
FraudStatus string `json:"fraud_status,omitempty"`
OrderID string `json:"order_id,omitempty"`
TransactionTime int `json:"transaction_time,omitempty"`
ExternalUserID string `json:"external_userid,omitempty"`
Amount string `json:"amount,omitempty"`
PaymentType string `json:"payment_type,omitempty"`
TransactionStatus string `json:"transaction_status,omitempty"`
Message string `json:"message,omitempty"`
TransactionID string `json:"transaction_id,omitempty"`
}