Skip to content

Releases: Worldline-Global-Collect/connect-sdk-go

3.0.1

18 Apr 13:40
Compare
Choose a tag to compare
  • Fixed:
    • Changed the default message for structs errors.AuthorizationError, errors.IdempotenceError and errors.ReferenceError, as the previous ones were the same as for struct errors.ValidationError.

3.0.0

19 Mar 09:08
Compare
Choose a tag to compare

This SDK is a rebranded and updated version of the SDK that was previously published under the Ingenico name. Next to renaming to Worldline, the SDK has been restructured to better support future improvements like multiple API versions and different authentication mechanisms. You can use the migration guide to upgrade from the previous version. Previous versions and release notes of this SDK can be found here.

The following is an overview of changes:

  • Added:
    • Added functions connectsdk.CreateCommunicatorWithDefaultMarshaller and connectsdk.CreateClientWithDefaultMarshaller that take all arguments required to create a communicator.Communicator except for the authentication.Marshaller.
    • Added functions connectsdk.NewBool, connectsdk.NewInt32, connectsdk.NewInt64 and connectsdk.NewString that can be used to create pointers for literal values.
  • Changed:
    • Renamed all packages, and moved types, constants and functions between packages. Each API version now has its own package structure that contains all types and functions specific for that version, including structs like APIError, exceptions and webhooks types and functions.
    • Renamed several domain structs and their matching factory functions that had previously been renamed to prevent stuttering.
    • Made the integrator required.
    • Moved method Merchant from struct connectsdk.Client to new struct apiv1.Client. Instances of this struct are available through method V1 of struct connectsdk.Client.
    • Replaced functions webhooks.CreateHelper and webhooks.CreateHelperBuilder with methods NewHelper and NewHelperBuilder of new struct webhooks.Factory in package github.com/Worldline-Global-Collect/connect-sdk-go/apiv1/webhooks. Instances of this struct are available through function webhooks.V1.
    • Replaced properties APIKeyID and SecretAPIKey of struct configuration.CommunicatorConfiguration with more generic properties AuthorizationID and AuthorizationSecret. Methods GetAPIKeyID, SetAPIKeyID, GetSecretAPIKey and SetSecretAPIKey have been added as aliases for getting and setting the new properties.
    • Renamed struct errors.GlobalCollectError and functions errors.NewGlobalCollectError and errors.NewGlobalCollectErrorVerbose to PlatformError, NewPlatformError and NewPlatformErrorVerbose respectively.
    • Renamed struct errors.ValidateError and functions errors.NewValidateError and errors.NewValidateErrorVerbose to ValidationError, NewValidationError and NewValidationErrorVerbose respectively.
    • Renamed method CreateSimpleAuthenticationSignature of interface authentication.Authenticator to GetAuthorization.
    • Replaced the default API endpoint host to api.connect.worldline-solutions.com.
    • Replaced function configuration.DefaultConfiguration with configuration.DefaultV1HMACConfiguration.
    • Renamed function connectsdk.CreateConfiguration to CreateV1HMACConfiguration.
    • Renamed struct defaultimpl.DefaultAuthenticator to v1hmac.Authenticator, and replaced function defaultimpl.NewDefaultAuthenticator with v1hmac.NewAuthenticator. The latter doesn't have a parameter for the authorization type, as its value should always be v1HMAC.
    • Renamed struct communicator.MetaDataProvider, its MetaDataHeaders method and struct communicator.MetaDataProviderBuilder to MetadataProvider, MetadataHeaders and MetadataProviderBuilder respectively.
    • Renamed function communicator.NewMetaDataProviderWithIntegrator to NewMetadataProvider.
    • Replaced interface communicator.BodyHandler and function type definition communicator.BodyHandlerFunc with function type definition communicator.BodyHandler.
    • Replaced interface communication.ResponseHandler and function type definition communication.ResponseHandlerFunc with function type definition communication.ResponseHandler.
    • Added methods SetBodyObfuscator and SetHeaderObfuscator to interface communication.Connection. This effectively makes each struct that implements communication.Connection also implement obfuscation.Capable.
    • Integrated struct communicator.Session into struct communicator.Communicator.
    • Replaced struct communicator.SessionBuilder and functions connectsdk.CreateSessionBuilder and connectsdk.CreateSessionBuilderFromConfiguration with struct connectsdk.CommunicatorBuilder and functions connectsdk.CreateCommunicatorBuilder and connectsdk.CreateCommunicatorBuilderFromConfiguration respectively.
    • Replaced struct defaultimpl.DefaultMarshaller and function defaultimpl.NewDefaultMarshaller with function json.DefaultMarshaller.
    • Replaced struct webhooks.InMemorySecretKeyStore and function webhooks.NewInMemorySecretKeyStore with functions webhooks.InMemorySecretKeyStore, webhooks.StoreInMemorySecretKey, webhooks.RemoveInMemorySecretKey and webhooks.ClearInMemorySecretKeys.
    • Replaced functions logging.NewRequestLogMessageBuilder and logging.NewRequestLogMessageBuilderWithObfuscators with function logging.NewRequestLogMessageBuilder.
    • Replaced functions logging.NewResponseLogMessageBuilder and logging.NewResponseLogMessageBuilderWithObfuscators with function logging.NewResponseLogMessageBuilder.
    • Function logging.StdOutCommunicatorLogger now returns a logging.CommunicatorLogger instead of a *logging.DefaultLogCommunicatorLogger.
    • Function connectsdk.NewCallContext no longer returns an error, since the returned error was always nil.
    • Function domain.NewWebhooksEvent, which replaces function webhooks.NewEvent, no longer returns an error, since the returned error was always nil.
    • Method NewHelperBuilder of new struct webhooks.Factory for API v1, which replaces function webhooks.CreateHelperBuilder, no longer returns an error, instead delaying any error to when Build() is called. This allows the result to be used in function chaining.
    • The BuildMessage method of structs logging.RequestLogMessageBuilder and logging.ResponseLogMessageBuilder no longer return an error, since the returned error was always nil.
    • The NewClient functions in all packages can now all return an error. Function connectsdk.NewClient already could return an error so it is unchanged.
  • Removed:
    • Removed constant connectsdk.APIVersion.
    • Removed interface communication.CallContext that had the same methods as struct connectsdk.CallContext. It is no longer needed now that CallContext has moved to different package.
    • Removed struct communicator.Session.
    • Removed functions connectsdk.CreateCommunicatorFromSession and connectsdk.CreateClientFromSession.
    • Removed function communicator.NewMetaDataProviderWithBuilder.
    • Removed exported variable communicator.ProhibitedHeaders.
    • Removed several exported error variables like communication.ErrNoName and communicator.ErrNoName.
    • Removed methods LogRequestLogMessage and LogResponseLogMessage of interface logging.CommunicatorLogger and struct logging.DefaultLogCommunicatorLogger.
    • Removed previously deprecated functions logging.ObfuscateBody and logging.ObfuscateHeader.
    • Removed duplicate struct webhooks.APIVersionMismatchError.
    • Removed duplicate struct webhooks.SignatureValidationError.
    • Removed duplicate interface webhooks.SecretKeyStore.