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.
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
- Step 4 : Reorganize and Refactor to bring everything together
- 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.
An alternative is to manually download the JAR for Payabbhi Java Library from Maven repository
Payabbhi Java library has the following dependencies which should be included separately:
Sign up for a Payabbhi account and download API Keys
As you go through the tutorial, you will need to replace
<SECRET-KEY> in UserDetails.java file with your actual keys. You would typically want to use your
test mode API keys for this tutorial.
Prerequisites for Steps below
- Tomcat Server
- Eclipse (Photon Release) as IDE
- Manually download Payabbhi Java Library from Maven repository
- Manually download dependencies jar mentioned above.
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
Make Project a Dynamic Web Project + Select the Imported project > Properties > Search 'Project Facets' > Select 'Dynamic Web Module'.
Select Apache Server in 'Targeted Runtimes' + Select Project > Properties > Search 'Targeted Runtimes' > Select Apache Server.
Add JAR files for Payabbhi and dependencies to Tomcat CLASSPATH + Add jars to
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.
Deploy the App + Select Project > Run As -> Run on Server
Open Superheroes in your browser e.g.