This repository provides an example integration of Razorpay payment gateway with a React application for a fake store. It demonstrates how to enable payment processing using Razorpay's API and provides a simple checkout flow for a fictional e-commerce store.
Before getting started, ensure you have the following prerequisites installed on your machine:
- Node.js (v12 or higher)
- React (v16 or higher)
- npm (Node Package Manager)
To set up and run the React application integrated with Razorpay, follow these steps:
-
Clone the repository to your local machine using the following command:
git clone https://github.com/nagarjuna06/CodeClause_Integrate_Payment_Gateway.git
-
Change into the project directory:
cd CodeClause_Integrate_Payment_Gateway
-
Install the project dependencies using npm:
npm install
-
Obtain your Razorpay API credentials by signing up for an account at https://razorpay.com and creating a new test account.
-
Update the Razorpay API credentials in the
.env
file. Replace the placeholders with your actual API key and API secret. -
Start the React development server:
npm run dev
-
Open your web browser and navigate to
http://localhost:3000
to see the fake store application in action.
The fake store application provides a simple e-commerce store experience. Users can browse available products, add items to their cart, and proceed to the checkout page. On the checkout page, users can enter their shipping and payment details.
The payment process is simulated using Razorpay. After submitting the payment, the application will display a success or failure message based on the payment status received from Razorpay's API.
Contributions to this repository are welcome. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
This integration example is based on the official documentation and examples provided by Razorpay. You can find more information and resources on the Razorpay website.