Giter Club home page Giter Club logo

react-credit-card's Introduction

React Component Credit Card - status

A Simple React component Credit Card

Credit Card example

Getting Started

$ git clone -o your-component -b master --single-branch https://github.com/descomplica/react-credit-card.git your-component

Browser Support

We do care about it.

Chrome logo Firefox logo Internet Explorer logo Opera logo Safari logo
Latest ✔ Latest ✔ IE 9+ ✔ Latest ✔ Latest ✔

CommonJS

Install via NPM

$ npm install --save @descomplica/react-credit-card

Then:

import CreditCard from '@descomplica/react-credit-card';


  callback = (data) => {
    /* data
      {
        CardNumber: "4111111111111111",
        CvvNumber: "123",
        ExpMonth: "12",
        ExpYear: "2022",
        HolderName: "giovanni keppelen"
      }
    */
  }

  render() {
    return (
      <CreditCard success={callback} />
    );
  }

With installments


  render() {
    return (
      <CreditCard price={200.00} installments={6} success={callback} />
    );
  }

Browser

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Credit Card Demo</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.1/react-with-addons.min.js" ></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.1/react-dom.min.js"></script>
  <script src="https://dnnsjdj5swfc3.cloudfront.net/front-end/libs/react-credit-card.js"></script>
</head>
<body>
  <div class="demo" id="demo"></div>

  <script>
    var CreditCard = CreditCard;
    var callback = function(data) {
    }

    ReactDOM.render(
      React.createElement(CreditCard, { success: callback }),
      document.getElementById('demo')
    );
  </script>
</body>
</html>

Development

$ npm install
$ npm start

Tests

react-credit-card is tested using Jasmine and Karma. To run the tests:

  1. npm test

LICENSE

MIT: https://github.com/descomplica/react-credit-card/blob/master/LICENSE

react-credit-card's People

Contributors

keppelen avatar tadeumaia avatar

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.