package module
Version: v0.0.0-...-1ac8017 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2021 License: BSD-3-Clause, MIT Imports: 7 Imported by: 16


Ingenico Connect Go SDK


The Go SDK helps you to communicate with the Ingenico Connect Server API. Its primary features are:

  • convenient go wrapper around the API calls and responses
    • marshalls Go request structs to HTTP requests
    • unmarshalls HTTP responses to Go response structs or Go exceptions
  • handling of all the details concerning authentication
  • handling of required meta data

Its use is demonstrated by an example for each possible call. The examples execute a call using the provided API keys.

See the Ingenico Connect Developer Hub for more information on how to use the SDK.


Go version 1.11 or higher is required. No additional packages are required.


This repository also contains some example code. This code is contained in the examples folder.



To install the latest version of this repository, run the following command from a terminal:

go get

Go 1.11 added module support and with that support for versions in go get. This means that, if your project uses modules, you can add @version to the go get command to get a specific version. For example, go get will download version 2.9.0 of the SDK. See the releases page for an overview of available releases.

If your project does not use modules yet, you will need to use the instructions above to install from source. Note that new major versions may introduce breaking changes. We therefore recommend using modules in your project. See Migrating to Go Modules for more information.

Running tests

There are two types of tests: unit tests and integration tests. The unit tests will work out-of-the-box; for the integration tests some configuration is required. First, some environment variables need to be set:

  • connect.api.apiKeyId for the API key id to use. This can be retrieved from the Configuration Center.
  • connect.api.secretApiKey for the secret API key to use. This can be retrieved from the Configuration Center.
  • connect.api.merchantId for your merchant ID.
  • connect.api.proxyUrl for the URL to the proxy to use (optional). If set, it should be in the form scheme://[userinfo@]host[:port]. Examples:,,

The following commands can now be executed from the root directory of the SDK folder to execute the tests:

  • Unit tests:

    go test ./...
  • Both unit and integration tests:

    go test -tags=integration  ./...




View Source
const APIVersion = "v1"

APIVersion is the version of the current SDK


This section is empty.


func CreateCommunicator

func CreateCommunicator(apiKeyID, secretAPIKey, integrator string) (*communicator.Communicator, error)

CreateCommunicator creates a Communicator with default settings and the given apiKeyID and secretAPIKey

func CreateCommunicatorFromConfiguration

func CreateCommunicatorFromConfiguration(configuration *configuration.CommunicatorConfiguration) (*communicator.Communicator, error)

CreateCommunicatorFromConfiguration creates a Communicator with the given CommunicatorConfiguration

func CreateCommunicatorFromSession

func CreateCommunicatorFromSession(session *communicator.Session) (*communicator.Communicator, error)

CreateCommunicatorFromSession creates a Communicator with the given Session

func CreateConfiguration

func CreateConfiguration(apiKeyID, secretAPIKey, integrator string) (*configuration.CommunicatorConfiguration, error)

CreateConfiguration creates a CommunicatorConfiguration with default settings and the given apiKeyID and secretAPIKey

func CreateSessionBuilder

func CreateSessionBuilder(apiKeyID, secretAPIKey, integrator string) (*communicator.SessionBuilder, error)

CreateSessionBuilder creates a SessionBuilder with default settings and the given apiKeyID and secretAPIKey

func CreateSessionBuilderFromConfiguration

func CreateSessionBuilderFromConfiguration(configuration *configuration.CommunicatorConfiguration) (*communicator.SessionBuilder, error)

CreateSessionBuilderFromConfiguration creates a SessionBuilder with the given CommunicatorConfiguration


type CallContext

type CallContext struct {
	IdempotenceKey              string
	IdempotenceRequestTimestamp *int64

CallContext can be used to send extra information with a request, and to receive extra information from a response. Please note that this type is not thread-safe. Each request should get its own call context instance.

func NewCallContext

func NewCallContext(idempotenceKey string) (*CallContext, error)

NewCallContext creates a CallContext using the given idempotenceKey

func (*CallContext) GetIdempotenceKey

func (c *CallContext) GetIdempotenceKey() string

GetIdempotenceKey returns the idempotence key

func (*CallContext) GetIdempotenceRequestTimestamp

func (c *CallContext) GetIdempotenceRequestTimestamp() *int64

GetIdempotenceRequestTimestamp returns the idempotence timestamp

func (*CallContext) SetIdempotenceRequestTimestamp

func (c *CallContext) SetIdempotenceRequestTimestamp(timestamp *int64)

SetIdempotenceRequestTimestamp sets the idempotence timestamp

type Client

type Client struct {
	// contains filtered or unexported fields

Client is the Ingenico ePayments platform client. Thread-safe.

This client and all its child clients are bound to one specific value for the X-GCS-ClientMetaInfo header. To get a new client with a different header value, use WithClientMetaInfo.

func CreateClient

func CreateClient(apiKeyID, secretAPIKey, integrator string) (*Client, error)

CreateClient creates a Client with default settings and the given apiKeyID and secretAPIKey

func CreateClientFromCommunicator

func CreateClientFromCommunicator(communicator *communicator.Communicator) (*Client, error)

CreateClientFromCommunicator creates a Client with the given Communicator

func CreateClientFromConfiguration

func CreateClientFromConfiguration(configuration *configuration.CommunicatorConfiguration) (*Client, error)

CreateClientFromConfiguration creates a Client with the given CommunicatorConfiguration

func CreateClientFromSession

func CreateClientFromSession(session *communicator.Session) (*Client, error)

CreateClientFromSession creates a Client with the given Session

func NewClient

func NewClient(communicator *communicator.Communicator) (client *Client, err error)

NewClient creates a new Client with the given communicator

func (*Client) Close

func (c *Client) Close() error

Close calls the internal closer of the communicator

func (*Client) DisableLogging

func (c *Client) DisableLogging()

DisableLogging turns off logging.

func (*Client) EnableLogging

func (c *Client) EnableLogging(communicatorLogger logging.CommunicatorLogger)

EnableLogging turns on logging using the given communicator logger.

func (*Client) Merchant

func (c *Client) Merchant(merchantID string) *merchant.Client

Merchant represents the resource /{merchantId}

func (*Client) WithClientMetaInfo

func (c *Client) WithClientMetaInfo(clientMetaInfo string) (*Client, error)

WithClientMetaInfo returns a new Client which uses the passed meta data for the X-GCS-ClientMetaInfo header. - clientMetaInfo is a JSON string containing the meta data for the client - can give an error if the given clientMetaInfo is not a valid JSON string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL