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
- 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
$ git clone https://github.com/payabbhi/superheroes-java.git
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:
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.
- 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
/superheroes-java/dropin/WebContent/WEB-INF/lib
or/superheroes-java/custom/WebContent/WEB-INF/lib
-
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.
- http://localhost:8080/dropin/
- http://localhost:8080/dropin/step1
- http://localhost:8080/dropin/step2
- http://localhost:8080/dropin/step3
- http://localhost:8080/dropin/step4
- http://localhost:8080/custom/
- http://localhost:8080/custom/step1
- http://localhost:8080/custom/step2
- http://localhost:8080/custom/step3
- http://localhost:8080/custom/step4