Releases: Worldline-Global-Collect/connect-sdk-go
Releases · Worldline-Global-Collect/connect-sdk-go
3.0.1
3.0.0
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
andconnectsdk.CreateClientWithDefaultMarshaller
that take all arguments required to create acommunicator.Communicator
except for theauthentication.Marshaller
. - Added functions
connectsdk.NewBool
,connectsdk.NewInt32
,connectsdk.NewInt64
andconnectsdk.NewString
that can be used to create pointers for literal values.
- Added functions
- 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 structconnectsdk.Client
to new structapiv1.Client
. Instances of this struct are available through methodV1
of structconnectsdk.Client
. - Replaced functions
webhooks.CreateHelper
andwebhooks.CreateHelperBuilder
with methodsNewHelper
andNewHelperBuilder
of new structwebhooks.Factory
in packagegithub.com/Worldline-Global-Collect/connect-sdk-go/apiv1/webhooks
. Instances of this struct are available through functionwebhooks.V1
. - Replaced properties
APIKeyID
andSecretAPIKey
of structconfiguration.CommunicatorConfiguration
with more generic propertiesAuthorizationID
andAuthorizationSecret
. MethodsGetAPIKeyID
,SetAPIKeyID
,GetSecretAPIKey
andSetSecretAPIKey
have been added as aliases for getting and setting the new properties. - Renamed struct
errors.GlobalCollectError
and functionserrors.NewGlobalCollectError
anderrors.NewGlobalCollectErrorVerbose
toPlatformError
,NewPlatformError
andNewPlatformErrorVerbose
respectively. - Renamed struct
errors.ValidateError
and functionserrors.NewValidateError
anderrors.NewValidateErrorVerbose
toValidationError
,NewValidationError
andNewValidationErrorVerbose
respectively. - Renamed method
CreateSimpleAuthenticationSignature
of interfaceauthentication.Authenticator
toGetAuthorization
. - Replaced the default API endpoint host to
api.connect.worldline-solutions.com
. - Replaced function
configuration.DefaultConfiguration
withconfiguration.DefaultV1HMACConfiguration
. - Renamed function
connectsdk.CreateConfiguration
toCreateV1HMACConfiguration
. - Renamed struct
defaultimpl.DefaultAuthenticator
tov1hmac.Authenticator
, and replaced functiondefaultimpl.NewDefaultAuthenticator
withv1hmac.NewAuthenticator
. The latter doesn't have a parameter for the authorization type, as its value should always bev1HMAC
. - Renamed struct
communicator.MetaDataProvider
, itsMetaDataHeaders
method and structcommunicator.MetaDataProviderBuilder
toMetadataProvider
,MetadataHeaders
andMetadataProviderBuilder
respectively. - Renamed function
communicator.NewMetaDataProviderWithIntegrator
toNewMetadataProvider
. - Replaced interface
communicator.BodyHandler
and function type definitioncommunicator.BodyHandlerFunc
with function type definitioncommunicator.BodyHandler
. - Replaced interface
communication.ResponseHandler
and function type definitioncommunication.ResponseHandlerFunc
with function type definitioncommunication.ResponseHandler
. - Added methods
SetBodyObfuscator
andSetHeaderObfuscator
to interfacecommunication.Connection
. This effectively makes each struct that implementscommunication.Connection
also implementobfuscation.Capable
. - Integrated struct
communicator.Session
into structcommunicator.Communicator
. - Replaced struct
communicator.SessionBuilder
and functionsconnectsdk.CreateSessionBuilder
andconnectsdk.CreateSessionBuilderFromConfiguration
with structconnectsdk.CommunicatorBuilder
and functionsconnectsdk.CreateCommunicatorBuilder
andconnectsdk.CreateCommunicatorBuilderFromConfiguration
respectively. - Replaced struct
defaultimpl.DefaultMarshaller
and functiondefaultimpl.NewDefaultMarshaller
with functionjson.DefaultMarshaller
. - Replaced struct
webhooks.InMemorySecretKeyStore
and functionwebhooks.NewInMemorySecretKeyStore
with functionswebhooks.InMemorySecretKeyStore
,webhooks.StoreInMemorySecretKey
,webhooks.RemoveInMemorySecretKey
andwebhooks.ClearInMemorySecretKeys
. - Replaced functions
logging.NewRequestLogMessageBuilder
andlogging.NewRequestLogMessageBuilderWithObfuscators
with functionlogging.NewRequestLogMessageBuilder
. - Replaced functions
logging.NewResponseLogMessageBuilder
andlogging.NewResponseLogMessageBuilderWithObfuscators
with functionlogging.NewResponseLogMessageBuilder
. - Function
logging.StdOutCommunicatorLogger
now returns alogging.CommunicatorLogger
instead of a*logging.DefaultLogCommunicatorLogger
. - Function
connectsdk.NewCallContext
no longer returns an error, since the returned error was alwaysnil
. - Function
domain.NewWebhooksEvent
, which replaces functionwebhooks.NewEvent
, no longer returns an error, since the returned error was alwaysnil
. - Method
NewHelperBuilder
of new structwebhooks.Factory
for API v1, which replaces functionwebhooks.CreateHelperBuilder
, no longer returns an error, instead delaying any error to whenBuild()
is called. This allows the result to be used in function chaining. - The
BuildMessage
method of structslogging.RequestLogMessageBuilder
andlogging.ResponseLogMessageBuilder
no longer return an error, since the returned error was alwaysnil
. - The
NewClient
functions in all packages can now all return an error. Functionconnectsdk.NewClient
already could return an error so it is unchanged.
- 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
- Removed:
- Removed constant
connectsdk.APIVersion
. - Removed interface
communication.CallContext
that had the same methods as structconnectsdk.CallContext
. It is no longer needed now thatCallContext
has moved to different package. - Removed struct
communicator.Session
. - Removed functions
connectsdk.CreateCommunicatorFromSession
andconnectsdk.CreateClientFromSession
. - Removed function
communicator.NewMetaDataProviderWithBuilder
. - Removed exported variable
communicator.ProhibitedHeaders
. - Removed several exported error variables like
communication.ErrNoName
andcommunicator.ErrNoName
. - Removed methods
LogRequestLogMessage
andLogResponseLogMessage
of interfacelogging.CommunicatorLogger
and structlogging.DefaultLogCommunicatorLogger
. - Removed previously deprecated functions
logging.ObfuscateBody
andlogging.ObfuscateHeader
. - Removed duplicate struct
webhooks.APIVersionMismatchError
. - Removed duplicate struct
webhooks.SignatureValidationError
. - Removed duplicate interface
webhooks.SecretKeyStore
.
- Removed constant