This project is a full-stack application made using React.JS and Node.JS for a sample RazorPay integration module for Level App. Used Express.JS framework for Node and also integrated valid alerts and basic routing in the React app.
In the project directory, open a terminal session and you can run:
Goes to the path of the Node.JS code.
Installs the required modules for the Node.JS code.
Create an env file populating the following secrets required for RazorPay:
RAZOR_PAY_KEY_ID
RAZOR_PAY_KEY_SECRET
Runs the server in the development mode on port 8000.
Server is now listening on http://localhost:8000.
In the project directory, open a new terminal session and you can run:
Goes to the path of the React.JS code.
Installs the required modules for the React.JS code.
Create an env file populating the following secrets required for the React app:
REACT_APP_API_BASE_URL = http://localhost:8000
REACT_APP_RAZOR_PAY_KEY_ID
Runs the React app in the development mode.
Open http://localhost:3000 to view it in the browser.
The React app uses routing to route to the payments component
This should redirect you to the Razorpay payment checkout. Appropriate validations and alerts on success
and failure
responses are implemented as well.