For payments we have used Razorpay
for the payment integration in our application.
Razorpay is a great payment gateway that allows you to accept payments from customers and disburse payments to vendors and employees.
Now let's setup Payments
in your application.
- Create a Razorpay (opens in a new tab) account and get your API key and secret key and update it in the
.env
file.
.env
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=
- Now, we have two api endpoints for payments -
-
/api/create-order
: This endpoint is used to create the order and get the order id. -
/api/verify-payment
: This endpoint is used to verify the payment and update the order status.
- You can update the code according to your needs. And after all this head over to the
dashboard
and test the payment integration.
See, you have successfully set up the payment integration for the project.
You can now accept payments from customers on your application.