https://github.com/ashwamegh/razorpay-react-demo
Razorpay React.js bindings
https://github.com/ashwamegh/razorpay-react-demo
payment-processing razorpay razorpay-api reactjs refunds
Last synced: 10 months ago
JSON representation
Razorpay React.js bindings
- Host: GitHub
- URL: https://github.com/ashwamegh/razorpay-react-demo
- Owner: ashwamegh
- License: mit
- Created: 2017-12-07T08:22:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T02:41:08.000Z (almost 3 years ago)
- Last Synced: 2025-04-14T01:54:31.537Z (about 1 year ago)
- Topics: payment-processing, razorpay, razorpay-api, reactjs, refunds
- Language: JavaScript
- Homepage: https://ashwamegh.github.io/razorpay-react-demo/
- Size: 1.7 MB
- Stars: 18
- Watchers: 1
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Razorpay React Demo
[](https://www.npmjs.com/package/razorpay)
[](https://reactjs.org/)
A demo of Razorpay Node Sdk with React.js showcasing the payments and refunds scenarios:
## Getting Started
```bash
git clone https://github.com/ashwamegh/razorpay-react-demo.git
cd razorpay-react-demo
```
## Prerequisites
> Get your Razorpay API keys [`key_id` and `key_secret`] for test environment variables from here, [https://dashboard.razorpay.com/#/app/keys](https://dashboard.razorpay.com/#/app/keys)
## Installation
### For Frontend
> Note: make sure you have added Razorpay script `` in your HTML file to get the Razorpay constructor reference. For Eg: To access it using `window.Razorpay` or `Razorpay`
```bash
npm install or yarn
touch .env
```
Copy the contents from `sample.env` to `.env` and replace the dumb characters(`xxxxx`) with your Razorpay `key` and the Server URL, which you will be creating soon(local default is already there in the file).
```bash
npm start or yarn start
```
### For Backend/Server
> Note: Server Needed to talk with Razorpay using Node SDK
```bash
cd server
npm install or yarn
touch .env
```
Copy the contents from `sample.env` to `.env` and replace the dumb characters(`xxxxx`) with your Razorpay `key` and `secret`
Now run,
```bash
npm start or yarn start
```
You can goto http://localhost:8080 and try out this demo, later you can deploy the server code to server app containers like **heroku, glitch, aws, etc** and replace the URL in frontend's `.env` file with your new server URL.
## Licence
MIT Licensed.