npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-ezetap

v0.0.2

Published

A Cordova plugin to integrate ezetap swiping machine

Downloads

6

Readme

Cordva Plugin Ezetap

A Cordova plugin to use Ezetap POS machine for card payment.

Installation

cordova plugin add cordova-plugin-ezetap

On successful installation of this plugin, the plugin would be availble as "Ezetap" (as global variable). Mention below line in top of TS of JS file you are going access this plugin

declare var Ezetap :any

Steps:

  1. Intialize the plugin by calling method "initialize". This method invocation helps in connecting with ezetap device and preparing the device for transaction
  2. After successful initialization, you can start card transaction by calling method "cardTransaction" with payment related information.

Initialization:

Sample request

var request = {
    "demoAppKey": "aasdas",
    "prodAppKey": "dasas",
    "merchantName": "Ezetap",
    "userName":"1293123", #User name will be provided
    "currencyCode": "INR",
    "appMode": "DEMO",
    "captureSignature": "false",
    "prepareDevice" : "false"
    }

var successcallback = (result) => { 
    console.log(result);  
    # Do your thing 
};
var errorCallback = (err) => { 
    console.error(err); 
    # Do your thing
};
Ezetap.initialize(request, successcallback, errorCallback);

Response:

     {
        "status": "success",
        "error": "",
        "result":{
            "message":"Initialize successful"
        }
    }

User Name, Demo App key and Production app key will provided by Ezetap Team. (Contact Ezetap integration team for those details)

Card Transaction:

    var request = {
        "amount": 00.00,
        "mode": "SALE", # Other possible values are "CASHBACK, CASH@POS"
        "options": {
            "amountCashback": 0.0,
            "amountTip": 0.0,
            "references": {
                    "reference1":"<unique Id>", #This should be unique for each transaction
                    "reference2":"",
                    "reference3":"",
                    "additionalReferences":["addlRef1","addlRef2"]
            },
            "customer": {"customer information"}
        },
    };

    var successcallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

    var errorCallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

Ezetap.cardTransaction(request, successcallback, errorCallback);

Void Transaction:

Call this method incase you want to cancel the transaction (happened few moments before) or refund the transaction that has happened on the same day.

    var txnId = "txn12321423423";

    var successcallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

    var errorCallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

Ezetap.voidTransaction(txnId, successcallback, errorCallback);

Get Transaction:

You can get transaction details by calling this method

    var etxnId = "2983d2p93d23";

    var successcallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

    var errorCallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

Ezetap.getTransaction(etxnId, successcallback, errorCallback);

Close:

Close the interaction with ezetap device on app closure for better longitivity.

    var successcallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

    var errorCallback = function(response){
        console.log(JSON.stringify(response));
        # Do your thing
    };

Ezetap.close(successcallback, errorCallback);

Reference:

https://sandbox.ezetap.com/static/docs-cordova.html https://github.com/ezetap/android-payments-sdk https://github.com/ezetap/client-sdk-android/tree/master/release

Release Notes:

0.0.1 -> Initial release of Ezetap integrated Plugin for cordova environment 0.0.2 -> Added user permission to install Ezetap Service APP, which is necessary for proper transaction or interaction with Ezetap device