treasurer/internal/utils/yoomoney.go
2023-06-13 13:22:51 +00:00

16 lines
372 B
Go

package utils
import (
"encoding/base64"
"fmt"
"strings"
)
func ConvertYoomoneySercetsToAuth(authType, storeID, secretKey string) string {
credentials := fmt.Sprintf("%s:%s", storeID, secretKey)
encoded := base64.StdEncoding.EncodeToString([]byte(credentials))
trimedAuthType := strings.TrimSpace(authType)
return fmt.Sprintf("%s %s", trimedAuthType, encoded)
}