An API client library for Sagepay and Go.
- Overridable HTTP Client
- Context support for tracibility
- Minimal Dependencies
- Pluggable credential sources
- Get a merchant session key
import "github.com/mrzen/go-sagepay"
func GetSessionKey(ctx context.Context) (*sagepay.SessionKey, error) {
// Gets credentials from `SAGE_USERNAME` and `SAGE_PASSWORD` env
sage := sagepay.New(ctx, sagepay.EnvironmentCredentialsProvider{})
return sage.GetSessionKey(ctx, "myVendorName")
}