1.0.1 • Published 7 years ago

ing-api v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

ing-api

ING api library to fetch any information needed.

Prerequisites

Installation

npm i ing-api

API

new ING(cred, uid, tensorURL) => Ing

const bank = new ING(
    {
        loginDocument: '11223344X',
        birthday: '21/03/1945',
        password: 001122
    },
    'my_user_id',
    'http://my.classifierserver.com'
);

.auth() => Promise

ing.auth().then(() => {
    // Do api requests here
});

// Async context
await ing.auth();
// Do api requests here

.getAccount() => Promise<{account}>

// Async context
const account = await ing.getAccount();
account.name // => francisco

.getProducts(account) => Promise<{product}>

//Async context
const products = await ing.getProducts(account);
products[0].iban // => "ESXXXX..."

.getTransactions({offset, limit, product}) => Promise<transaction>

// Async context
const transactions = await ing.getTransactionDetail({
    offset:0,
    limit: 10,
    product
    });
map(prop('amount'), transactions) // => [-12.95, -56.30, ...]

.getTransaction({uuid: xxx}) => Promise\

// Async context
const transaction = await ing.getTransactionDetail({uuid: 'xxx'});
transaction.amount // => -12.95