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

pay_qr_sberbank

v2.0.3

Published

[Sberbank qr pay](https://developer.sberbank.ru/api/5df4ada7e4b05210f32c030d)

Downloads

7

Readme

Qr Pay

Sberbank qr pay

installation

yarn add pay_qr_sberbank

npm i pay_qr_sberbank0

Configuration

If you have angelic patience, and you were able to gain access to combat access, you have to create your ssl cert in sberbank UI, DON'T DELETE USERS AFTER IT, after that you will fight with tech support to get a new certificate, since you cannot get a new one, because bugs ))

let config = {
  qr_type: 'toString',
  debug: true, //debug mode
  client_id: 'your-client-id-from-sber-app',
  client_secret: 'your-client-secret-from-sber-app',
  access_token_url: 'https://dev.api.sberbank.ru/ru/prod/tokens/v2/oauth', //change if you're using production API
  create_order_url: 'https://dev.api.sberbank.ru/ru/prod/order/v1/creation', //change if you're using production API
  get_order_status_url: 'https://dev.api.sberbank.ru/ru/prod/order/v1/status', //change if you're using production API
  scope: 'https://api.sberbank.ru/order.create https://api.sberbank.ru/order.status https://api.sberbank.ru/sberbankid/operation' // scope is string of urls, are using in sberbank API to user access
  agentOptions: {
    passphrase: 'lool ur pass',
    pfx: __dirname + '/your cert name.'
  }
};

AgentOptions

Passphrase

It is pass you enter on a site.

pfx

It is dir to your p12 cert or Buffer.

If you don't have cert just don't use agentOptions.

qr_type

it is a flag, for configure qr view:

  • toString;
  • toDataURL.

Look qrcode.

let options = {
  order: {
    member_id: '1',
    order_number : '774635526637',
    order_params_type: [
      {
        position_name : 'Water Still',
        position_count : 10,
        position_sum : 4800,
        position_description : 'Water Still',
      },
    ],
    id_qr: '1000100051',
    order_sum: 48000,
    currency: '810',
    description: 'Water Still'
  },
  status: {
    order_id: "89",
    RqUID: "39227160133683350867440322682609" 
  },
  qrURL: "Your sberbank URL for QR"
};

Usage

Authentication

1 rule: Call methods after Auth().

const sberbank_QR = new Sberbank_QR(config);

(async () => {
  await sberbank_QR.auth();
  ...
})();

Generate

Or create order. this method will ask sberbank to create new payment. 2 rule: Be careful and check carefully your options.

const sberbank_QR = new Sberbank_QR(config);

(async () => {
  await sberbank_QR.auth();
  await sberbank_QR.generate(options);

})();

Status

You can get status of order if you have order_id and RqUID.

Using default sberbank response

const sberbank_QR = new Sberbank_QR(config);

(async () => {
  await sberbank_QR.auth();
  await sberbank_QR.generate(options);
  await sberbank_QR.get_status();
  
})();

Using Your own options

Use options.status for your status options.

const sberbank_QR = new Sberbank_QR(config);

(async () => {
  await sberbank_QR.auth();
  await sberbank_QR.generate(options);
  await sberbank_QR.get_status(options);
})();

Use qr

You can generate qr without order creation in sberbank.

const sberbank_QR = new Sberbank_QR(config);

(async () => {
  let qr = await sberbank_QR.qr(options);
  console.log(qr);
})();