Skip to content

Mastercard/credit-analytics-reference-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small Business Credit Analytics Reference App

Table of Contents

Overview

This is a reference application to demonstrate how the Small Business Credit Analytics(SBCA) API is used. To call the API, a consumer key and .p12 file are required - they can be obtained by creating a project on https://developer.mastercard.com - see the Configuration section below for detailed instructions.

Requirements

  • Java 11
  • IntelliJ IDEA (or any other IDE)

Frameworks/Libraries

  • Apache Maven
  • OpenAPI Generator

Integrating with OpenAPI Generator

OpenAPI Generator generates API client libraries from OpenAPI Specs. It provides generators and library templates for supporting multiple languages and frameworks. Check Generating and Configuring a Mastercard API Client to learn more about how to generate a simple API client for consuming APIs.

Configuration

  1. Create an account on Mastercard Developers if you don't have one already.
  2. Once logged in, create a new project, add the Small Business Credit Analytics API to it, and click continue.
  3. Click the button to generate and download your private signing key - a .p12 file will be downloaded.
  4. Copy the downloaded .p12 file to the src/main/resources folder in your code.
  5. Open src/main/java/com/mastercard/creditanalytics/api/ApiExamples.java and configure the default ApiClient creation logic:
  • apiBasePath- This is the URL Path to the API endpoint, one of:
  • signingKeyPath- Path to the key (*.p12) file on your machine. If you placed the file in your src/main/resources directory, your path might look like ./src/main/resources/*.p12 to run locally.
  • signingKeyAlias - The alias of your key. The default value for sandbox keys is keyalias.
  • signingKeyPassword - The password for your Keystore. The default value for sandbox projects is keystorepassword.
  • consumerKey - This is your consumer key from the Sandbox Keys or Production Keys section of your project page.

Use-Cases

  1. /matches Match a merchant's details to Mastercard's locations database
    Use this endpoint to retrieve potential matches to the merchant's provided name and address metadata in Mastercard's database.

  2. /metrics/{location_id} Get performance metrics for a merchant
    Use this endpoint to retrieve performance metrics for a matched merchant returned from /matches

More details can be found here.

Execute the Use-Cases

  1. Run mvn clean install from the root of the project directory.
  2. When the project builds successfully, you can run the following command to start the project: java -jar target/creditanalytics-referenceapp-1.0.0.jar
  3. This will start the application and run through a set of examples exercising all the use cases mentioned above

Service Documentation

Small Business Credit Analytics documentation can be found here.

API Reference

The OpenAPI specification can be found here.

Support

Please email advisors.help@mastercard.com with any questions or feedback you may have.

License

Copyright 2021 Mastercard

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages