Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@mx51/spi-client-js

mx511.8kApache-2.02.9.13TypeScript support: included

JavaScript Client Library for mx51's In-Store Integration.

mx51, payments, spi, api, client

readme

SPI Client JavaScript NPM Build Status Code Coverage

This is the JavaScript client library for mx51 in-store integration.

Setup

Below are basic instructions on how to run the library for development. If all you want to do is use the library in your project, just import @mx51/spi-client-js from npm.

Building

To download the dependencies and install the package, run the following:

npm install

Testing

To run a suite of unit tests configured in karma.conf.js, run the following:

npm test

Creating a distribution

To create a distribution, run the following:

npm run transpile

This will update the dist/spi-client.js.js file used for the npm package.

Disclaimer

This source code is provided “as is” or “as available” and mx51 makes no representations or warranties, express or implied, regarding the source code, that the source code will meet your requirements, or that this source code will be error-free. mx51 expressly disclaims any and all express and implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. Without limiting the generality of the foregoing, mx51 does not warrant, endorse, guarantee, or assume responsibility for this source code.

In no event shall mx51 be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this source code, even if advised of the possibility of such damage.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

DEVELOPER NOTES: This is primarily for FE developers. Guide on incrementing and labelling changes is in our Confluence space.

[2.9.12] - 07-05-2024

  • INTG-463 Support retrieving SPI tokens from paired MXA

[2.9.11] - 24-04-2024

  • INTG-897 Logging enhancements to better identify and diagnose HMAC issues

[2.9.10] - 16-04-2024

  • INTG-751 Log the current state of SPI JS if it can't connect to the terminal.
  • INTG-876 Increase the cancel timeout to 25 seconds
  • INTG-877 Reset the cancel timeout when library receives the get_transaction response

[2.9.9] - 11-09-2023

  • Add support for custom environment on DeviceAddress Service.

[2.9.8] - 05-06-2023

  • Fix security vulnerabilities
  • Use crypto to generate random int

[2.9.7] - 10-05-2023

  • Reduce time for SPI lib reconnection attempts to occur
  • AES/GCM encryption implementation

[2.9.6] - 27-04-2023

  • Converting SPI JS to TS.

[2.9.4] - 11-07-2022

  • hotfix: fixed Hmac issue for not saving previous secrets when handles with key rolling request

[2.9.2] - 31-01-2022

  • Fixed P@T issue
  • Fixed issue of confirmation code not appearing in Spice during pairing
  • Added CM5 to no-printer terminal list for SPI Libraries
  • Fixed security vulnerabilities auto created PRs (Bundle them up together and open as one commit) [log4js, follow-redirects & engine.io]

[2.9.1] - 18-11-2021

  • Bump packages
  • Refactor acquirer to tenant
  • Document SetAcquireerCode method deprecation
  • Make tests use source map output
  • Add port Mapping
  • Add a posId URL parameter to connection address

[2.9.0] - 14-10-2021

  • Bump packages
  • Bump library version
  • Add POS_ID on all messages
  • Refactor acquirer to tenant
  • Document SetAcquireerCode method deprecation
  • Fix a flaky test throwing an exception
  • Make tests use source map output
  • Fix POS info to being sent on re-pair

[2.8.6] - 19-08-2021

  • Bump library version

[2.8.5] - 21-07-2021

  • Fix an issue with key rolling

[2.8.3] - 08-06-2021

  • Add the ability to report the adaptor version

[2.8.2] - 04-02-2021

  • Ability to retrieve a list of tenancies for mx51

[2.8.1] - 14-12-2020

  • Fix AmountSummary values not being converted from cents

[2.8.0] - 28-08-2020

  • Allow library to pair with IP address only
  • Auto address resolution to be maintained within SPI
  • Auto pairing confirmation internalised
  • Internal connection change
  • Transaction status message update
  • Get Transaction to replace Get Last Transaction
  • Large number of bug fixes

[2.6.10] - 28-08-2020

  • Patch to update device address URL for 2.6.x releases

[2.4.10-patch] - 04-05-2020

  • Patch to update device address URL for 2.4.x releases

[2.6.9] - 17-03-2020

  • Updating the company name and upgrading dependencies

[2.6.8] - 06-11-2019

  • Adding Zip payment functionality

[2.6.7] - 24-10-2019

  • Reverted library module export configuration

[2.6.6] - 21-10-2019

  • Reduce WebSocket connection attempt timeout
  • Fixed issues with recovering from network dropouts where a transaction is in process

[2.6.3] - 01-10-2019

  • Added EFTPOS IP address and PosID validation
  • Reduced the number of Auto Address Resolution retries
  • Increased HTTP timeout for auto address resolution
  • Reduced re-connect timeout from 5 to 2 seconds
  • Set all pay at table default configuration to false
  • Added looping of pairing attempts

[2.0.4] - 19-04-2018

  • Fixes TIME_OUT_OF_SYNC error when running on iOS browsers.

[2.0.0] - 18-04-2018

  • Initial release with SPI 2.0.0 features.