klujanrosas / react-culqi

Culqi integration for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-culqi

A React library for integration with Culqi payments processor.

NPM registry Travis CI

Install

# Yarn
yarn add react-culqi

# NPM
npm install --save react-culqi

Usage

See an interactive example at:

Edit react-culqi

import { CulqiProvider, Culqi } from 'react-culqi';

const App = () => {
  return (
    <CulqiProvider
      publicKey="your-culqi-public-key-here"
      onToken={token => {
        /* handle a successful token */
      }}
      onError={error => {
        /* handle an error during tokenization */
      }}
    >
      <Culqi>
        {({ openCulqi, setAmount, amount }) => {
          return <button onClick={openCulqi}>Open Culqi</button>;
        }}
      </Culqi>
    </CulqiProvider>
  );
};

License

MIT © klujanrosas

About

Culqi integration for React


Languages

Language:JavaScript 100.0%