This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
Releases: Ingenico-ePayments/connect-sdk-client-js
Releases · Ingenico-ePayments/connect-sdk-client-js
4.1.1
4.1.0
- Added:
- Added properties
authenticationIndicator
,canBeIframed
,deviceFingerprintEnabled
,isJavaScriptRequired
andsupportsMandates
to classBasicPaymentProduct
. - Added property
fieldsWarning
to classPaymentProduct
.
- Added properties
4.0.4
- Security:
- Updated the
json5
version.
- Updated the
4.0.3
- Security:
- Updated the
minimatch
version.
- Updated the
4.0.2
- Security:
- Updated the
decode-uri-component
andsemver-regex
versions.
- Updated the
4.0.1
- Security:
- Updated the
node-forge
,minimist
andshelljs
versions.
- Updated the
4.0.0
- Added:
- Added missing property
logo
to classAccountOnFileDisplayHints
. The logos are formatted in the same way as payment product logos. There is no need anymore to retrieve an account on file's payment product for the logo. - Added missing property
allowsInstallments
to classBasicPaymentProductGroup
. - Added static functions
resolve
andreject
to classPromise
. These can be used instead of explicitly usingsetTimeout
to resolve or reject promises. - Added function
validateValue
to all validation rules. This is likevalidate
but takes aPaymentRequest
and a field id instead of a single value (two in case ofValidationRuleBoletoBancarioRequiredness
), and therefore can better use values of other fields for validation. If called for a field that is not set on thePaymentRequest
, this function returns false for most validation rules. - Added functions
getErrorMessageIds
andvalidateValue
to classPaymentProductField
. These are like existing functionsgetErrorCodes
andisValid
but take aPaymentRequest
instead of a single value, and therefore can use values of other fields for validation. - Added function
validate
to classPaymentRequest
. This is likeisValid
but returns a list of validation errors instead of just a boolean value. It's also likegetErrorMessageIds
, but takes into account required fields, and includes field ids in its response.
It's advised to usevalidate
instead ofisValid
andgetErrorMessageIds
, as it can return more information with just one call. An error is thrown if called without a payment product set though. - Added function
getUnmaskedValue
to classPaymentRequest
similar togetMaskedValue
. - Added property
type
with valueproduct
to classBasicPaymentProduct
and with valuegroup
to classBasicPaymentProductGroup
. These allow the TypeScript compiler to easily see whether a payment item is a product or group.
- Added missing property
- Changed:
- Rewrote the SDK in TypeScript. This adds types to parameters and response values. Fields that are always set are not marked as optional.
We attempted to minimize the number of breaking changes. For instance,dist/connectsdk.js
,dist/connect.noEncrypt.js
and their minified versions remain, and when used directly in the browser the globalconnectsdk
variable is available as before. However, when using a module loader or bundler that supports AMD, it's suggested to usedist/index.js
instead.
There are some changes that may require you to make changes to your project:- The
src
folder is no longer available. If you used the source files directly, you need to usedist/index.js
instead. For instance, the full-jquery-handlebars-systemjs example shows the changes needed to make for SystemJS. This includes usingbundles
to mapconnectsdk
modules to the SDK'sdist/index.js
file. - When using a module loader or module bundler that supports AMD, the SDK has a dependency on
node-forge
, even if encryption is not needed. You need to provide anode-forge
module if it is not yet available. This may return an empty object if no encryption is necessary, or the globalforge
variable to support encryption. The minimal-requirejs example shows an example.
When usingdist/connectsdk.js
,dist/connectsdk.noEncrypt.js
or one of their minified versions, and you use the internaldefine
stub, this will not be an issue. The stub includes adefine
statement fornode-forge
that returns the globalforge
variable (orundefined
if not available). - Most properties are marked as read-only. When using TypeScript, you will get a compiler error if you try to update a read-only property. This indicates a wrong usage of the SDK. When using JavaScript, this is still possible though.
- Class
IinDetailsResponse
has been rewritten to include a proper constructor and read-only properties. This only affects how instances are created, which you should usually not do. GooglePay.isGooglePayAvailable
needs thePaymentProduct320SpecificData
as returned by the Get Payment Product(s) response. It no longer accepts an array of networks. You should not use this function directly though.- Function
complete
and propertypending
of classPromise
are no longer visible. You should not use these though.
- The
- When
Encryptor.encrypt
is called with aPaymentRequest
that has no payment product set, the returned promise is rejected with a string reason, instead of causing an error to be thrown. Otherwise, when it's called with a non-validPaymentRequest
, the returned promise is rejected with the validation errors, not just the error message ids. - Rejection reasons from session and communicator calls are now mostly the actual error that occurred or the error response that was returned by the REST API. For the session's
getIinDetails
function and the communicator'sgetPaymentProductIdByCreditCardNumber
function the rejection reason stays the same though, so it includes the IIN details status as well as the response JSON. PaymentRequest.setAccountOnFile
can takenull
orundefined
to clear the account on file.PaymentRequest.isValid
takes the account on file attribute status into account when checking for required fields. If an attribute has statusMUST_WRITE
, a value for the field must be specified, even though the account on file provides a value. This enforces changing the expiry date of expired cards.node-forge
is now a regular dependency instead of a develop dependency. It has also been updated to version 1.2.1.- Some development dependencies have been updated. As a result, Node.js 12.22.0 or higher is needed to build the SDK. This limitation does not apply to using the SDK once it's built.
- Rewrote the SDK in TypeScript. This adds types to parameters and response values. Fields that are always set are not marked as optional.
- Deprecated:
- Deprecated functions
getErrorCodes
andisValid
of classPaymentProductField
in favor of new functionsgetErrorMessageIds
andvalidateValue
respectively. This fixes validation using theValidationRuleBoletoBancarioRequiredness
rule, for which the fiscal number was previously ignored when validatingPaymentRequest
objects. - Deprecated function
getErrorMessageIds
of classPaymentRequest
in favor of new functionvalidate
, which returns more information. Unlikevalidate
,getErrorMessageIds
returned an empty array if the only errors where missing required fields.
- Deprecated functions
- Removed:
- Removed property
acquirerCountry
from classBasicPaymentProductGroup
, as it was alwaysundefined
; the property is never available for payment product groups. - Removed support for properties
clientSessionID
,assetsBaseUrl
andapiBaseUrl
for instantiating a session or communicator. The proper properties areclientSessionId
,assetUrl
andclientApiUrl
, as returned from the server-to-server Create Session response. Theregion
property is ignored.
- Removed property
- Fixed:
- The Google Pay environment is set to
PRODUCTION
instead ofPROD
if the given environment isPROD
. PaymentProductGroup
extendsBasicPaymentProductGroup
instead ofBasicPaymentProduct
.PaymentRequest.getMaskedValue
no longer throws an error if the given field does not exist or does not have a value set. It instead returnsundefined
.- A promise no longer throws an error if it's rejected but no failure function was set.
- Trying to encrypt a
PaymentRequest
that had no payment product set no longer throws an error. Instead, the returned promise is rejected with a string. ValidationRuleResidentIdNumber
no longer allows values of length 15 that are not fully numerical.
- The Google Pay environment is set to
Our examples have been updated to work with the new SDK version. However, apart from changes necessary for SystemJS and RequireJS (see above), no changes were necessary. Any further changes that were made show how to better use the SDK. For TypeScript applications, more work may be necessary due to fields now being read-only or optional, where before they had no type information. For instance, with TypeScript it's no longer allowed to add properties to existing objects.
3.20.1
- Security:
- Upgraded
hosted-git-info
dependency version to fix a security vulnerability.
- Upgraded
3.20.0
- Added:
- Added property
isInstallments
toC2SPaymentProductContext
.
- Added property
- Fixed:
- Fixed a try-catch related error in Internet Explorer.
- Security:
- Upgraded
y18n
dependency version to fix a security vulnerability.
- Upgraded
3.19.2
- Fixed:
- The validation for the Resident Identity Card for the payment product China UnionPay (869) is improved to provide consumers a better user experience.