-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
119 lines (107 loc) · 3.27 KB
/
models.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
package softlinePayment
import (
"io"
"time"
)
type SendParams struct {
HttpCode int
Path string
HttpMethod string
Date string
Token string
AuthNeed bool
Body io.Reader
QueryParams map[string]string
Response interface{}
}
type AuthReq struct {
Username string `json:"username"`
Password string `json:"password"`
}
type AuthResp struct {
Token string
RefreshToken string
Date string
}
type CreatePaymentReq struct {
Currency string `json:"currency"`
Amount string `json:"amount"`
ReturnSuccessUrl string `json:"return_success_url"`
PaymentMethod string `json:"payment_method"`
RecurringIndicator bool `json:"recurring_indicator"`
PaymentId string `json:"payment_id"`
PaymentDescription string `json:"payment_description"`
Customer Customer `json:"customer"`
}
type Customer struct {
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
}
type CreatePaymentResp struct {
PaymentUrl string `json:"payment_url,omitempty"`
OrderId int `json:"order_id"`
Errors []Error `json:"errors,omitempty"`
}
type Error struct {
Error int `json:"error"`
Message string `json:"message"`
}
type MakePaymentReq struct {
ParentOrderId int `json:"parent_order_id"`
PaymentId string `json:"payment_id"`
Currency string `json:"currency"`
Amount string `json:"amount"`
PaymentDescription string `json:"payment_description"`
}
type Signature struct {
SecretKey string
Event string
OrderID string
CreateDate string
PaymentMethod string
Currency string
CustomerEmail string
}
type PaymentResp struct {
Signature string `json:"-"`
RespBody []byte `json:"-"`
Event string `json:"event"`
EventDate time.Time `json:"event_date"`
OrderId int `json:"order_id"`
OrderName string `json:"order_name"`
Status string `json:"status"`
ExternalId string `json:"external_id"`
CreateDate time.Time `json:"create_date"`
PayDate string `json:"pay_date"`
Currency string `json:"currency"`
Locale string `json:"locale"`
OrderDetailUrl string `json:"order_detail_url"`
Customer struct {
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Phone string `json:"phone"`
} `json:"customer"`
Payment struct {
Method string `json:"payment_method"`
SystemName string `json:"payment_system_name"`
ErrorDescription string `json:"payment_error_description"`
ErrorCode string `json:"payment_error_code"`
CardLast4 int `json:"card_last_4"`
CardExpirationDate string `json:"card_expiration_date"`
IsCardExpired bool `json:"is_card_expired"`
IsInstallmentPayment bool `json:"is_installment_payment"`
} `json:"payment"`
Return struct {
Type string `json:"type"`
Reason string `json:"reason"`
Date time.Time `json:"date"`
} `json:"return"`
Errors []Error `json:"errors"`
}
type RefundReq struct {
OrderID string `json:"-"`
Email string `json:"email"`
Description string `json:"description"`
}