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

3.0.0

Choose a tag to compare

@IngenicoEPayments IngenicoEPayments released this 21 Jun 14:23
· 47 commits to master since this release
  • Added:
    • Added calls disputes.uploadFile and files.getFile to support uploading and downloading of files for disputes.
    • Added support for binary requests and responses:
      • Module connect-sdk-nodejs/utils/communicator is now an object with functions json and multipart, for sending JSON and multipart/form-data requests respectively (json can also be used for requests without bodies). Their inputs are the same as the old communicator function. For binary responses, the response objects' body property is a readable stream, and the objects contain an extra file object with meta-data like the file name and content type. For non-binary responses the response objects are unchanged.
      • Refactored module connect-sdk-nodejs/utils/connection. It now exposes functions sendJSON and sendMultipart, for sending JSON and multipart/form-data requests respectively (sendJSON can also be used for requests without bodies). sendJSON directly replaces send with the same input. sendMultipart requires an additional boundary, which should also be part of the content type. In addition, for both functions, the non-error result is now the complete response.
      • Module connect-sdk-nodejs/utils/headers exposes extra functions isBinaryContent, isJSON, dispositionFilename and contentLength. isBinaryContent and isJSON take a content type string and return a boolean. dispositionFilename takes a headers objects and returns a string or null. contentLength takes a headers object and returns a number or null.
  • Removed:
    • Removed call products.publicKey. It was only used for encryption for Android Pay. Now that Android Pay has been replaced by Google Pay, which uses a different mechanism for encryption, this call is no longer needed.

Unless you're using module connect-sdk-nodejs/utils/communicator or connect-sdk-nodejs/utils/connection directly, there are no breaking changes. Otherwise you need to perform the following steps:

  • If you're using module connect-sdk-nodejs/utils/communicator directly, use its nested json function instead of using the module as a function directly.
  • If you're using module connect-sdk-nodejs/utils/connection directly, replace uses of the send function with sendJSON, and change the handling of the response. You can check the connect-sdk-nodejs/utils/communicator module for an example.