Documentation
¶
Overview ¶
Package saltedge provides the core HTTP client for the SaltEdge API v6. It handles authentication, retries, middleware, and wires all service layers.
Package saltedge is the entry point for the SaltEdge API v6 Go client.
Quick Start ¶
client := saltedge.New("YOUR_APP_ID", "YOUR_SECRET")
// AIS — Account Information
customer, err := client.AIS.Customers.Create(ctx, ais.CreateCustomerParams{
Identifier: "alice@example.com",
})
// PIS — Payment Initiation
payment, err := client.PIS.Payments.Create(ctx, pis.CreatePaymentParams{
CustomerID: customer.ID,
ProviderCode: "fake_client_xf",
TemplateCode: "sepa_credit_transfer",
PaymentAttributes: map[string]any{
"amount": "100.00",
"currency_code": "EUR",
},
})
// Data Enrichment
bucket, err := client.Enrichment.Buckets.Create(ctx, enrichment.CreateBucketParams{
CustomerID: customer.ID,
})
See https://docs.saltedge.com/v6/api_reference for full API documentation.
Index ¶
- Constants
- func Version() string
- type AISServices
- type Client
- type Config
- type Doer
- type EnrichmentServices
- type Option
- func WithBaseURL(u string) Option
- func WithDebug(on bool) Option
- func WithHTTPClient(d Doer) Option
- func WithLogger(l logger.Logger) Option
- func WithMaxRetries(n int) Option
- func WithPrivateKey(key string) Option
- func WithRetry(rc httpclient.RetryConfig) Option
- func WithTimeout(d time.Duration) Option
- type PISServices
Constants ¶
const (
// BaseURLLive is the production SaltEdge API base URL.
BaseURLLive = "https://www.saltedge.com/api/v6"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AISServices ¶
type AISServices struct {
Countries *svcAIS.CountriesService
Providers *svcAIS.ProvidersService
Customers *svcAIS.CustomersService
Connections *svcAIS.ConnectionsService
Consents *svcAIS.ConsentsService
Accounts *svcAIS.AccountsService
Transactions *svcAIS.TransactionsService
Rates *svcAIS.RatesService
}
AISServices bundles all Account Information Service endpoints.
type Client ¶
type Client struct {
// AIS exposes all Account Information Service endpoints.
AIS AISServices
// PIS exposes all Payment Initiation Service endpoints.
PIS PISServices
// Enrichment exposes all Data Enrichment Platform endpoints.
Enrichment EnrichmentServices
// contains filtered or unexported fields
}
Client is the main entry point for the SaltEdge API v6. It is safe for concurrent use across goroutines.
Example:
client := saltedge.New("APP_ID", "SECRET",
saltedge.WithTimeout(15 * time.Second),
saltedge.WithMaxRetries(3),
)
func New ¶
New creates a new SaltEdge API client with the given credentials and options.
appID and secret are the mandatory API credentials found in your SaltEdge dashboard. Pass functional options to customise timeouts, retries, logging, etc.
func NewFromConfig ¶
NewFromConfig creates a Client from a fully constructed Config. This is useful when loading configuration from environment variables or files.
type Config ¶
type Config struct {
// AppID and Secret are mandatory API credentials.
AppID string
Secret string
// PrivateKey enables HMAC-SHA256 request signing (optional).
PrivateKey string
// BaseURL defaults to BaseURLLive. Override for proxies or testing.
BaseURL string
// Timeout for individual HTTP requests. Default: 30s.
Timeout time.Duration
// RetryConfig controls retry behaviour. Zero value uses sensible defaults.
RetryConfig httpclient.RetryConfig
// Logger receives structured log messages. Default: no-op.
Logger logger.Logger
// HTTPClient allows injection of a custom HTTP Doer (e.g. for tests).
HTTPClient Doer
// Debug enables request/response logging at DEBUG level.
Debug bool
}
Config holds all options for constructing a Client.
type Doer ¶
type Doer = httpclient.Doer
Doer is the injectable HTTP interface (satisfied by *http.Client).
type EnrichmentServices ¶
type EnrichmentServices struct {
Buckets *svcEnrichment.BucketsService
Accounts *svcEnrichment.AccountsService
Transactions *svcEnrichment.TransactionsService
Merchants *svcEnrichment.MerchantsService
Categories *svcEnrichment.CategoriesService
CustomerRules *svcEnrichment.CustomerRulesService
FinancialInsights *svcEnrichment.FinancialInsightsService
}
EnrichmentServices bundles all Data Enrichment Platform endpoints.
type Option ¶
type Option func(*Config)
Option is a functional option for configuring a Client.
func WithHTTPClient ¶
WithHTTPClient injects a custom HTTP Doer (useful for tests).
func WithMaxRetries ¶
WithMaxRetries is a convenience option that sets RetryConfig.MaxAttempts.
func WithPrivateKey ¶
WithPrivateKey enables HMAC-SHA256 request signing.
func WithRetry ¶
func WithRetry(rc httpclient.RetryConfig) Option
WithRetry configures the full retry policy.
type PISServices ¶
type PISServices struct {
Customers *svcPIS.CustomersService
Providers *svcPIS.ProvidersService
Payments *svcPIS.PaymentsService
Templates *svcPIS.TemplatesService
BulkPayments *svcPIS.BulkPaymentsService
}
PISServices bundles all Payment Initiation Service endpoints.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
httpclient
Package httpclient provides the low-level HTTP machinery: a configurable *http.Client, retry logic, and the Doer interface for test injection.
|
Package httpclient provides the low-level HTTP machinery: a configurable *http.Client, retry logic, and the Doer interface for test injection. |
|
signer
Package signer implements HMAC-SHA256 request signing for the SaltEdge API.
|
Package signer implements HMAC-SHA256 request signing for the SaltEdge API. |
|
pkg
|
|
|
errors
Package errors provides structured, sentinel-based error types for the SaltEdge Go client.
|
Package errors provides structured, sentinel-based error types for the SaltEdge Go client. |
|
logger
Package logger defines the structured logging interface used throughout the SDK.
|
Package logger defines the structured logging interface used throughout the SDK. |
|
models/ais
Package ais contains all Account Information Service (AIS) models matching the SaltEdge API v6 specification exactly.
|
Package ais contains all Account Information Service (AIS) models matching the SaltEdge API v6 specification exactly. |
|
models/enrichment
Package enrichment contains models for the SaltEdge Data Enrichment Platform.
|
Package enrichment contains models for the SaltEdge Data Enrichment Platform. |
|
models/pis
Package pis contains all Payment Initiation Service (PIS) models matching the SaltEdge API v6 specification exactly.
|
Package pis contains all Payment Initiation Service (PIS) models matching the SaltEdge API v6 specification exactly. |
|
pagination
Package pagination provides a generic, iterator-style paginator for any SaltEdge API list endpoint that uses the from_id cursor strategy.
|
Package pagination provides a generic, iterator-style paginator for any SaltEdge API list endpoint that uses the from_id cursor strategy. |
|
webhook
Package webhook provides an HTTP handler for SaltEdge callbacks (webhooks).
|
Package webhook provides an HTTP handler for SaltEdge callbacks (webhooks). |
|
Package services contains the Requester interface shared by all service layers.
|
Package services contains the Requester interface shared by all service layers. |
|
ais
Package ais contains all AIS service implementations.
|
Package ais contains all AIS service implementations. |
|
enrichment
Package enrichment contains Data Enrichment Platform service implementations.
|
Package enrichment contains Data Enrichment Platform service implementations. |
|
pis
Package pis contains PIS service implementations.
|
Package pis contains PIS service implementations. |