Package Exports
- @darkwolf/qiwi.cjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@darkwolf/qiwi.cjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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('сбер')