/open-banking-reference-application-australia

Open Banking reference app is a sample app to Mastercard's Open Banking APIs for Australia region.

Primary LanguageTypeScriptOtherNOASSERTION

Open Banking Reference Application Australia

SonarCloud

Quality Gate Status Reliability Rating Duplicated Lines (%)

Table of Contents

Overview

The Open Banking reference app is a sample app to Mastercard's Open Banking APIs For Australia where users can explore examples of how Connect and other APIs can be implemented into their applications. The reference app will allow you to create test customers and seek permission to access test account data from one or more of their test accounts. Please note that applications accessing the Open Banking APIs must be hosted within Australia.

Consent Management

  • Consent is a crucial part of getting access to the consumer’s financial data. Any information received from the financial institution in Australia is protected by CDR regulation and “an accredited person may only collect, use and disclose CDR data with the consent of the consumer”.
  • Open banking reference application manages the consent workflow and use the consent for fetching consumer data.
  • More information about consent can be found in the documentation.

Compatibility

  • Node (v14+)
  • ReactJS (v18.2.21)

This application is built using the ReactJS framework. ReactJS requires Node version 14+. However, It is recommended that you use one of NodeJS's LTS releases or one of the more general recent releases. A Node version manager such as nvm (Mac and Linux) or nvm-windows can help with this.

Installation

Before using the open banking reference application, you will need to set up a project in the local machine. The following commands will help you to get the latest code and install the required dependencies on your machine.

git clone https://github.com/Mastercard/open-banking-reference-application-australia.git

cd open-banking-reference-application-australia

npm i

References

Steps

1. Generate your credentials

Follow the steps mentioned in the document to generate your credentials.

Alt Text

Instructions to create a Mastercard Developers project:

  • Login to Mastercard developer's portal
  • Log in and click the Create New Project button at the top left of the page.
  • Enter project name and select Open Banking as the API service and click on Proceed button.
  • Select Australia region on the service details page and click on the Create Project button.
  • Take note of your Partner ID, Partner Secret and App Key. These will be required in the following sections.

2. Add credentials in the .env file

Open banking reference application needs Sandbox API credentials added in the .env file to make the API calls.

  • Create the .env file.
     cp .env.template .env
  • Update the .env file with your Sandbox API credentials generated in step 1.

3. Run application

Run the following command to start the application.

npm start

landing page

4. Create your first customer

create customer page

5. Add a bank account to customer

Now that you have a Customer ID, the next step is to add a bank account. add bank account page

connect flow finbank

6. Pull account information

account information page

Steps to run test cases

The following command will execute the test cases and show the status of each test.

npm run test

landing page

Steps to be performed for creating application build

This step is required only when the application needs to be deployed on the server.

Run the following command to create the application build.

npm run build

Refer to the below code snippet for creating an express application. In addition to that we are using http-proxy-middleware for handling proxy requests to open banking APIs or you can set up your proxy server for managing CORS (cross-origin-resource-sharing).

const express = require('express');
const {createProxyMiddleware} = require('http-proxy-middleware');
const app = express();
const port = process.env.PORT || 4000;

app.use(express.static('build'));
app.use(
    ['/aggregation', '/notifications', '/connect'],
    createProxyMiddleware({
        target: 'https://api.openbanking.mastercard.com.au/',
        changeOrigin: true,
    })
);
app.use(
    '/token',
    createProxyMiddleware({
        target: 'http://webhook.site/',
        changeOrigin: true,
    })
);

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`);
});

Contact Us

Have issues or concerns regarding the application? Please create an issue in the GitHub and our team will try to address the issue as soon as possible.