- JDK 17
- Docker
- Run Docker then create a container using the docker-compose file
- Import the API collection in Postman
- Run the application
For documentation openAPI is included, and it can be found under the following url: http://localhost:8090/swagger-ui/index.html
POST http://localhost:8090/payment
Example request
{
"cardNumber": "2222405343248877",
"cvv": "123",
"expiryMonth": 4,
"expiryYear": 2025,
"currency": "GBP",
"amount": 100
}
Example response
{
"id": "5a5dab4d-b07c-41a9-a1a8-f7c96c609cb5",
"status": "Authorized",
"cardNumberLastFour": "8877",
"expiryMonth": 4,
"expiryYear": 2025,
"currency": "GBP",
"amount": 100
}
POST http://localhost:8090/payment/{{paymentId}}
Example response
{
"id": "19f3c9f1-1384-45c2-ac36-b41f90111446",
"status": "Authorized",
"cardNumberLastFour": "8877",
"expiryMonth": 4,
"expiryYear": 2025,
"currency": "GBP",
"amount": 100
}
Note:
- The unauthorized scenario cannot be tested as the bank simulator expects an invalid card number.
- The payment gateway will return a 400 status code if the request is invalid.
- The payment gateway will return a 500 status code if the bank simulator cannot handle the request.
- Merchant accounts with API authentication
- Persistent storage for payments
- More detailed Swagger documentation with examples