This is a simple project by me demonstrating how to integrate the MoMo payment gateway into a website. I kept everything minimal so you can easily understand the payment flow without getting lost in complex logic.
This project focuses on the core steps of a transaction:
- Creating an Order.
- Sending a payment request to the MoMo API.
- Receiving the payment URL and redirecting the user.
- Handling the payment result (IPN/Redirect).
git clone https://github.com/marcomoi395/payment-labs.git
cd payment-labs
npm installTo run this demo, you need a set of API Keys (partnerCode, accessKey, secretKey, etc.).
💡 Quick Tip for Test Keys: Instead of registering a business account just for testing, you can grab valid test keys directly from the official MoMo repository.
Start the server:
npm startOpen your browser and visit http://localhost:3000 (or your configured port), click the Pay with MoMo button, and then use the MoMo App (Test version) or follow the MoMo documentation to simulate a successful transaction.
- Client requests payment -> Server generates signature & sends request to MoMo.
- MoMo returns a payUrl.
- Client is redirected to the MoMo payment page (QR Code / Card input).
- After payment, MoMo redirects the user back to your site with the result.


