This GitHub repo is a playground to practice Spring Boot and integration with Monnify.
- Monnify is a payment gateway for businesses to accept payments from customers, either on a recurring or one-time basis. Monnify offers an easier, faster and cheaper way for businesses to get paid on their web and mobile applications using convenient payment methods for customers with the highest success rates obtainable in Nigeria.
- In this repo Monnify's APIs are used.
- The APIs used are:
- Get started with Monnify by creating an account
- Get your API Key, Secret Key, Base URL and CONTRACT CODE from devloper section
- Create a reserved account to test invoices from reserved account section and keep the account reference (we will use it later).
- Note: We need to create a reserved account manually as the current implemented APIs don't handle reserved accounts creation yet, but Monnify provide the API for handling that.
- Now we are ready to test our APIs.
- We can track APIs actions from our reserved account page in Monnify's dashboard.
-
Create invoice payment:
-
URL :
/payment
-
Method :
POST
-
Body :
{ "amount": 120.3, "customerName": "John", "customerEmail": "ada", "accountReference": "a17", // the reference of the reserved account we created above "description": "Trial transaction" }
-
-
Get Invoice details
-
URL :
/payment/invoice/{invoiceReference}
-
Method :
GET
-
Invoice reference is returned from the creation request and also can be found on Monnify's dashboard (PAYMENT REF)
-
-
Cancel Invoice
-
URL :
/payment/invoice/{invoiceReference}
-
Method :
DELETE
-
Invoice reference is returned from the creation request and also can be found on Monnify's dashboard (PAYMENT REF)
-
-
Initiate Refund (to be done)
-
URL :
/refund
-
Method :
POST
-
Body :
{ }
-
- Clone the repo.
- Make sure you have JDK 11 installed
- Define your Envirnoment Variables in the IDE configurations:
- Ex: In IntelliJ IDEA open (Run -> Edit Configurations -> Envirnoment Variables), set your variables as comma separated values as the following:
{ MONNIFY_API_KEY=<API_KEY>;MONNIFY_SECRET_KEY=<SECRET_KEY>;MONNIFY_BASE_URL=<BASE_URL>;MONNIFY_CONTRACT_CODE=<CONTRACT_CODE> }
- Ex: In IntelliJ IDEA open (Run -> Edit Configurations -> Envirnoment Variables), set your variables as comma separated values as the following:
- Build and run the project, by default it runs on port 8080
- In case you prefer using docker so:
- Update envirnoment variables in docker compose file.
- Make sure the project is built and .jar file is generated in target directory.
mvn clean install
- Finally
docker-compose build docker-compose up
- Authentecation
- Refund APIs
- Handle Monnify's Web hooks
- Unit tests
- Reserved account creation per user
- Store transactions in a DB from our side