XpressPayment is a Spring Boot application designed to facilitate user authentication using JSON Web Tokens (JWT) and enable airtime payments through the Xpress Payment VTU API. Below, you'll find an overview of the project and its key features.
Ensure you have the following installed:
- Java (version 17)
- Your preferred IDE (e.g., IntelliJ, Eclipse)
-
Clone the repository:
git clone https://github.com/dejmartins/XpressPayment.git
-
Navigate to the project directory:
cd XpressPayment
Adjust configuration settings in application.properties to match your environment.
To obtain an authentication token, make a POST request to the /login
endpoint with valid credentials. The application comes with a default user:
- username: [email protected]
- password: password
Access the airtime purchase endpoint by making a POST request to /api/airtime/purchase
. Ensure you include a valid JWT token in the request header.
Include the JWT token in the request header as follows:
Authorization: Bearer <your-token-here>
Ensure that attempting to access secured endpoints without a token results in a 401 Unauthorized status.
Verify that accessing the airtime purchase endpoint with a valid token returns an OK status.
Test the calculation of HMAC512 with a sample data and key.
API documentation can be found here