nagarjuna06 / Integrate_Payment_Gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Razorpay Integration with React - Fake Store

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.

Prerequisites

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)

Getting Started

To set up and run the React application integrated with Razorpay, follow these steps:

  1. Clone the repository to your local machine using the following command:

    git clone https://github.com/nagarjuna06/CodeClause_Integrate_Payment_Gateway.git
    
  2. Change into the project directory:

    cd CodeClause_Integrate_Payment_Gateway
    
  3. Install the project dependencies using npm:

    npm install
    
  4. Obtain your Razorpay API credentials by signing up for an account at https://razorpay.com and creating a new test account.

  5. Update the Razorpay API credentials in the .env file. Replace the placeholders with your actual API key and API secret.

  6. Start the React development server:

    npm run dev
    
  7. Open your web browser and navigate to http://localhost:3000 to see the fake store application in action.

Usage

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.

Contributing

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.

Acknowledgements

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.

About


Languages

Language:JavaScript 61.4%Language:CSS 28.3%Language:HTML 10.3%