# rycard

> Is a react component that implements an input card form to receipt the Number cards, Dates expired and CVV code. To help to the user the form shows some errors when the card is incomplete or when the date expired is not in range of valid dates.

Latest version **0.1.13** (published 2020-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install rycard
pnpm add rycard
yarn add rycard
bun add rycard
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.13 |
| Published | 2020-10-11 |
| First published | 2020-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 3 |
| Unpacked size | 97.3 KB |
| Known vulnerabilities | 0 (+30 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ray Rojas |
| Maintainers | rayrojas |
| Keywords | card, rycard, card-component, form, payments |

## Links

- npm: https://www.npmjs.com/package/rycard
- Repository: https://github.com/lokcito/rycard
- Homepage: https://github.com/lokcito/rycard#readme
- Issues: https://github.com/lokcito/rycard/issues
- npm.io page: https://npm.io/package/rycard

## Dependencies (3)

- [qs](https://npm.io/package/qs.md) 6.9.4
- [axios](https://npm.io/package/axios.md) 0.20.0
- [payment](https://npm.io/package/payment.md) 2.4.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.13 (latest) — 2020-10-11
- 0.1.12 — 2020-10-09
- 0.1.11 — 2020-10-06
- 0.1.10 — 2020-10-06
- 0.1.9 — 2020-10-05
- 0.1.6 — 2020-10-05
- 0.1.5 — 2020-10-05
- 0.1.4 — 2020-10-05
- 0.1.3 — 2020-10-05
- 0.1.2 — 2020-10-05
- 0.1.1 — 2020-10-03
- 0.1.0 — 2020-10-03

## README

# rycard

> Is a react component that implements an input card form to receipt the Number cards, Dates expired and CVV code. 
To help to the user the form shows some errors when the card is incomplete or when the date expired is not in range of valid dates.

[![NPM](https://img.shields.io/npm/v/rycard.svg)](https://www.npmjs.com/package/rycard) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save rycard
```

## Usage

```jsx
import React, { Component } from 'react'

import Rycard from 'rycard'
import 'rycard/dist/index.css'

class Example extends Component {
  constructor(props){
    super(props);
    this.state = {
      'endpoint': '/my-route-where-i-charge',
      'email': 'someone@somedomain.com',
      'price': 100.00
    };
    this.onResponse = this.onResponse.bind(this);
    this.onNativeResponse = this.onNativeResponse.bind(this);
    this.onError = this.onError.bind(this);
  }
  onResponse(response) {
    console.log('data response:', response);
  }
  onNativeResponse(response) {
    console.log('full response:', onNativeResponse);
  }  
  onError(err) {
    console.log('error', err);
  }
  render() {
    return <Rycard endpoint={this.state.endpoint} 
      email={this.state.email} 
      price={this.state.price} 
      onNativeResponse={this.onNativeResponse} 
      onResponse={this.onResponse} 
      onError={this.onError} />
  }
}
```
### Params
| Name | Description | Type | 
| ------ | ------ | ------ |
| endpoint |Url where the card will send the request POST | String
| email | Email that will be part of the form request. | String
| price |The amount that will be charge by the backend.| Number

## Bootstrap
To get stylized this form you must include bootstrap in your html headers
 [![Example](https://i.imgur.com/6xq0ANg.png)](http://games.rayrojas.info/card/?path=/docs/ry-card--default)
```
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
```

## Storybook

[http://games.rayrojas.info/card](http://games.rayrojas.info/card)

## License

MIT © [lokcito](https://github.com/lokcito)

---
_Source: https://npm.io/package/rycard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
