An open API service indexing awesome lists of open source software.

https://github.com/arvindkumarbadwal/react-card-swipe

A React plugin for reading or capturing card data from magnetic swipe readers.
https://github.com/arvindkumarbadwal/react-card-swipe

card-swipe magentic react swipe-card

Last synced: about 2 months ago
JSON representation

A React plugin for reading or capturing card data from magnetic swipe readers.

Awesome Lists containing this project

README

          

# react-card-swipe

A React plugin for reading or capturing card data from magnetic swipe readers.

#### Note: Requires a magnetic card reader to executed.

![npm](https://img.shields.io/npm/v/react-card-swipe?style=for-the-badge)
![npm](https://img.shields.io/npm/dt/react-card-swipe?style=for-the-badge)

## Installation

```sh
npm install react-card-swipe
```

## Using this plugin

```js
import React from "react"
import CardSwipe from 'react-card-swipe'

class SearchPatient extends React.Component {
constructor(props) {
super(props)

this.state = {
swipeData: {}
}

CardSwipe.init({
success: this.handleSwipeSuccess,
debug: false
})
}

handleSwipeSuccess = (swipeData) => {
console.log(swipeData)

this.setState({
swipeData: swipeData
})
}

render() {
return (

{JSON.stringify(this.state.swipeData) }


)
}
}
```

## Credits

This plugin was originally of [CarlRaymond/jquery.cardswipe](https://github.com/CarlRaymond/jquery.cardswipe). This instance simply ports the functionalities into a React plugin.

## :copyright: License

[MIT](http://opensource.org/licenses/MIT)