Giter VIP home page Giter VIP logo

cordova-plugin-unimag-swiper's People

Contributors

elizabethrego avatar ssigwart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cordova-plugin-unimag-swiper's Issues

Application Crash on certain cards

Certain Credit Cards give me this error when I swipe them and crash the application.

The card I describe is a TD business card: **** *** *** ***

Sep 26 00:08:59 iPad(CoreFoundation)[759] : *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'

Always get 'swipe_error' even after successful activation and connection

Have been using your excellent cordova plugin but I am having trouble getting the card to swipe correctly. I am always getting a 'swipe_error'. I see in the java file, this indicates a JSON parse error?

Here are my details:

The problem occurs on Android with the Unimag II. I haven't tried it on an apple device. Using Cordova 6.0.0

The plugin finds the unimag device and connects to it. After connecting, I then call the swipe function to get ready for the swipe. It works telling me in the logs, "Swipe Started".

When I swipe the credit card however, it always returns a "swipe_error" event. Never a swipe_success. I have tried multiple credit cards with no luck. I have used the unimag utility app on the Google Play store and it allows me to swipe cards with it. Any clues as to where I should start looking?

self.initialize = function (callback) {
    //activate sdk and register notification callback

    if (!self.initialized()) {
        cordova.plugins.unimag.swiper.activate();
            cordova.plugins.unimag.swiper.enableLogs(true);
            cordova.plugins.unimag.swiper.setReaderType('unimag_ii');

            cordova.plugins.unimag.swiper.on('connected', function () {
                self.connected(true);
                self.swipe();
            });

            cordova.plugins.unimag.swiper.on('disconnected', function () {
                self.connected(false);
            });

            cordova.plugins.unimag.swiper.on('swipe_success', function (e) {
                var data = JSON.parse(e.detail);
                console.log('cardholder name: ' + data.first_name + ' ' + data.last_name);
                console.log('card number:' + data.card_number);
                console.log('expiration:' + data.expiry_month + '/' + data.expiry_year);
            });

            cordova.plugins.unimag.swiper.on('swipe_error', function () {
                console.log('ERROR: Could not parse card data.');
                self.swipe();
            });

            cordova.plugins.unimag.swiper.on('timeout', function (e) {
                if (self.connected()) {
                    console.log('ERROR: Swipe timed out - ' + e.detail);
                } else {
                    console.log('ERROR: Connection timed out - ' + e.detail);
                }
            });

            cordova.plugins.unimag.swiper.on('xml_error', function (e) {
                console.log('ERROR: Could not xml_error data.');
            });
    }




self.swipe = function () {
    if (self.connected()) {
        cordova.plugins.unimag.swiper.swipe(function successCallback() {
            console.log('SUCCESS: Swipe started.');
        }, function errorCallback() {
            console.log('ERROR: Could not start swipe.');
        });
    } else console.log('ERROR: Reader is not connected.');
};

Supported Device's Update

Hello Elizabethrego,

I am facing issue in Android for Unimag card swiper as new devices are available in the market now so Unimag sdk 5.0 is not able to Detect the card reader anymore in new devices. Can you suggest the best possible solution for this. Although i added Google pixel model in the supported device list and it worked. But as there are a lot of new devices available in the market for Android how can you get a updated list of supported device list for this Sdk.

Using unimag with encryption

Hi I know that the new unimag readers support encryption. Is that possible with the current project? It is possibly going to be part of the future road map?

I looked through the iOS code and couldn't find something in particular.

Thanks.

XML file

Hello,
I'm getting an error on Nexus7 (OS ver 5.1.1):
The xml file does not exist and the auto update disabled.

It works fine on Samsung S6 and S3.
Something is probably related to the file location res/raw for Nexus.
Any workaround is there?

Thank you in advance

How to Use this Plugin in Ionic 2 Project

I'm trying to put this plugin into an Ionic 2 project but thus far, I've been unsuccessful.

I added it using cordova plugin add https://github.com/elizabethrego/cordova-plugin-unimag-swiper/

Afterwards I try to access it using the following:

cordova.plugins.unimag.swiper.activate();
cordova.plugins.unimag.swiper.enableLogs(true);
cordova.plugins.unimag.swiper.setReaderType('unimag_ii');

I get the error "Cannot read property 'unimag' of undefined"

I tried adding the following interface to my typings folder.

interface Window {
plugins: any;
}

The error still persists. Can you point me in the right direction?

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.