Link: Java 17
- Create
application.propertiesbase onapplication.properties.example.
cp ./src/main/resources/application.properties.example ./src/main/resources/application.properties- Add values for payOS client, all credentials can be get from my.payos.vn.
- Install dependencies using the command
mvn clean install - Run the project using the command
mvn spring-boot:run - The project will run on port 8080
Note
Webhook Setup (Optional): For testing webhook functionality in development, you need to expose your local server using a tool like ngrok. The webhook endpoint is /payment/payos_transfer_handler (handled by PaymentController.java). After exposing your server with ngrok, register the full webhook URL (e.g., https://abc123.ngrok.io/payment/payos_transfer_handler) in your payOS dashboard at my.payos.vn or using /order/confirm-webhook with your webhook URL.
CheckoutController.java: simple create payment link with base information.OrderController.java: include methods related to payment-request.PaymentController.java: webhook handler for payment-request.PayoutsController.java: include methods related to payouts.