Skip to content

Mastercard/open-banking-reference-application

Repository files navigation

Open Banking Reference Application

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 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 also 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 the United States.

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.git
cd open-banking-reference-application && 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 Project button at the top of this page
  • Select Open Banking and follow the step-by-step instructions
  • 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

6. Pull account information

account information page

Steps to run test cases

The following command will execute the test cases and show the result.

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/**', '/connect/**'],
    createProxyMiddleware({
      target: 'https://api.finicity.com',
      changeOrigin: true,
    })
  );
app.listen(port, () => {
  console.log(`Example app listening on port ${port}`);
});

Contact Us

If you have any issues or concerns, please click here to submit an issue and our team will get back to you as soon as possible.

About

Open Banking reference app is a sample app to Mastercard's Open Banking APIs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published