Is it possible to integrate Razorpay in an application using reactjs(front end) and Java 8(backend).
On razorpay website they do not have documents to integrate with react js applications.
I'm new to reactjs and Payment gateway integration so If anyone has worked on razorpay integration with reactjs Please suggest any good approach/any documentation available.
Or if anyone can suggest any good payment gateway which is easy to integrate with REACTJS+JAVA application.
Thanks !
In order to deal with the API JAVA as a backend is enough and For the Frontend With React, we write HTML using JavaScript. We rely on the power of JavaScript to generate HTML that depends on some data, rather than enhancing HTML to make it work with that data. Enhancing HTML is what other JavaScript frameworks usually do.
So to work with the API. Prerequisites# Java 1.7 or higher
Installation# You can install Razorpay using Maven or Gradle.
Maven# Download and install Maven on your system.
Download the latest Source code zip file from the Releases section of GitHub.
Unzip the file and add this dependency to the project object model (POM) of your project.
Gradle# Download and install Gradle on your system.
Download the latest Source code zip file from the Releases section of GitHub.
Unzip the file and add this dependency to the build file of the project:
Sample Code
Initialization#
Generate API Key#
Log into your Dashboard with appropriate credentials. Select the mode (Test or Live) for which you want to generate the API key. Note: You have to generate separate API Keys for the test and live modes. No real money is used in test mode. Navigate to Settings → API Keys → Generate Key to generate key for the selected mode.
Add Custom Headers# Note: This is an optional step.
To add custom headers to request:
Orders# Note: Click here for request parameters and an example request and response.
Create an Order#
Fetch Order by ID#
Fetch all Orders#
Fetch Order for a Payment#
Capture a Payment#
Fetch Payment by ID#
The entity .get("attribute_key") method has flexible return types depending on the attribute.
Fetch all Payments#
Create a Full Refund#
Create a Partial Refund#
Fetch Refund by ID#
Fetch all Refunds#
Fetch Refund against Payment#
Fetch all Refunds against a Payment#
Fetch Card Details#
Create a Customer#
Fetch Customer by ID#
Edit a Customer#
Fetch a Token#
Fetch Token for a Customer#
Delete a Token#
Subscriptions#
Create a Plan#
Fetch Plan by ID#
Fetch all Plans#
Create a Subscription#
Fetch Subscription by ID#
Fetch all Subscriptions#
Cancel a Subscription#
Create an Add-on#
Fetch Add-on by ID#
Delete an Add-on#
Payment Links#
Create an Subscription Link#
Fetch all Subscription Links#
Cancel a Subscription Link#
Create an Invoice#
Fetch Invoice by ID#
Create a Virtual Account#
Fetch Virtual Account by ID#
Fetch all Virtual Accounts#
Create a Transfer#
Create a Direct Transfer#
Edit a Transfer#
Fetch Bank Transfer Payments#
Fetch all Transfers for a Payment#
Fetch all Transfers#
Create a Reversal of a Transfer#
Webhooks#
Validate Webhook Signature# You can verify the signature of the received webhook:
Utility#
Verify Signature for a Payment# You can use the Utils class to verify the signature received in response to a payment made using Orders API.
Custom Requests# You can make custom API requests using clients. For example, here is how to make custom request to /payments/path endpoint.
SAMPLE APPLICATION
Integrate and Run the Sample Application#
Create a Checkout form using Razorpay Checkout Integration.
Accept razorpay_payment_id parameter in the form submission.
Run the capture code to capture the payment.
Edit the key inside index.ftl.
Add your <key_id> and <key_secret> in the server.yml file. Refer to the Generate API Key to learn how to generate keys.
Build the test application using the following command:
Run the test application using the following command:
Note:
If you want to re-use this as your final code, follow the below steps:
Edit the key inside index.ftl file. Edit the <key_id> and the <key_secret> inside server.yml file. Use the live keys when using the application to accept live payments.