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

node-cba-netbank-dd

v0.7.0

Published

Unofficial Commonwealth Bank Australia Netbank API Wrapper for Node.js

Downloads

7

Readme

node-cba-netbank

NPM version MIT License Build Status Dependency Status Coverage Status

NPM

Unofficial The Commonwealth Bank of Australia NetBank API wrap for Node.js

Install

npm install node-cba-netbank --save

Usage

List Accounts

var netbank = require('node-cba-netbank');

var credential = {
  username: '76543210',
  password: 'YourPassword'
};

netbank.login(credential, function (error, accounts) {
  if (error === null) {
    //  output account to console
    console.log(accounts);
  } else {
    console.error(error);
  }
});

Just replace 76543210 with your client number, and replace YourPassword with your netbank password.

The result will look like below:

[{
    nickname: 'Smart Access',
    url: '/netbank/TransactionHistory/History.aspx?ACCOUNT_PRODUCT_TYPE=DDA&DEEPLINKING_WITH_CONTEXT=True&_e=UGxheSB3aXRoIG1hZ2ljISAxCg%3d&RID=N4bdFut-vECN0pmnBx5aMA&SID=tGfirrUiubE%3d',
    bsbNumber: '06 2338',
    accountNumber: '5282 0634',
    number: '06233852820634',
    balance: 987.65,
    availableFunds: 907.65
}, {
    nickname: 'NetBank Saver',
    url: '/netbank/TransactionHistory/History.aspx?ACCOUNT_PRODUCT_TYPE=DDA&DEEPLINKING_WITH_CONTEXT=True&_e=UGxheSB3aXRoIG1hZ2ljISAyCg%3d%3d&RID=N4bdFut-vECN0pmnBx5aMA&SID=tGfirrUiubE%3d',
    bsbNumber: '06 2438',
    accountNumber: '5287 0642',
    number: '06243852870642',
    balance: 4321.01,
    availableFunds: 4021.00
},{
...
}]

For each account:

  • nickname: Account name;
  • url: Transaction page for the account, it will be different everytime you logged in;
  • bsbNumber: BSB number;
  • accountNumber: Account number (without BSB part);
  • number: The entire account number, without space;
  • balance: Current account balance. It might be different from the available funds;
  • availableFunds: Current available funds of the account.

Retrieve Transactions for Given Account

var netbank = require('node-cba-netbank');

var credential = {
  username: '76543210',
  password: 'YourPassword'
};

// Login first
netbank.login(credential, function (error, accounts) {
  if (error === null) {
    // Assume we are going to retrieve the transactions of the first account
    netbank.getTransactions(accounts[0], function (error, transactions) {
      if (error === null) {
        // output the transactions to console, be aware, it might be a lot.
        console.log(transactions);
      } else {
        console.error(error);
      }
    });
  } else {
    console.error(error);
  }
});

Be aware, it might take several minutes if there are thousands transactions.

The transaction list will look like below:

[ { timestamp: 1429488000004,
   date: '2015-04-20T00:00:00.004Z',
   description: 'SO THAI RESTAURANT       KOGARAH',
   amount: -13.9,
   balance: 0,
   trancode: '00 05',
   receiptnumber: '' },
 { timestamp: 1429488000003,
   date: '2015-04-20T00:00:00.003Z',
   description: 'NOK NOK                  SYDNEY',
   amount: -41.8,
   balance: 0,
   trancode: '00 05',
   receiptnumber: '' },
   ...
 ]

For each transaction:

  • timestamp: Timestamp of given transaction, it's milliseconds since epoch. Although, it might be pretty accurate for some accounts (non-credit card account), it might just be accurate at date level;
  • date: It's human readable date format;
  • description: Transaction description;
  • amount: Transaction amount, negative value is DR, positive value is CR;
  • balance: The balance of the account after the transaction happened, however, the field might be empty for some accounts, such as credit card account;
  • trancode: It's a category code for the transaction, such as ATM, EFTPOS, cash out might be different code;
  • receiptnumber: The receipt number for the transaction. However, I cannot found it on my real paper receipt, and the field might be missing for some accounts, such as credit card account;

Testing

To enable real world testing, please put a JSON file, auth.json under ./test/ directory, and put content of real credential information in it:

{
  "username": "76543210",
  "password": "YourPassword"
}

Then run command:

npm test

The test will try to login and get transactions from the first account, and if it will fail if the retrieved transactions number is less than 1000. It's ok if you don't have that much transactions in the account. The purpose of checking whether it get more than 1000 transactions is to check whether it can overcome the maximum transactions limits.