-
Notifications
You must be signed in to change notification settings - Fork 1
/
requests_and_responses.go
62 lines (54 loc) · 1.47 KB
/
requests_and_responses.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
package unitypayments
import (
"fmt"
)
type ReceiveMobileMoneyRequest struct {
CustomerName string
CustomerMSISDN string `json:"CustomerMsisdn"`
CustomerEmail string
Channel MobileMoneyProviders
Amount float64
PrimaryCallbackURL string `json:"PrimaryCallbackUrl"`
SecondaryCallbackURL string `json:"SecondaryCallbackUrl"`
Description string
ClientReference string
Token string
}
type SendMobileMoneyRequest struct {
RecipientName string
RecipientMSISDN string `json:"RecipientMsisdn"`
CustomerEmail string
Channel MobileMoneyProviders
Amount float64
PrimaryCallbackURL string `json:"PrimaryCallbackUrl"`
SecondaryCallbackURL string `json:"SecondaryCallbackUrl"`
Description string
ClientReference string
Token string
}
type ReceiveMobileMoneyData struct {
TransactionID string `json:"TransactionId"`
ClientReference string
Description string
ExternalTransactionID string `json:"ExternalTransactionId"`
}
type MobileMoneyResponse struct {
ResponseCode string
Data ReceiveMobileMoneyData
}
type ErrorResponse struct {
ResponseCode string
Message string
Errors []ErrorData
}
type ErrorData struct {
Field string
Messages []string
}
func (e ErrorResponse) Error() string {
str := ""
for _, item := range e.Errors {
str += fmt.Sprintf("%+v", item)
}
return str
}