This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
request.go
executable file
·177 lines (156 loc) · 7.07 KB
/
request.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package dana
import "time"
type RequestBody struct {
Request Request `json:"request" valid:"required"`
Signature string `json:"signature" valid:"required"`
}
type Request struct {
Head RequestHeader `json:"head" valid:"required"`
Body interface{} `json:"body" valid:"required"`
}
type RequestHeader struct {
Version string `json:"version" valid:"required"`
Function string `json:"function" valid:"required"`
ClientID string `json:"clientId" valid:"required"`
ReqTime string `json:"reqTime" valid:"required"`
ReqMsgID string `json:"reqMsgId" valid:"required"`
ClientSecret string `json:"clientSecret" valid:"required"`
AccessToken string `json:"accessToken,omitempty" valid:"optional"`
Reserve string `json:"reserve,omitempty" valid:"optional"`
}
type OrderRequestData struct {
Order Order `json:"order" valid:"required"`
MerchantID string `json:"merchantId" valid:"required"`
Mcc string `json:"mcc,omitempty" valid:"optional"`
ProductCode string `json:"productCode" valid:"required"`
EnvInfo EnvInfo `json:"envInfo" valid:"required"`
NotificationUrls *[]NotificationUrl `json:"notificationUrls,omitempty" valid:"optional"`
ExtendInfo string `json:"extendInfo,omitempty" valid:"optional"`
PaymentPreference *PaymentPreference `json:"paymentPreference,omitempty" valid:"optional"`
}
type OrderDetailRequestData struct {
MerchantID string `json:"merchantId" valid:"required"`
AcquirementID string `json:"acquirementId" valid:"optional"`
MerchantTransID string `json:"merchantTransId" valid:"optional"`
}
type RefundRequestData struct {
RequestID string `json:"requestId" valid:"required"`
MerchantID string `json:"merchantId" valid:"required"`
AcquirementID string `json:"acquirementId,omitempty" valid:"optional"`
RefundAmount Amount `json:"refundAmount,omitempty" valid:"required"`
RefundAppliedTime time.Time `json:"refundAppliedTime,omitempty" valid:"optional"`
ActorType string `json:"actorType,omitempty" valid:"optional"`
RefundReason string `json:"refundReason,omitempty" valid:"optional"`
ReturnChargeToPayer bool `json:"returnChargeToPayer,omitempty" valid:"optional"`
Destination string `json:"destination,omitempty" valid:"optional"`
ExtendInfo string `json:"extendInfo,omitempty" valid:"optional"`
EnvInfo EnvInfo `json:"envInfo,omitempty" valid:"optional"`
AuditInfo AuditInfo `json:"auditInfo,omitempty" valid:"optional"`
ActorContext ActorContext `json:"actorContext,omitempty" valid:"optional"`
}
type Order struct {
OrderTitle string `json:"orderTitle"`
OrderAmount Amount `json:"orderAmount"`
MerchantTransID string `json:"merchantTransId"`
MerchantTransType string `json:"merchantTransType,omitempty"`
OrderMemo string `json:"orderMemo,omitempty"`
CreatedTime string `json:"createdTime,omitempty"`
ExpiryTime string `json:"expiryTime,omitempty"`
Goods []Good `json:"goods,omitempty"`
ShippingInfo []ShippingInfo `json:"shippingInfo,omitempty"`
}
type Amount struct {
Currency string `json:"currency"`
Value string `json:"value"`
}
type Good struct {
MerchantGoodsID string `json:"merchantGoodsId,omitempty"`
Description string `json:"description"`
Category string `json:"category,omitempty"`
Price Amount `json:"price"`
Unit string `json:"unit,omitempty"`
Quantity string `json:"quantity,omitempty"`
MerchantShippingID string `json:"merchantShippingId,omitempty"`
SnapshotURL string `json:"snapshotUrl,omitempty"`
ExtendInfo string `json:"extendInfo,omitempty"`
}
type ShippingInfo struct {
MerchantShippingID string `json:"merchantShippingId"`
TrackingNo string `json:"trackingNo,omitempty"`
Carrier string `json:"carrier,omitempty"`
ChargeAmount Amount `json:"chargeAmount,omitempty"`
CountryName string `json:"countryName"`
StateName string `json:"stateName"`
CityName string `json:"cityName"`
AreaName string `json:"areaName,omitempty"`
Address1 string `json:"address1"`
Address2 string `json:"address2,omitempty"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
MobileNo string `json:"mobileNo,omitempty"`
PhoneNo string `json:"phoneNo,omitempty"`
ZipCode string `json:"zipCode"`
Email string `json:"email,omitempty"`
FaxNo string `json:"faxNo,omitempty"`
}
type EnvInfo struct {
SessionID string `json:"sessionId,omitempty"`
TokenID string `json:"tokenId,omitempty"`
WebsiteLanguage string `json:"websiteLanguage,omitempty"`
ClientIP string `json:"clientIp,omitempty"`
OsType string `json:"osType,omitempty"`
AppVersion string `json:"appVersion,omitempty"`
SdkVersion string `json:"sdkVersion,omitempty"`
SourcePlatform string `json:"sourcePlatform"`
TerminalType string `json:"terminalType"`
ClientKey string `json:"clientKey,omitempty"`
OrderTerminalType string `json:"orderTerminalType"`
OrderOsType string `json:"orderOsType,omitempty"`
MerchantAppVersion string `json:"merchantAppVersion,omitempty"`
ExtendInfo string `json:"extendInfo,omitempty"`
}
type AuditInfo struct {
ActionReason string `json:"actionReason" valid:"optional"`
ThirdClientID string `json:"thirdClientId" valid:"optional"`
}
type ActorContext struct {
ActorID string `json:"actorId" valid:"required"`
ActorType string `json:"actorType" valid:"required"`
}
type NotificationUrl struct {
URL string `json:"url"`
Type string `json:"type"`
}
type PaymentPreference struct {
DisabledPayMethods string `json:"disabledPayMethods"`
}
type PayFinishRequest struct {
Request RequestPayFinish `json:"request"`
Signature string `json:"signature"`
}
type RequestPayFinish struct {
Head RequestHeader `json:"head"`
Body RequestBodyPayFinish `json:"body"`
}
type RequestBodyPayFinish struct {
AcquirementID string `json:"acquirementId"`
MerchantTransID string `json:"merchantTransId"`
FinishedTime string `json:"finishedTime"`
CreatedTime string `json:"createdTime"`
MerchantID string `json:"merchantId"`
OrderAmount Amount `json:"orderAmount"`
AcquirementStatus string `json:"acquirementStatus"`
ExtendInfo string `json:"extendInfo"`
}
type RequestApplyAccessToken struct {
GrantType string `json:"grantType"`
AuthCode string `json:"authCode"`
RefreshToken string `json:"refreshToken"`
}
type UserProfileRequestData struct {
UserResources []string `json:"userResources" valid:"required"`
}
type InquiryUserInfoRequest struct {
AccessToken string `json:"accessToken" valid:"required"`
ExtendInfo string `json:"extendInfo,omitempty" valid:"optional"`
}