npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

monobank-helper

v1.0.38

Published

A TypeScript SDK for interacting with Monobank API, providing methods for invoice management, payment processing, and QR terminal operations.

Downloads

263

Readme

Monobank Helper

Introduction

This is a TypeScript SDK designed to interact with the Monobank API. It provides various methods for invoice management, payment processing, and QR terminal operations.

Installation

To install the package, you can use npm:

npm install monobank-helper

Usage

First, import and instantiate the MonobankSdk class with your API key:

import MonobankSdk from 'monobank-helper';

const apiKey = 'your-api-key';
const monobankSdk = new MonobankSdk(apiKey);

Create an Invoice

To create an invoice, use the following code:

const requestBody = {
    // your request body here
};

monobankSdk.createInvoice(requestBody, 'CMS Name', 'CMS Version')
    .then(response => {
        console.log('Invoice Created:', response);
    })
    .catch(error => {
        console.error('Error creating invoice:', error);
    });

Get Invoice Status

To get the status of an invoice, use the following code:

const invoiceId = 'your-invoice-id';

monobankSdk.getInvoiceStatus(invoiceId)
  .then(response => {
    console.log('Invoice Status:', response);
  })
  .catch(error => {
    console.error('Error fetching invoice status:', error);
  });

Cancel Invoice Payment

To cancel an invoice payment, use the following code:

const requestBody = {
  // your request body here
};

monobankSdk.cancelInvoicePayment(requestBody)
  .then(response => {
    console.log('Invoice Payment Cancelled:', response);
  })
  .catch(error => {
    console.error('Error canceling invoice payment:', error);
  });

Invalidate an Invoice

To invalidate an invoice, use the following code:

const requestBody = {
  // your request body here
};

monobankSdk.invalidateInvoice(requestBody)
  .then(response => {
    console.log('Invoice Invalidated:', response);
  })
  .catch(error => {
    console.error('Error invalidating invoice:', error);
  });

Get Public Key

To get the public key for signature verification, use the following code:

monobankSdk.getPublicKey()
  .then(response => {
    console.log('Public Key:', response);
  })
  .catch(error => {
    console.error('Error fetching public key:', error);
  });

Get QR Terminal Info

To get information about a QR terminal, use the following code:

const qrId = 'your-qr-id';

monobankSdk.getQrTerminalInfo(qrId)
  .then(response => {
    console.log('QR Terminal Info:', response);
  })
  .catch(error => {
    console.error('Error fetching QR terminal info:', error);
  });

Delete Payment Amount

To delete a payment amount, use the following code:

const qrId = 'your-qr-id';

monobankSdk.deletePaymentAmount(qrId)
  .then(() => {
    console.log('Payment Amount Deleted');
  })
  .catch(error => {
    console.error('Error deleting payment amount:', error);
  });

Get QR Terminal List

To get a list of QR terminals, use the following code:

monobankSdk.getQrTerminalList()
  .then(response => {
    console.log('QR Terminal List:', response);
  })
  .catch(error => {
    console.error('Error fetching QR terminal list:', error);
  });

Create Payment Using Card Token

To create a payment using a card token, use the following code:

const requestBody = {
  // your request body here
};

monobankSdk.createPayment(requestBody, 'CMS Name', 'CMS Version')
  .then(response => {
    console.log('Payment Created:', response);
  })
  .catch(error => {
    console.error('Error creating payment:', error);
  });

Create Payment Using Card Details

To create a payment using card details, use the following code:

const requestBody = {
  // your request body here
};

monobankSdk.createCardPayment(requestBody, 'CMS Name', 'CMS Version')
  .then(response => {
    console.log('Card Payment Created:', response);
  })
  .catch(error => {
    console.error('Error creating card payment:', error);
  });