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

freekassa-payment-nodejs

v1.0.0

Published

Universal payments API SDK for freekassa

Downloads

18

Readme

freekassa-payment-nodejs

Version: 1.0.0

Node.js SDK module for the implementation of a single payment protocol acquiring Freekassa

Installation using npm:

$ npm i freekassa-payment-nodejs

Connection:

const FK = require('@freekassa');

Documentation

Step-by-step guide to working with the API: https://docs.freekassa.ru

To use the SDK, you need Your store ID, Secret Word 1, Secret Word 2, details in the documentation � https://docs.freekassa.ru

const fkMerchantID = 'You store ID';
const fkFirstSecret = 'Secret Word 1';
const fkSecondSecret = 'Secret Word 2';
const fkIpAddress = 'Secret Word 2';

const freekassa = new FreeKassaPaymentsAPI(fkMerchantID, fkFirstSecret, fkSecondSecret, fkIpAddress);

Examples

By default, several payment methods are available to the user. In the payment form, the account parameters are transmitted in clear form in the link. Next, the client is shown a form with a choice of payment method in the desired currency. When using this method, it cannot be guaranteed that all invoices are issued by freekassa, unlike billing via API.

Through the API, all parameters are transmitted in a closed form, as well as invoicing operations are supported in the API, as well as checking the status of operations.

Invoicing

A reliable way to integrate. Parameters are passed to server2server using authorization. The method allows you to issue an invoice, if the request is successful, the payURL parameter will be returned in the response - a link for redirecting the user to the payment form.

The "createPaymentFK" method issues a new invoice. In the parameters, you need to specify the "fields" parameters. As a result, a response will be received with the invoice data.

const fields = {
    shopId: Your store ID,
    amount: 'USD',
    currency: '111.11',
    email: '[email protected]',
    orderID: '123',
    i: '',
    nonce: Date().getTime()
};

Freekassa.createPaymentFK(fields).then( data => {
    //do with data
});

As a result:

{
  "type": "success",
  "orderId": 123,
  "orderHash": "ba2c78c3509999686a6db7c122b9c49c",
  "location": "https://pay.freekassa.ru/form/123/ba2c78c3509999686a6db7c122b9c49c"
}

Billing information

The 'getPaymentFKmethod returns account information. In the parameters, you need to specify theorderHash` identifiers and the billing time inside your system, as a result, a response with the account status will be received.

const fields = {
    orderHash: 'ba2c78c3509999686a6db7c122b9c49c',
    nonce: nonce
};

Freekassa.getPaymentFK(fields).then( data => {
    //do with data
});

As a result:

{
  "type": "success",
  "pages": 12,
  "orders": [
    {
      "merchant_order_id": "Order #123",
      "fk_order_id": 1656590159,
      "amount": 111.11,
      "currency": "USD",
      "email": "[email protected]",
      "account": "1",
      "date": "2022-06-30 14:55:55",
      "status": 1
    }
  ]
}