feat: Add API key authentication support to charging engine client

- Add APIKey field to ChargingEngineConfig struct
- Add apiKey field to ChargingEngineClient struct
- Add setAPIKeyHeader method to set X-API-Key header when API key is configured
- Call setAPIKeyHeader in CheckCredit, DeductCredit, AddCredit, GetBalance, and HealthCheck methods
This commit is contained in:
nutcas3
2026-04-25 03:43:32 +03:00
parent 7428ed2314
commit d7e83c1f0d
2 changed files with 15 additions and 0 deletions
@@ -19,6 +19,7 @@ type Config struct {
type ChargingEngineConfig struct {
BaseURL string `json:"base_url"`
Timeout time.Duration `json:"timeout"`
APIKey string `json:"api_key"`
}
type PaymentConfig struct {