Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Releases: Ingenico-ePayments/connect-sdk-client-js

4.1.1

11 Aug 07:50
Compare
Choose a tag to compare
  • Security:
    • Updated the graceful-fs, minimist, semver, tough-cookie and word-wrap versions.

4.1.0

21 Mar 13:26
Compare
Choose a tag to compare
  • Added:
    • Added properties authenticationIndicator, canBeIframed, deviceFingerprintEnabled, isJavaScriptRequired and supportsMandates to class BasicPaymentProduct.
    • Added property fieldsWarning to class PaymentProduct.

4.0.4

18 Jan 15:51
Compare
Choose a tag to compare
  • Security:
    • Updated the json5 version.

4.0.3

16 Dec 09:36
Compare
Choose a tag to compare
  • Security:
    • Updated the minimatch version.

4.0.2

02 Dec 13:31
Compare
Choose a tag to compare
  • Security:
    • Updated the decode-uri-component and semver-regex versions.

4.0.1

13 Apr 09:08
Compare
Choose a tag to compare
  • Security:
    • Updated the node-forge, minimist and shelljs versions.

4.0.0

17 Feb 08:47
Compare
Choose a tag to compare
  • Added:
    • Added missing property logo to class AccountOnFileDisplayHints. 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 class BasicPaymentProductGroup.
    • Added static functions resolve and reject to class Promise. These can be used instead of explicitly using setTimeout to resolve or reject promises.
    • Added function validateValue to all validation rules. This is like validate but takes a PaymentRequest and a field id instead of a single value (two in case of ValidationRuleBoletoBancarioRequiredness), and therefore can better use values of other fields for validation. If called for a field that is not set on the PaymentRequest, this function returns false for most validation rules.
    • Added functions getErrorMessageIds and validateValue to class PaymentProductField. These are like existing functions getErrorCodes and isValid but take a PaymentRequest instead of a single value, and therefore can use values of other fields for validation.
    • Added function validate to class PaymentRequest. This is like isValid but returns a list of validation errors instead of just a boolean value. It's also like getErrorMessageIds, but takes into account required fields, and includes field ids in its response.
      It's advised to use validate instead of isValid and getErrorMessageIds, 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 class PaymentRequest similar to getMaskedValue.
    • Added property type with value product to class BasicPaymentProduct and with value group to class BasicPaymentProductGroup. These allow the TypeScript compiler to easily see whether a payment item is a product or group.
  • 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 global connectsdk variable is available as before. However, when using a module loader or bundler that supports AMD, it's suggested to use dist/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 use dist/index.js instead. For instance, the full-jquery-handlebars-systemjs example shows the changes needed to make for SystemJS. This includes using bundles to map connectsdk modules to the SDK's dist/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 a node-forge module if it is not yet available. This may return an empty object if no encryption is necessary, or the global forge variable to support encryption. The minimal-requirejs example shows an example.
        When using dist/connectsdk.js, dist/connectsdk.noEncrypt.js or one of their minified versions, and you use the internal define stub, this will not be an issue. The stub includes a define statement for node-forge that returns the global forge variable (or undefined 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 the PaymentProduct320SpecificData 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 property pending of class Promise are no longer visible. You should not use these though.
    • When Encryptor.encrypt is called with a PaymentRequest 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-valid PaymentRequest, 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's getPaymentProductIdByCreditCardNumber function the rejection reason stays the same though, so it includes the IIN details status as well as the response JSON.
    • PaymentRequest.setAccountOnFile can take null or undefined 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 status MUST_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.
  • Deprecated:
    • Deprecated functions getErrorCodes and isValid of class PaymentProductField in favor of new functions getErrorMessageIds and validateValue respectively. This fixes validation using the ValidationRuleBoletoBancarioRequiredness rule, for which the fiscal number was previously ignored when validating PaymentRequest objects.
    • Deprecated function getErrorMessageIds of class PaymentRequest in favor of new function validate, which returns more information. Unlike validate, getErrorMessageIds returned an empty array if the only errors where missing required fields.
  • Removed:
    • Removed property acquirerCountry from class BasicPaymentProductGroup, as it was always undefined; the property is never available for payment product groups.
    • Removed support for properties clientSessionID, assetsBaseUrl and apiBaseUrl for instantiating a session or communicator. The proper properties are clientSessionId, assetUrl and clientApiUrl, as returned from the server-to-server Create Session response. The region property is ignored.
  • Fixed:
    • The Google Pay environment is set to PRODUCTION instead of PROD if the given environment is PROD.
    • PaymentProductGroup extends BasicPaymentProductGroup instead of BasicPaymentProduct.
    • PaymentRequest.getMaskedValue no longer throws an error if the given field does not exist or does not have a value set. It instead returns undefined.
    • 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.

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

24 Jun 07:14
Compare
Choose a tag to compare
  • Security:
    • Upgraded hosted-git-info dependency version to fix a security vulnerability.

3.20.0

09 Apr 11:32
Compare
Choose a tag to compare
  • Added:
    • Added property isInstallments to C2SPaymentProductContext.
  • Fixed:
    • Fixed a try-catch related error in Internet Explorer.
  • Security:
    • Upgraded y18n dependency version to fix a security vulnerability.

3.19.2

18 Mar 14:20
Compare
Choose a tag to compare
  • Fixed:
    • The validation for the Resident Identity Card for the payment product China UnionPay (869) is improved to provide consumers a better user experience.