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

@alex-kondakov/freekassa

v0.0.3

Published

Freekassa.ru Node.js SDK

Downloads

25

Readme

Freekassa.ru SDK

API REFERENCE

Module install

# npm install @alex-kondakov/freekassa --save

Basic usage examples

Payment form generation

//Module initialization
const freekassa = require('@alex-kondakov/freekassa').init()

//Set props
freekassa.secret1 = 'Secret word #1'
freekassa.secret2 = 'Secret word #2'
freekassa.shopId = 12345
freekassa.paymentId = 1234567890
freekassa.amount = 1000
freekassa.tel = '+79871653545'
freekassa.email = '[email protected]'

//Generate signatures
freekassa.sign();

//Make request
(async () => {
    await freekassa.orders()
        .then(response => console.log(response))
})()

Balance check

//Module initialization
const freekassa = require('@alex-kondakov/freekassa').init()

//Set props
freekassa.key = 'API key'
freekassa.shopId = 12345;

//Make request
(async () => {
    await freekassa.balance()
        .then(response => console.log(response))
})()

Available methods

  • sign - Generate new signatures.
  • create - Create payment form link. Method generate url with accesible request parameters. Returns promise. Promise resolves to payment form URL or false if fail (mandatory props: amount, currency, paymentId, signatureForm, shopId).
  • orders - Orders list. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: key, shopId).
  • ordersCreate - Create order. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: i, email, ip, amount, currency, key, shopId).
  • withdrawals - Withdravals list. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: key, shopId).
  • withdrawalsCreate - Create withdrawal. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: i, account, amount, currency, key, shopId).
  • balance - Shop balance. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: key, shopId).
  • currencies - Available payment systems to purchase from your shop. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: key, shopId).
  • currenciesStatus - Status of payment system by it's id (available or not for your shop). Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: i, key, shopId).
  • withdrawalsCurrencies - Available payment systems for withdrawal. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: key, shopId).
  • shops - Get list of shops. Returns promise. Promise resolves to false if MANDATORY parameters set incorrectly (mandatory props: key, shopId).

Available props

  • payUrl (default 'https://pay.freekassa.ru') - Payment form base URL
  • apiUrl (default 'https://api.freekassa.ru/v1') - API base URL
  • lang (default 'ru') - Payment form language
  • currency (default 'RUB') - Payment or withdrawal currency
  • key (default null) - API key
  • secret1 (default null) - Secret word #1
  • secret2 (default null) - Secret word #2
  • shopId (default null) - Shop (merchant) ID
  • paymentId (default null) - Payment id on merchant side
  • orderId (default null) - Order (payment) id on Freekassa side
  • orderStatus (default null) - Order (payment) id on Freekassa side (statuses available: 0 - new, 1 - success, 8 - fail, 9 - cancel)
  • amount (default null) - Payment amount
  • i (default null) - Payment method id (payment systems available: https://docs.freekassa.ru/#section/1.-Vvedenie/1.7.-Spisok-dostupnyh-valyut)
  • tel (default null) - Customer phone number
  • email (default null) - Customer email
  • ip (default null) - Customer IP
  • account (default null) - Payment system wallet (for withdrawals request, for example)
  • dateFrom (default null) - Data selection FROM date (for withdrawals or orders selection)
  • dateTo (default null) - Data selection TO date (for withdrawals or orders selection)
  • page (default null) - Data selection page number (for withdrawals or orders selection)
  • success_url (default null) - Custom success url (this option must be enabled by Freekassa)
  • failure_url (default null) - Custom failure uel (this option must be enabled by Freekassa)
  • notification_url (default null) - Custom notification url (this option must be enabled by Freekassa)
  • signatureForm (default null) - Signature for form generation