Skip to content

Mastercard/available-merchant-offers-reference-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Available Merchant Offers Reference Implementation

This is a reference application that demonstrates how Available Merchant Offers APIs can be used. Please see here for details on the APIs: Mastercard Developers. This application requires consumer key and .p12 file as received from Mastercard Developers.

Setup Pre-requisites:

  • Maven 3.6 or later

  • JDK 1.8.0 or later

  • Spring Boot 2.2+

  • A text editor or IDE

If your IDE is IntelliJ IDEA, you may not need to download the Maven and JDK

Checkout the code onto your local machine

Configuration

If you do not want to use the default STAGE keys associated with this project.

  • Setup account at Mastercard Developers
  • Create a project & download signing key for the Avail Merchant Offers API. It will download a zip file.
  • Select .p12 file and copy it to src\main\resources folder.
  • Open ${project.basedir}/src/main/resources/application.properties and set these parameters: [consumerKey, signingKeyFilePath, keyalias, keystorepassword]. Replace 'stage' with 'sandbox' in the basepath parameter

Build and Execute

Running outside of IDE, from command line

  • mvn clean install

  • java -jar target/AvailMerchantOffersReferenceImpl-1.0.jar

Go to your browser: localhost:8080/ and work through the application

Running on IntelliJ IDE.

  • On IntelliJ IDEA: File/New/Project From Version Control/

  • Open Maven window to generate dependencies: Click on Lifecycle - Clean & Install Compile: Lifecycle - Compile

  • Run AvailableOffersApplication.java

This will start up your local server at port 8080

Go to your browser: localhost:8080/ and work through the application

Some insights while using the service

  • Could not run this service on Sandbox as the service is not configured properly in Sandbox. Works from STAGE though, however STAGE is not stable all the time

  • It returns a null pointer exception where no offers are found

  • Does not follow proper MC Error handling standards

  • Offers API has Category Code as optional but it looks to be a mandatory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published