Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-payscript

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-payscript

react-payscript

  • 1.4.2
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

react-payscript

GitHub license

React client for payscript

Installation

Npm

npm install react-payscript --save

Yarn

yarn add react-payscript

UMD

<script src="https://unpkg.com/react-payscript@latest/dist/index.js"></script>

Usage

Module

import React from 'react';
import { Form, Group, Input, CreditCard, Button } from 'react-payscript';

const Example = () => {

  function onProcessing(e) {
    console.log("Processing", e);
  }
  function onSuccess(e) {
    console.log("Success", e);
  }
  function onError(e) {
    console.log("Error", e);
  }
  return (
      <Form
        apitoken="xxxxxxx-xxxxx-xxxx-xxxx-xxxxxxx"
        payscripttoken="xxxxxxxxxxxxxxxxxxxxxxxxxx"
        gateway="xxxxx"
        onProcessing={onProcessing}
        onSuccess={onSuccess}
        onError={onError}
        styles={{ 'theme': 'ready!' }} >
        <Group>
          <CreditCard label="Card" />
          <Input label="Name" id="name" placeholder="Card holder's name" required />
        </Group>
        <Group>
          <Input label="Email" id="email" placeholder="example@email.com" />
          <Input label="Phone" id="phone" placeholder="(123) 456-7890" />
          <Input label="Street" id="street" placeholder="Card billing street" required />
          <Input label="Zip" id="zip" placeholder="Card billing zip code" required />
          <Input label="Custom 1" id="custom_1" placeholder="Custom 1" />
          <Input label="Long Custom text example" id="custom_2" placeholder="Custom 2" />
        </Group>
        <Button label="PayScript $25" />
      </Form>
  )
};

export default Example;

UMD

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>React Payscript</title>
    </head>
    <body>
        <main></main>
        <!-- JSX -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.38/browser.min.js"></script>
        <!-- React -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.2.0/umd/react.development.js"></script>
        <!-- React DOM -->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.2.0/umd/react-dom.development.js"></script>
        <!-- React-Payscript -->
        <script src="https://unpkg.com/react-payscript@latest/dist/index.js"></script>
        <!-- Script -->
        <script type="text/babel" data-plugins="transform-react-jsx,transform-do-expressions,transform-object-rest-spread" >
        
            const { Form, Group, Input, CreditCard, Button }  = reactPayscript;

            class Example extends React.Component {
                onProcessing(e) {
                    console.log("Processing", e);
                }
                onSuccess(e) {
                    console.log("Success", e);
                }
                onError(e) {
                    console.log("Error", e);
                }
                render() {
                    return (
                        <Form
                            apitoken="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
                            payscripttoken="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                            gateway="xxxxx"
                            onProcessing={this.onProcessing}
                            onSuccess={this.onSuccess}
                            onError={this.onError}
                            styles={{ 'theme': 'ready!' }} >
                            <Group>
                                <CreditCard label="Card" />
                                <Input label="Name" id="name" placeholder="Card holder's name" required />
                            </Group>
                            <Group>
                                <Input label="Email" id="email" placeholder="example@email.com" />
                                <Input label="Phone" id="phone" placeholder="(123) 456-7890" />
                                <Input label="Street" id="street" placeholder="Card billing street" required />
                                <Input label="Zip" id="zip" placeholder="Card billing zip code" required />
                                <Input label="Custom 1" id="custom_1" placeholder="Custom 1" />
                                <Input label="Long Custom text example" id="custom_2" placeholder="Custom 2" />
                            </Group>
                            <Button label="PayScript $25" />
                        </Form>
                    );
                }
            }
            ReactDOM.render(<Example />,document.querySelector("main"));
        </script>
    </body>
</html>

Options

Form

  • apitoken: string
  • payscripttoken: string
  • gateway: string
  • onProcessing: function
  • onSuccess: function
  • onError: function
  • styles: json

Group

  • No params

Input

  • label: string
  • id: string !important
  • placeholder: string
  • required: boolean

CreditCard

  • label: string

Button

  • label: string

Result

Imgur

License

MIT © PAYSCRIPT

Keywords

FAQs

Package last updated on 07 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc