forked from zhutik/adyen-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
credetials.go
38 lines (35 loc) · 1.04 KB
/
credetials.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
package adyen
// apiCredentials basic API settings
//
// Description:
//
// - Env - Environment for next API calls
// - Username - API username for authentication
// - Password - API password for authentication
// - Hmac - Hash-based Message Authentication Code (HMAC) setting
//
// You can create new API user there: https://ca-test.adyen.com/ca/ca/config/users.shtml
// New skin can be created there https://ca-test.adyen.com/ca/ca/skin/skins.shtml
type apiCredentials struct {
Env Environment
Username string
Password string
Hmac string
}
// makeCredentials create new APICredentials
func makeCredentials(env Environment, username, password string) apiCredentials {
return apiCredentials{
Env: env,
Username: username,
Password: password,
}
}
// makeCredentialsWithHMAC create new APICredentials with HMAC singature
func makeCredentialsWithHMAC(env Environment, username, password, hmac string) apiCredentials {
return apiCredentials{
Env: env,
Username: username,
Password: password,
Hmac: hmac,
}
}