Catalog npm
Back to packageRELEASE DETAILS

0.1.4

npm

2co-react

React stateful component to connect to 2CO api and generate authorization token

2checkout2copaymentpayment gatewayreact
Published23 Nov 2018
Direct dependencies12
Transitive dependenciesNot calculated

README

Current package documentation

2Checkout payment gateway and react

React stateful component with or without credit form that connect to 2CO api and generate client token

Getting Started

2Checkout payment gateway need a token to create and charge orders. This package will create a token for you.

Using this token, you will need to send your order and customer info to 2Checkout to make the charge.

This can be done by 2Checkout API or by 2Checkout-Node.

I recommend using 2Checkout-Node along with this package to generate token and send it to 2Checkout-Node to create the charge.

Installing & Usage

A step by step series of examples that tell you how to get a token:

Install:

npm i 2co-react

or

yarn add 2co-react

Usage:

Importing:

import TCO from '2co-react';

This is the only component you need to add:

        <TCO
          sellerId="xxxxx"
          publishableKey="xxxxx"
          sandbox
          showForm
          showModal
          showLoading
          returnToken={this.returnToken}
        />

Props Options:

TCO PropVALUEEffect
sellerIdselled id from 2checkout account-
publishableKeypublishable key from 2checkout account-
sandboxtrue or falsegenerate a sandbox or production token
showFormtrue or falseshow cedit card form
showModaltrue or falseshow credit card form on modal or on page
showLoadingtrue or falseshow loading bar while waiting for response back
returnTokenfunctionfunction that will recive one argument as the token string

Authors

  • Matan Schatzman - Email

License

This project is licensed under the MIT License

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 12

Native requirements
12 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
card-react
Environment
{
  "local_name": "card-react",
  "alias": false,
  "peer_metadata": null
}
^1.2.7runtime
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^16.6.3runtime
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^16.6.3runtime
react-form
Environment
{
  "local_name": "react-form",
  "alias": false,
  "peer_metadata": null
}
^3.5.6runtime
react-load-script
Environment
{
  "local_name": "react-load-script",
  "alias": false,
  "peer_metadata": null
}
^0.0.6runtime
react-loader-spinner
Environment
{
  "local_name": "react-loader-spinner",
  "alias": false,
  "peer_metadata": null
}
^2.2.0runtime
react-responsive-modal
Environment
{
  "local_name": "react-responsive-modal",
  "alias": false,
  "peer_metadata": null
}
^3.5.1runtime
@babel/cli
Environment
{
  "local_name": "@babel/cli",
  "alias": false,
  "peer_metadata": null
}
^7.1.5development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.1.6development
@babel/plugin-proposal-class-properties
Environment
{
  "local_name": "@babel/plugin-proposal-class-properties",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.1.6development
@babel/preset-react
Environment
{
  "local_name": "@babel/preset-react",
  "alias": false,
  "peer_metadata": null
}
^7.0.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-dkKNLyWcE1vTQl8uhnLIeiE2bDvaW4IB+SwTDBqOkWQeuUKkjEQp6gH+GBLoWSaBSryLgKIAo+o+ui+LyAppow==",
  "shasum": "b276d4e2e2d1a6c4d3287195ce529df1c7250997",
  "tarball": "https://registry.npmjs.org/2co-react/-/2co-react-0.1.4.tgz",
  "fileCount": 13,
  "unpackedSize": 68688,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb98skCRA9TVsSAnZWagAAxY4P/1mEyTueC8o+IRr7/6Bw\nWbtlSGiPcT+Z2ZyMWl1AaJJ0RFlySOQrDANMmLQ5I9kx84fCM8Q6eii1XVHh\nY0P7vSQmMXhDdjRT9mdVg6UmTZOb4s+npVX1R+J6j7eZ0FJtgoozaCUyWm1K\n4LpDZgE9Hx1dFeGezLcHTfvjpGQojDHqAcITbgKYKJNAgxIWGuHoJqRDzsHM\nqd0bPBMnmxQTY8I9KWhgTIqrz1JRVs+znxKDKsT+FXjPeHUgDocHnm2lg+06\nXthi3aAPz88wXOYkodU4ElEO85Oy3KUuke6gur435M/UwSsP9gjhcLPxJQQ5\nKNAYQ2HjtnLEI4eE88/rpLQk/0V7TkI+8ebJ/Cn737KNbmvo8Xz4WtG16WRB\nUkqZiahgN6X4aHLVJejucoCrvgQtKLbDZGhyy4iYw32OYothH0bfl4XLCqth\n+7sBjBwfuf+jpJ82jicAGOke+9qj56hFuWNm5n9mG0QJ9MvzvgpaCKB62V9M\n6uFowYvk5b2zTPsK9iOfNcgKtv/ef6IwiOfMdObioOfCedMF34NFpubFhYDz\n/kvxWjdIN13alxb/LYcd/u+CbdhujrRm1BWwmoCZtvJw2wl5J3aNNT1k6COR\nwvlpiqJjXnknopR0h30BIO0gfzH24v7mnMLgqAF8huZj3KWIF7L1mkdT0wiK\npVAu\r\n=sdpj\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQC/el81mQcHLix0KI0wNUirt5qlDWogeYyozspWU+wuPAIhAPKk/ylA1jDLYpKM+N0W+XlmjoouOJ5qmL+QqE1Rp7ce"
    }
  ]
}

Repository

PENDING
metalice/2co-node

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c4defaf9b30da979c12a0b34c46274b7d6476f321fdeaa40496c7a2bda38f986

Other collected versions

0.1.623 Nov0.1.523 Nov0.1.322 Nov0.1.222 Nov0.1.122 Nov0.1.022 NovView all collected versions →