GithubHelp home page GithubHelp logo

razorpay / razorpay-java Goto Github PK

View Code? Open in Web Editor NEW
57.0 182.0 64.0 957 KB

Razorpay Java SDK

Home Page: https://mvnrepository.com/artifact/com.razorpay/razorpay-java

License: MIT License

Java 100.00%

razorpay-java's Introduction

Razorpay Java SDK

Official java bindings for the Razorpay API.

Documentation

Documentation of Razorpay's API and their usage is available at https://docs.razorpay.com

Requirements

Java 1.8 or later

Mock Tests Support till Java 1.8

Installation

Maven users

Add this dependency to your project's POM:

<dependency>
 <groupId>com.razorpay</groupId>
 <artifactId>razorpay-java</artifactId>
 <version>1.4.7</version>
</dependency>

Gradle users

Add this dependency to your project's build file:

implementation "com.razorpay:razorpay-java:1.4.7"

Usage

RazorpayClient can be instantiated via two ways:

Using Private Auth

Instantiate RazorpayClient with key_id & key_secret. You can obtain the keys from the dashboard app https://dashboard.razorpay.com/#/app/keys

// Initialize client
RazorpayClient instance = new RazorpayClient("key_id", "key_secret");
  • Add custom headers to request (optional)
Map<String, String> headers = new HashMap<String, String>();
razorpayClient.addHeaders(headers);

Using Access Token

Instantiate RazorpayClient with access_token. The access_token can be obtained only in case if you are a platform partner. For more information, refer page - https://razorpay.com/docs/partners/platform/.

// Initialize client
RazorpayClient instance = new RazorpayClient("access_token");
  • Add custom headers to request (optional)
Map<String, String> headers = new HashMap<String, String>();
razorpayClient.addHeaders(headers);

Supported Resources


  • Make custom requests

You can make custom API requests using clients. For example, here is how to make custom request to /payments/path endpoint.

Entity response = razorpayClient.Payments.post("path", JSONObject requestBody);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.