Coder Social home page Coder Social logo

devwatts / ts-ssp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goooseman/ts-ssp

0.0 0.0 0.0 3.56 MB

NodeJS library to work with coin and bill acceptors under SSP protocol. Written in Typescript.

Shell 5.04% JavaScript 2.55% TypeScript 92.41%

ts-ssp's Introduction

Typescript Smiley ® Secure Protocol

NodeJS library to work with coin and bill acceptors under SSP protocol. Based on the work by soulman-is-good.

Supported devices

  • NV10
  • NV9 (not tested)

You are always welcome to add implementation to another device. Theoritically, you just need to add commands list to src/commands, a device name to SSPType type and check out event codes in src/events.ts.

Installation

npm install ts-ssp

Methods

  • open: () => Promise<void> - initializes connection to device
  • close: () => Promise<void> - stops connection to device
  • enable: () => Promise<void> - enables money receiving
  • disable: () => Promise<void> - disabled money receiving
  • commands.exec: (commandName?: string, ...commandArguments: number[]) => Promise<void> - Adds a command to command stack and execute it. If no commandName is passed, just executes the command stack
  • on: (eventName: string, eventHandler: (...args: number[])) => void - Attaches event handler
  • off: (eventName: string, eventHandler: (...args: number[])) => void - Dettaches event handler
  • isOpened: () => boolean - is connection to device opened
  • isEnabled: () => boolean - is money receiving enabled

Events

  • start - emits after device is initialized
  • close - emits after device is disconnected
  • error - emits when any error occured
  • other events supported by SSP protocol like slave_reset, read_note, credit_note, note_rejecting, note_stacking, disabled

Examples

TODO

There are a lot of things we need to finish to make this project great again:

  • Add support of more devices
  • Add support of encrypted layer
  • Write some tests and refactoring

Contributions are always welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.