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

litepay

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

litepay

Wrapper for Litepay.ch API

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Litepay

npm version npm downloads license

Litepay.ch API wrapper.

Usage

import { Litepay } from 'litepay';

// Litepay.merchantCreate
(async () => {
  const invoice = await Litepay.merchantCreate({
    vendor: '0X3V5B',
    currency: 'USD',
    secret: '290657b6-2910-391s-vv2c-cbf84fc61f88',
    price: 99,
    callbackUrl: 'https://google.com',
    returnUrl: 'https://google.com',
    invoice: 1,
  });

  if (invoice.status === 'success') {
    console.log('redirect me to', invoice.url);
    return;
  }

  console.log('take a look on this error message', invoice.message);
})();

// Litepay.create
(async () => {
  const invoice = await Litepay.create({
    method: 'btc',
    receivingAddress: '1FfmbHfnpaZjKFvyi1okTjJJusN455paPH',
  });

  if (invoice.status === 'success') {
    console.log('client gotta pay to this address', invoice.address);
    return;
  }

  console.log('take a look on this error message', invoice.message);
})();

// Litepay.check
(async () => {
  const invoice = await Litepay.check({
    method: 'btc',
    address: 'address from invoice.address that returns the Litepay.create method',
  });

  if (invoice.status === 'error') {
    console.log('take a look on this error message', invoice.message);
    return;
  }

  if (+invoice.amount < 0.15) {
    console.log('invoice is not paid');
    return;
  }

  console.log('invoice is paid successfully');
})();

Available methods:

  • Litepay.merchantCreate
  • Litepay.create
  • Litepay.check

See the doc: https://litepay.ch/docs

Testing

Create .env first

npm test

FAQs

Package last updated on 04 Apr 2023

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