A tutorial to enable Payments acceptance via Payabbhi Java library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
custom
dropin
.gitignore
LICENSE
README.md

README.md

Superheroes - A tutorial to enable Payments acceptance via Payabbhi Java library

Superheroes Store allows purchase of a superhero, to run errands for you, by paying a random amount between ₹1 to ₹5.

The Payments Acceptance workflow is implemented as described in the Payabbhi Integration Guide using Payabbhi Java Library.

The Superheroes tutorial is designed to take you to full implementation in four graded steps:

  • Step 1 : Basic implementation of Payments Acceptance workflow
  • Step 2 : Add Payment Response Handling
  • Step 3 : Add Exception Handling
  • Step 4 : Reorganize and Refactor to bring everything together

Getting started

  • Clone the Superheroes repository
  • Install the Payabbhi Java library
  • Sign up for a Payabbhi account and download API Keys
  • Set up local env for running Superheroes

Clone the Superheroes repository

 $ git clone https://github.com/payabbhi/superheroes-java.git

Install the Payabbhi Java Client library

First install the Payabbhi Java library as per instructions provided with it for Maven or Gradle.

Manual Download

An alternative is to manually download the JAR for Payabbhi Java Library from Maven repository

Dependencies

Payabbhi Java library has the following dependencies which should be included separately:

Sign up for a Payabbhi account and download API Keys

Next, sign up for a Payabbhi Account and download the API keys from the Portal.

As you go through the tutorial, you will need to replace <ACCESS-ID> and <SECRET-KEY> in UserDetails.java file with your actual keys. You would typically want to use your test mode API keys for this tutorial.

Running Superheroes

Prerequisites for Steps below
Steps
  1. Import Superhero Project - either custom or dropin.

  2. Add Tomcat Server to Eclipse Project + Eclipse > Preferences > Search "Server" > Select Runtime Environments > Click on Add > Select Tomcat Server under Apache section (Make sure checkbox titled 'Create New Local Server' is checked) > Next > Provide the installation directory of Tomcat > Finish > Apply & Close

  3. Make Project a Dynamic Web Project + Select the Imported project > Properties > Search 'Project Facets' > Select 'Dynamic Web Module'.

  4. Select Apache Server in 'Targeted Runtimes' + Select Project > Properties > Search 'Targeted Runtimes' > Select Apache Server.

  5. Add JAR files for Payabbhi and dependencies to Tomcat CLASSPATH + Add jars to /superheroes-java/dropin/WebContent/WEB-INF/lib or /superheroes-java/custom/WebContent/WEB-INF/lib

  6. Add JAR files to Project CLASSPATH + Select Project > Properties > Select Java Build Path > Select libraries > Add external jars > Navigate to jars and Add > Apply and Close.

  7. Deploy the App + Select Project > Run As -> Run on Server

  8. Open Superheroes in your browser e.g.