8000 GitHub - ryanntannn/minipay: An event-driven payment API built to learn the basic features of Spring Web, Spring Security and Kafka
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

An event-driven payment API built to learn the basic features of Spring Web, Spring Security and Kafka

Notifications You must be signed in to change notification settings

ryanntannn/minipay

Repository files navigation

minipay

An event-driven payment API built to learn the basic features of Spring Web, Spring Security and Kafka.

Endpoints

/health

  • Method: GET
  • Description: Health check endpoint.
  • Response: Returns a 200 OK status if the service is running, along with a simple "Healthy" message. If a valid JWT token is provided, it will also return the username associated with the token.
  • Example:
curl -X GET http://localhost:8080/health
Healthy

/login

  • Method: POST
  • Description: Login endpoint to authenticate users and generate JWT tokens.
  • Request Body: JSON object containing username and password.
  • Response: Returns a JWT token if the credentials are valid. The token is signed with a secret key and contains user information.
  • Example:
curl -X POST http://localhost:8080/login \
-H "Content-Type: application/json" \
-d '{
	"username": "user",
	"password": "password"
}'
<some_jwt_token>

/pay

  • Method: POST
  • Description: Endpoint to process a payment.
  • Request Body: JSON object containing payment details such as amount, currency, and recipient.
  • Response: Returns a confirmation message if the payment is processed successfully.
  • Example:
curl -X POST http://localhost:8080/pay \
-H "Content-Type: application/json"
-d '{
	"amount": 100,
	"currency": "USD",
	"recipient": "Tom"
}'
Payment processed successfully: txn_<some_transaction_id>

About

An event-driven payment API built to learn the basic features of Spring Web, Spring Security and Kafka

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0