T-Fowl / great-southern-bank-automation

Automation API & CLI for Great Southern Bank (formerly Credit Union Australia)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Great Southern Bank Automation in Kotlin


Disclaimer

Very much a work-in-progress that will receive attention only as required by my own personal automation-flow.

Please note that it is possible this goes against the terms and conditions of great southern bank. This repository is hosted on github primarily as an educational resource.


Description

Great Southern Bank (Formerly CUA) unfortunately does not provide an api for accessing and managing your bank account automatically.

This is a simple api using Playwright to control GSB's online banking website for such reasons.

Example

fun main() {
    // HeadFULL for development
    GSBPlaywrightOnlineBanking { setHeadless(false) }.use { bank ->
        main(bank)
    }
}

private fun main(bank: GreatSouthernBank) {
    val credentials = readCredentials()
    val gsb = bank.login(credentials).unwrap()

    val accounts = gsb.accounts().unwrap()
    printAccounts(accounts)

    val account = accounts.first()
    val transactions = gsb.transactions(account).unwrap()
    printTransactions(account, transactions)

    val payees = gsb.payees().unwrap()
    printPayees(payees)
}

Output using picnic for table generation:

┌───────────────────────────────────────────────────────┐
│Accounts                                               │
├──────────────┬────────────┬─────────────┬─────────────┤
│Account Number│Account Name│Balance      │Available    │
├──────────────┼────────────┼─────────────┼─────────────┤
│xxxxxxxx      │Primary     │$xx,xxx.xx CR│$xx,xxx.xx CR│
├──────────────┼────────────┼─────────────┼─────────────┤
│xxxxxxxx      │Secondary   │$xx.xxx.xx CR│$xx,xxx.xx CR│
└──────────────┴────────────┴─────────────┴─────────────┘
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Transactions for xxxxxxxx (Primary)                                                                                      │
├──────────┬────────────────────────────────────────────────────────┬──────────────────┬────────────────────┬─────────────┤
│Date      │Description                                             │Credit            │Debit               │Balance      │
├──────────┼────────────────────────────────────────────────────────┼──────────────────┼────────────────────┼─────────────┤
│2021-01-01│From:PAYPAL AUSTRALIA REF: xxxxxxxxxxxxx  ePayment      │                  │Money(value=x.xx)   │$xx,xxx.xx CR│
├──────────┼────────────────────────────────────────────────────────┼──────────────────┼────────────────────┼─────────────┤
│2021-01-02│From:PAYPAL AUSTRALIA REF: xxxxxxxxxxxxx  ePayment      │                  │Money(value=xx.xx)  │$xx,xxx.xx CR│
├──────────┼────────────────────────────────────────────────────────┼──────────────────┼────────────────────┼─────────────┤
│2021-01-03│From:SALARY EMPLOYER REF: xxxxxxxx  ePayment            │Money(value=x.xx) │                    │$xx,xxx.xx CR│
└──────────┴────────────────────────────────────────────────────────┴──────────────────┴────────────────────┴─────────────┘
┌───────────────────────────────────────────────────────────────────────────┐
│Payees                                                                     │
├──────────────────────┬──────┬──────────────┬────────────────┬─────────────┤
│Name                  │BSB   │Account Number│PayID Name      │PayID        │
├──────────────────────┼──────┼──────────────┼────────────────┼─────────────┤
│John SMITH            │      │              │JOHN SMITH      │+61-xxxxxxxxx│
├──────────────────────┼──────┼──────────────┼────────────────┼─────────────┤
│Jane Citizen          │xxxxxx│xxxxxxxxx     │                │             │
└──────────────────────┴──────┴──────────────┴────────────────┴─────────────┘

About

Automation API & CLI for Great Southern Bank (formerly Credit Union Australia)


Languages

Language:Kotlin 100.0%