Releases: Worldline-Global-Collect/connect-sdk-nodejs
Releases · Worldline-Global-Collect/connect-sdk-nodejs
5.4.0
5.3.0
- Added:
- Added property
dateOfIncorporation
to interfaceCompanyInformation
. - Added property
paymentCode
to interfaceOrderTypeInformation
.
- Added property
- Changed;
- Refactored obfuscation to no longer use
traverse
.
- Refactored obfuscation to no longer use
- Removed:
- Removed property
paymentProduct816SpecificInput
of interfaceRedirectPaymentMethodSpecificInput
, as this property is no longer supported by the REST API.
- Removed property
- Fixed:
- Fixed the sorting of
X-GCS
headers in the v1HMAC authenticator.
- Fixed the sorting of
- Security:
- Updated several development dependency versions.
5.2.0
- Added:
- Added property
networkTokenUsed
to interfaceCardPaymentMethodSpecificOutput
. - Added property
naicsCommodityCode
to interfaceOrderLineDetails
. - Added property
shippedFromZip
to interfaceShipping
.
- Added property
5.1.0
- Added:
- Added support for custom HTTP agents through initialization property
connectionOptions.agent
. In combination with https-proxy-agent this allows for proxying using the HTTP CONNECT method.
- Added support for custom HTTP agents through initialization property
- Fixed:
dateformat
is a proper dependency again instead of a development dependency.- The order of overloads for
connectSdk.assertSuccess
has been switched, so if anSdkBinaryResponse
is given the output will be anSdkBinarySuccessResponse
and not anSdkSuccessResponse<Readable>
.
5.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, where connectSdk
is the SDK's main module, as imported using import * as connectSdk from "connect-sdk-nodejs"
or const connectSdk = require("connect-sdk-nodejs")
:
- Added:
- Added function
connectSdk.assertSuccess
that takes anSdkResponse
orSdkBinaryResponse
and returns it as-is if it's successful, or throws an error otherwise.
- Added function
- Changed:
- Changed the minimum Node.js version from Node.js 8 to Node.js 12.
- Each API version now has its own module structure that contains all interfaces (and implementations) specific for that version, including interfaces like
APIError
andWebhooksHelper
. - Moved all JSON schemas to folder
schemas/v1
. - The SDK no longer has a singleton client. The
init
method now returns a new object that implements new interfaceClient
every time it is called. - Replaced callbacks with promises. Only functions from module
connect-sdk-nodejs/lib/utils/connection
still use callbacks for technical reasons. - Made type
SdkResponse
generic to indicate the body types for successful and unsuccessful responses. This removes the need for casting the body. - Moved property
file
from typeSdkResponse
to new typeSdkBinaryResponse
, and made it required. - Moved type
ConnectionCallback
from moduleconnect-sdk-nodejs/lib/models/types
to moduleconnect-sdk-nodejs/lib/utils/connection
. - Moved API endpoint properties like
connectSdk.payments
to new interfaceV1Client
. Implementations of this interface are available through propertyv1
of interfaceClient
. - Moved property
connectSdk.context
to new interfaceClient
. - Renamed interface
Context
toConfiguration
. - Renamed interface
IdemPotence
toIdempotence
. - Renamed property
idemPotence
of interfacePaymentContext
toidempotence
. - Replaced method
getContext
of interfaceSdkContext
with methodsgetEndpoint
,getProxy
andgetObfuscationRules
. - Replaced method
getSignature
of interfaceSdkContext
with methodgetAuthenticator
. - Replaced methods
getIdempotenceRequestTimestamp
andsetIdempotenceRequestTimestamp
of interfaceSdkContext
with propertyrequestTimestamp
of interfaceIdempotence
. - Changed the export of module
connect-sdk-nodejs/lib/utils/context
from a singletonSdkContext
instance to functionnewSdkContext
. - Functions
json
andmultipart
of moduleconnect-sdk-nodejs/lib/utils/communicator
now require an additional argument of typeSdkContext
. - Made the
SdkContext
parameter of functiongetObfuscated
of moduleconnect-sdk-nodejs/lib/utils/obfuscate
required. - Moved method
connectSdk.webhooks.init
to new interfaceV1WebhooksFactory
. An object that implements this interface is available through propertyconnectSdk.webhooks.v1
. - The SDK no longer has a singleton webhooks helper. The
init
mehod now returns a new object that implements interfaceWebhooksHelper
every time it is called. - Changed the type of
connectSdk.webhooks
fromWebhooksHelper
to new interfaceWebhooks
. - Moved property
inMemorySecretKeyStore
of interfaceWebhooksHelper
to new interfaceWebhooks
. It remain available usingconnectSdk.webhooks.inMemorySecretKeyStore
. - Changed the export of module
connect-sdk-nodejs/lib/webhooks/validation
from a singletonSignatureValidator
instance to functionnewSignatureValidator
. - Changed the export of modules for API clients and calls like
connect-sdk-nodejs/lib/payments
orconnect-sdk-nodejs/lib/payments/create
to functions that take anSdkContext
argument and return what was exported previously.
- Removed:
- Removed module
connect-sdk-nodejs/lib/utils/versions
with constantapiVersion
. - Removed interface
ConnectSdk
that represented the SDK's main module. - Removed property
httpOptions
of interfaceContext
/Configuration
. - Removed methods
setContext
,setIntegrator
andsetShoppingCartExtension
of interfaceSdkContext
. - Removed types
SdkCallback
,SecretKeyCallback
,UnmarshalCallback
andValidateCallback
. - Removed property
cb
of interfaceSdkRequest
. - Removed method
init
of interfaceSignatureValidator
. - Removed method
validate
of interfaceWebhooksHelper
.
- Removed module