Simple SDK for Tinkoff API.
const TinkoffAPI = require('./api');
require('dotenv').config();
const bankApi = new TinkoffAPI(process.env.TINKOFF_TERMINAL_KEY, process.env.TINKOFF_SECRET_KEY);
bankApi.init({
Amount: '10000',
OrderId: '123',
DATA: {
Email: '[email protected]',
Phone: '+71234567890'
},
Receipt: {
Email: '[email protected]',
Phone: '+71234567890',
Taxation: 'osn',
Items: [
{
Name: 'Наименование товара 1',
Price: 100,
Quantity: 100,
Amount: 10000,
Tax: 'none',
Ean13: '0123456789'
}
]
}
}).then(res => {
console.log(res);
}).catch(err => {
console.log(err)
});
{ Success: true,
ErrorCode: '0',
TerminalKey: '...',
Status: 'NEW',
PaymentId: '...',
OrderId: '123',
Amount: 10000,
PaymentURL: 'https://securepay.tinkoff.ru/new/...' }
Execute this command:
yarn jest