# react-payeezy

> Easily inject .js as a react component. Will load the script on demand and supports all the options from Payeezy docs.

Latest version **0.0.2-6** (published 2017-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-payeezy
pnpm add react-payeezy
yarn add react-payeezy
bun add react-payeezy
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2-6 |
| Published | 2017-04-19 |
| First published | 2017-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Thomas Vincent |
| Maintainers | thomasvincent |
| Keywords | react, Payeezy, inject, loaded, easy |

## Links

- npm: https://www.npmjs.com/package/react-payeezy
- Repository: https://github.com/thomasvincent/react-payeezy
- Issues: https://github.com/thomasvincent/react-payeezy/issues
- npm.io page: https://npm.io/package/react-payeezy

## 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.0.2-6 (latest) — 2017-04-19
- 0.0.2-11 (beta) — 2017-04-19
- 0.0.2-9 — 2017-04-19
- 0.0.2-8 — 2017-04-19
- 0.0.2-7 — 2017-04-19
- 0.0.2-4 — 2017-04-19
- 0.0.2-3 — 2017-04-19
- 0.0.2-2 — 2017-04-19

## README

[![npm version](https://badge.fury.io/js/react-payeezy.svg)](http://badge.fury.io/js/react-payeezy)
[![dependencies Status](https://david-dm.org/thomasvincent/react-Payeezy/status.svg)](https://david-dm.org/thomasvincent/react-Payeezy)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/thomasvincent/react-payeezy)
[![Build Status](https://travis-ci.org/thomasvincent/react-payeezy.svg?branch=master)](https://travis-ci.org/thomasvincent/react-payeezy)
# React Payeezy Component
Payeezy original API is very thorough and this makes it more react. The component is based on a implimentation for Stripe form Adam Zmenak at https://github.com/azmenak/react-stripe-checkout . 

### Installation

Get started by installing with npm

    npm install react-payeezy

Requires babel for compiling. If anyone is having issues with that,
open an issue and I'll do my best to better document the build process.

### Requirements

`token` and `PayeezyApiKey` are the only *required* props,
everything else is optional as per the Payeezy docs. See [
Docs](https://developer.payeezy.com/apis/payeezy-api). All props
go through simple validation and are passed to Payeezy , they're
also documented in `payeezy_us_v5.1.js`.

```jsx
import React from 'react'
import Payeezy from 'react-payeezy';

export default class TakeMoney extends React.Component {
  onToken = (token) => {
    fetch('/save-payeezy-token', {
      method: 'POST',
      body: JSON.stringify(token),
    }).then(response => {
      response.json().then(data => {
        alert(`We are in business, ${data.email}`);
      });
    });
  }

  // ...

  render() {
    return (
      // ...
      <Payeezy
        token={this.onToken}
        PayeezyApiKey="my_PUBLISHABLE_PayeezyApiKey"
      />
    )
  }
}
```

This will give you a default *Payeezy-style* button which looks like this:

![Payeezy  button](https://www.dropbox.com/s/tuwlslyrxubgc49/Screenshot%202016-08-05%2011.53.37.png?dl=1)

### Send all the props!

```jsx
<Payeezy
  name="Three Comma Co."
  description="Big Data Stuff"
  image="https://www.vidhub.co/assets/logos/vidhub-icon-2e5c629f64ced5598a56387d4e3d0c7c.png"
  ComponentClass="div"
  panelLabel="Give Money"
  amount={1000000}
  currency="USD"
  PayeezyApiKey="..."
  locale="zh"
  email="info@vidhub.co"
  // Note: Enabling either address option will give the user the ability to
  // fill out both. Addresses are sent as a second parameter in the token callback.
  shippingAddress
  billingAddress={false}
  // Note: enabling both zipCode checks and billing or shipping address will
  // cause zipCheck to be pulled from billing address (set to shipping if none provided).
  zipCode={false}
  alipay
  bitcoin
  allowRememberMe
  token={this.onToken}
  // Note: `reconfigureOnUpdate` should be set to true IFF, for some reason
  // you are using multiple Payeezy keys
  reconfigureOnUpdate={false}
  // Note: you can change the event to `onTouchTap`, `onClick`, `onTouchStart`
  // useful if you're using React-Tap-Event-Plugin
  triggerEvent="onTouchTap"
  >
  <button className="btn btn-primary">
    Use your own child component, which gets wrapped in whatever
    component you pass into as "ComponentClass" (defaults to span)
  </button>
</Payeezy>
```

### Other info
Pull requests welcome

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