0.1.24 • Published 2 years ago

@crypteriat/cryptopay v0.1.24

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

CryptoPay

A react component for payment in various cryptocurrencies including LBTC and Paypal

Currently the supported payments are:

  • Lightning Bitcoin
  • Bitcoin
  • Ethereum
  • Binance Coin
  • Paypal

Installation

npm install @crypteriat/cryptopay

Use

import { CryptoPay } from '@crypteriat/cryptopay';
import '@crypteriat/cryptopay/dist/bundle.css';
import { paymentData } from '@data/PaymentData';

const addresses = [
    { ticker: 'lbtc', payserver: paymentData.lbtc.uri },
    { ticker: 'btc', address: paymentData.btc },
    { ticker: 'eth', address: paymentData.eth },
    { ticker: 'bnb', address: paymentData.bnb },
    { ticker: 'paypal', link: paymentData.paypal },
  ];

 <CryptoPay addresses={addresses} />

For now, make sure to also import the bundle.css file

Addresses are required. Not all have to be used. LBTC URI must be under 'payserver' and Paypal link must be under 'link'

  • Addresses can take in your addresses from a separate file that might look something like:
export const paymentData = {
  btc: 'btc address',
  lbtc: { apiKey: process.env.lbtcAPIkey, uri: process.env.ltbtcURI },
  eth: 'eth address',
  bnb: 'bnb address',
  paypal: 'paypal link',
};

Rearranging the order of tickers will rearrange the order in which they are displayed in the tabs

Options

GlobalTypeDefaultDescription
invoicebooleanfalseDisplay invoice button and field information

Example:

<CryptoPay addresses={addresses} invoice={true} />

INVOICE must be true for the following:

- lbtcOptions

GlobalTypeDefaultDescription
QRMessagestringSee exampleModfiy LBTC display message

Example:

const lbtcOptions = {
    QRMessage: 'This is a lbtc test',
  };

<CryptoPay
  addresses={addresses}
  invoice={true}
  lbtcOptions={lbtcOptions}
/>

- btcOptions, ethOptions, bnbOptions

GlobalTypeDefaultDescription
buttonDesstringSee exampleModfiy invoice button description
tooltipDesstringSee exampleModfiy invoice button tool-tip description
fieldDesstringSee exampleModfiy field description below 'amount' and 'email' forms
QRMessagestringSee exampleModfiy display message

Example:

const btcOptions = {   //or ethOptions, bnbOptions
    buttonDes: 'This is a btc test',
    tooltipDes: 'This is a btc test',
    fieldDes: 'This is a btc test',
    QRMessage: 'This is a btc test',
  };

<CryptoPay
  addresses={addresses}
  invoice={true}
  btcOptions={btcOptions}
  ethOptions={ethOptions}
  bnbOptions={bnbOptions}
/>

- paypalOptions

GlobalTypeDefaultDescription
fieldDesstringSee exampleModfiy field description below 'donate' button

Example:

const paypalOptions = {
    fieldDes: 'This is a paypal test',
  };

<CryptoPay
  addresses={addresses}
  invoice={true}
  paypalOptions={paypalOptions}
/>

Example

Clone the repo and run these commands:

npm i
npm run dev

Notice

As said above, the only supported payment types are currently listed. Not all of them have to be used, but there is not capability right now to add any further options. We are still in progress.

0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.16

2 years ago

0.1.8

2 years ago

0.1.17

2 years ago

0.1.7

2 years ago

0.1.18

2 years ago

0.1.19

2 years ago

0.1.9

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago