Have ideas to improve npm?Join in the discussion! »

@darkwolf/qiwi.mjs

1.0.1 • Public • Published

QIWI API

Install

ECMAScript (Node.js v12.x LTS or higher)

npm i --save @darkwolf/qiwi.mjs

CommonJS (Node.js v10.x LTS or higher)

npm i --save @darkwolf/qiwi.cjs

Lazy Loading CommonJS (Node.js v10.x LTS or higher)

npm i --save @darkwolf/qiwi.lazy.cjs

Using

// ECMAScript
import QIWI from '@darkwolf/qiwi.mjs'

// CommonJS
const QIWI = require('@darkwolf/qiwi.cjs')
// Lazy Loading CommonJS
const QIWI = require('@darkwolf/qiwi.lazy.cjs')

const qiwi = new QIWI(token, {
  phoneNumber // Some requests require a wallet phone number
})

// Handling events
qiwi.on('request', request => {})
qiwi.on('response', response => {})
qiwi.on('error', error => {})

// Getting account balance
const {balance} = await qiwi.getAccount('qw_wallet_rub')
// Getting payments
const timestamp = new UnixTimestamp()
const {transactions} = await qiwi.getPayments({
  type: 'incoming',
  sources: ['qw_rub'],
  startDate: timestamp.clone().subtract('90 days'),
  endDate: timestamp,
  limit: 50
})
// Sending payments
const paymentRequest = await qiwi.transferToQIWIWallet(phoneNumber, 5000, {
  comment: 'Ave, Darkwolf!'
})
// Getting transactions
const transaction = await qiwi.getTransaction(transactionId)
const blob = await transaction.downloadCheque('application/pdf')
await transaction.sendChequeToEmail('PavelWolfDark@gmail.com')
// Search for providers
const providers = await qiwi.searchProvider('сбер')

API Documentation

Contact Me

GitHub: @PavelWolfDark

Telegram: @PavelWolfDark

Email: PavelWolfDark@gmail.com

Install

npm i @darkwolf/qiwi.mjs

DownloadsWeekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

213 kB

Total Files

97

Last publish

Collaborators

  • avatar