-
Notifications
You must be signed in to change notification settings - Fork 4
/
request.go
99 lines (88 loc) · 3.18 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
package kredivo
//ConfirmRequest
type ConfirmRequest struct {
TransactionID string
SignatureKey string
}
//PaymentRequest request, for getting available list payment
type PaymentRequest struct {
ServerKey string `json:"server_key"`
Amount int `json:"amount"`
Items []Item `json:"items"`
}
//CancelRequest request, for cancel transaction
type CancelRequest struct {
ServerKey string `json:"server_key"`
OrderID string `json:"order_id"`
TransactionID string `json:"transaction_id"`
CancellationReason string `json:"cancellation_reason"`
CancelledBy string `json:"cancelled_by"`
CancellationDate string `json:"cancellation_date"`
}
//PartialCancelRequest request, for cancel transaction
type PartialCancelRequest struct {
ServerKey string `json:"server_key"`
TransactionDetails TransactionDetails `json:"transaction_details"`
CancelledBy string `json:"cancelled_by"`
CancellationDate string `json:"cancellation_date"`
}
//Order request
type Order struct {
ServerKey string `json:"server_key"`
PaymentType string `json:"payment_type"`
TransactionDetails TransactionDetails `json:"transaction_details"`
Sellers []Seller `json:"sellers,omitempty"`
CustomerDetails *CustomerDetails `json:"customer_details,omitempty"`
BillingAddress *Address `json:"billing_address,omitempty"`
ShippingAddress Address `json:"shipping_address"`
UserCancelURI string `json:"user_cancel_uri,omitempty"`
PushURI string `json:"push_uri"`
BackToStoreURI string `json:"back_to_store_uri"`
}
//TransactionDetails request
type TransactionDetails struct {
Amount float64 `json:"amount"`
OrderID string `json:"order_id"`
Items []Item `json:"items"`
}
//Item request
type Item struct {
ID string `json:"id"`
Name string `json:"name"`
Price float64 `json:"price"`
Type string `json:"type,omitempty"`
URL string `json:"url,omitempty"`
Quantity int `json:"quantity"`
ParentType string `json:"parent_type,omitempty"`
ParentID string `json:"parent_id,omitempty"`
CancellationReason string `json:"cancellation_reason,omitempty"`
}
//CustomerDetails request
type CustomerDetails struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Phone string `json:"phone"`
}
//Address request
type Address struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Address string `json:"address"`
City string `json:"city"`
PostalCode string `json:"postal_code"`
Phone string `json:"phone"`
CountryCode string `json:"country_code"`
}
//Seller request
type Seller struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Address Address `json:"address"`
}
//TransactionStatusRequest request, for getting transaction status
type TransactionStatusRequest struct {
ServerKey string `json:"server_key"`
OrderID string `json:"order_id"`
}