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

@themod/enot-io

v2.0.3

Published

Library for using the EnotIO payment system for NodeJS

Downloads

10

Readme

Description

Library for using the EnotIO payment system for NodeJS

Installation

npm i @themod/enot-io

Usage

const {EnotIO, PaySystem} = require('@themod/enot-io');

let enot = new EnotIO({
    merchant_id: YOUR_MERCHANT_ID,
    secret_key: YOUR_SECRET_KEY,
    api_key: YOUR_API_KEY,
    email: YOUR_EMAIL_ADDRESS
});

PaySystem - Needed to choose a payment system. Example:

enot.withDraw({
  service: PaySystem.QIWI,
  wallet: `79196211213`,
  amount: 10
});

Withdraw to Qiwi system.

Metods

getBalance - Get an available balance on the site

enot.getBalance();

[Output] { status: 'success', balance: '0.00', balance_freeze: '0.00' }

withDraw - Withdrawal from the site

enot.withDraw({
  service: service, 
  wallet: wallet, 
  amount: amount, 
  orderid: orderid, 
  card_holder: card_holder
});

[Output] { status: 'success', balance: 0.00, id: 1234}

  • service - code of service. Check more here. You can also choose from the list if you connect PaySystem
  • wallet - wallet number for withdrawal
  • amount - withdrawal amount. Minimal amount check here
  • orderid - payout number in your system (unique). Optional
  • card_holder - сardholder's name. If the service is a card

getPaymentById/getPaymentByOrderId - Payment information by id/orderid

enot.getPaymentById(id);
enot.getPaymentByOrderId(orderid);

[Output] {"transaction_id":52406,"status":"success", "service":"qw","wallet":"79192131245","sum":"50.00","commission":"2.00"}

  • id - payment number in the payment system service
  • orderid - payment number in the your service

getPaymentMethods - Obtaining information about the available methods of replenishment / withdrawal of your cash register

enot.getPaymentMethods()

[Output] {"status":"success","methods":{"qw":{"cm":"3.00","min":"1.00"},"cd":{"cm":"6.00","min":"45.00"},"ya":{"cm":"3.00","min":"10.00"},"pa":{"cm":"4.00","min":"1.00"},"pm":{"cm":"3.00","min":"1.00"}}}

generateLink - Generating a link to a payment form

enot.generateLink({amount: YOUR_AMOUNT, appointment: YOUR_APPOINTMENT, payment_id: YOUR_PAYMENT_ID, currency: YOUR_CURRENCY, webhook: YOUR_WEBHOOK_URL, payment_method: YOUR_PAYMENT_METHOD, redirect: 0/1, success_url: YOUR_SUCCESS_URL, fail_url: YOUR_FAIL_URL});
  • amount - amount of payment. (required)
  • appointment - purpose of payment.
  • payment_id - payout number in your system (unique). Default - Date.now()
  • currency - Payment currency (RUB, USD, EUR, UAH) (Default RUB)
  • webhook - A string that will be returned to notifications after payment (webhook, callback) (Can be passed as an array). Default - null
  • payment_method - Initially set the payment method. Default - 0
  • redirect - Forwarding directly to the payment system (Currently available only for QIWI). Default - 0
  • success_url - Link to redirect on success. Default - null
  • fail_url - Link to redirect on fail. Default - null

Important

If you use async function use await. Example:

let result = await enot.getPaymentMethods().catch(error => {
    console.log(error)
})

Else use then and catch. Example:

enot.withDraw({
  service: service,
  wallet: wallet,
  amount: amount,
  orderid: orderid,
  card_holder: card_holder
}).then(response => {
    console.log(response)
}).catch(error => {
    console.log(error)
})

License

MIT