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.
- Host: GitHub
- URL: https://github.com/arvindkumarbadwal/react-card-swipe
- Owner: arvindkumarbadwal
- License: mit
- Created: 2020-08-27T05:15:10.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-25T05:44:19.000Z (almost 5 years ago)
- Last Synced: 2025-08-09T14:20:19.543Z (about 2 months ago)
- Topics: card-swipe, magentic, react, swipe-card
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/react-card-swipe
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.

## 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)