cashless2ecash

cashless2ecash: pay with cards for digital cash (experimental)
Log | Files | Refs | README

commit 4e19c0d4896954054905c006714f0685f93bdc02
parent f9398c5e2fa24da5c670d3d2e41176a8f9b038c0
Author: Joel-Haeberli <haebu@rubigen.ch>
Date:   Sun, 12 May 2024 23:41:59 +0200

fix: wallee url

Diffstat:
Mc2ec/c2ec-config.conf | 4++--
Mc2ec/c2ec-config.yaml | 4++--
Mc2ec/config.go | 8++++----
Mc2ec/main.go | 2+-
Mc2ec/wallee-client.go | 6+++---
5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/c2ec/c2ec-config.conf b/c2ec/c2ec-config.conf @@ -56,9 +56,9 @@ CONFIG = postgres://local:local@localhost:5432/postgres [provider-wallee] NAME = Wallee -CREDENTIALS_PASSWORD = secret +KEY = secret [provider-simulation] NAME = Simulation -CREDENTIALS_PASSWORD = secret +KEY = secret diff --git a/c2ec/c2ec-config.yaml b/c2ec/c2ec-config.yaml @@ -21,6 +21,6 @@ db: database: "postgres" providers: - name: "Wallee" - credentials-password: "secret" + key: "secret" - name: "Simulation" - credentials-password: "secret" + key: "secret" diff --git a/c2ec/config.go b/c2ec/config.go @@ -44,8 +44,8 @@ type C2ECDatabseConfig struct { } type C2ECProviderConfig struct { - Name string `yaml:"name"` - CredentialsPassword string `yaml:"credentials-password"` + Name string `yaml:"name"` + Key string `yaml:"key"` } func Parse(path string) (*C2ECConfig, error) { @@ -240,11 +240,11 @@ func ParseIni(content []byte) (*C2ECConfig, error) { } provider.Name = value.String() - value, err = s.GetKey("CREDENTIALS_PASSWORD") + value, err = s.GetKey("KEY") if err != nil { return nil, err } - provider.CredentialsPassword = value.String() + provider.Key = value.String() cfg.Providers = append(cfg.Providers, provider) } diff --git a/c2ec/main.go b/c2ec/main.go @@ -137,7 +137,7 @@ func main() { } // since listening for incoming request, attesting payments and - // retrying payments are three separated processes who can fail + // retrying payments are separated processes who can fail // we must take care of this here. The main process is used to // dispatch incoming http request and parent of the attestation // and retry processes. If the main process fails somehow, also diff --git a/c2ec/wallee-client.go b/c2ec/wallee-client.go @@ -97,7 +97,7 @@ func (w *WalleeClient) SetupClient(p *Provider) error { func (w *WalleeClient) GetTransaction(transactionId string) (ProviderTransaction, error) { - call := WALLEE_SEARCH_TRANSACTION_API + call := fmt.Sprintf("%s%s", w.baseUrl, WALLEE_SEARCH_TRANSACTION_API) queryParams := map[string]string{ WALLEE_API_SPACEID_PARAM_NAME: strconv.Itoa(w.credentials.SpaceId), } @@ -228,12 +228,12 @@ func parseCredentials(raw string, cfg *C2ECProviderConfig) (*WalleeCredentials, return nil, err } - if !ValidPassword(cfg.CredentialsPassword, creds.ApplicationUserKey) { + if !ValidPassword(cfg.Key, creds.ApplicationUserKey) { return nil, errors.New("invalid application user key") } // correct application user key. - creds.ApplicationUserKey = cfg.CredentialsPassword + creds.ApplicationUserKey = cfg.Key return creds, nil }