1.2.0 • Published 1 month ago

programmable-card-code-emulator v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Programmable Card Code Emulator

Write and test programmable card code in a safe environment.

Node.js CI License: MIT npm version

About

While exploring Programmable Banking Cards, I found it difficult to test my code. I wanted to be able to write code and test it in a safe environment. I also wanted to be able to share my code with others. This project is an attempt to solve these problems.

Installation

The emulator is available as an npm package. To install it, run the following command:

npm i programmable-card-code-emulator

Usage

Import the emulator into your code:

const emu = require("programmable-card-code-emulator");

Create a new transaction object:

const transaction = emu.createTransaction(
    "ZAR", // Currency Code
    1000, // Amount in cents
    "0000", // Merchant code (MCC)
    "Test Merchant", // Merchant Name
    "Test City", // City
    "ZAF" // Country code
);

Run an emulation:

// return a array of executions, as seen on the live logs
const result = emu.run(transaction, code, environmentalVariables);

Todo List

  • Additional tests for checking that lodash, fetch and moment are available.
  • Additional exception handling for malformed code, invalid env etc.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

1.2.0

1 month ago

1.1.0

3 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago