This repository was archived by the owner on Mar 19, 2024. It is now read-only.
3.0.0
·
47 commits
to master
since this release
- Added:
- Added calls
disputes.uploadFileandfiles.getFileto support uploading and downloading of files for disputes. - Added support for binary requests and responses:
- Module
connect-sdk-nodejs/utils/communicatoris now an object with functionsjsonandmultipart, for sending JSON andmultipart/form-datarequests respectively (jsoncan also be used for requests without bodies). Their inputs are the same as the old communicator function. For binary responses, the response objects'bodyproperty is a readable stream, and the objects contain an extrafileobject 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 functionssendJSONandsendMultipart, for sending JSON andmultipart/form-datarequests respectively (sendJSONcan also be used for requests without bodies).sendJSONdirectly replacessendwith the same input.sendMultipartrequires 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/headersexposes extra functionsisBinaryContent,isJSON,dispositionFilenameandcontentLength.isBinaryContentandisJSONtake a content type string and return a boolean.dispositionFilenametakes a headers objects and returns a string ornull.contentLengthtakes a headers object and returns a number ornull.
- Module
- Added calls
- 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.
- Removed call
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/communicatordirectly, use its nestedjsonfunction instead of using the module as a function directly. - If you're using module
connect-sdk-nodejs/utils/connectiondirectly, replace uses of thesendfunction withsendJSON, and change the handling of the response. You can check theconnect-sdk-nodejs/utils/communicatormodule for an example.