Skip to content

Commit

Permalink
Merge pull request #12 from cashfree/2.0.1
Browse files Browse the repository at this point in the history
2.0.1
  • Loading branch information
surjeetcashfree authored Jan 22, 2025
2 parents 75e1846 + 298aec5 commit 9f24862
Show file tree
Hide file tree
Showing 33 changed files with 2,387 additions and 80 deletions.
51 changes: 12 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Cashfree PG Java SDK
![GitHub](https://img.shields.io/github/license/cashfree/cashfree-pg-sdk-java) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-pg-sdk-java/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-pg-sdk-java?label=latest) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-pg-sdk-java) [![Coverage Status](https://coveralls.io/repos/github/cashfree/cashfree-pg-sdk-java/badge.svg?branch=main)](https://coveralls.io/github/cashfree/cashfree-pg-sdk-java?branch=main)
# Cashfree Payout Java SDK
![GitHub](https://img.shields.io/github/license/cashfree/cashfree-payout-sdk-java) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-payout-sdk-java/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-payout-sdk-java?label=latest) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-payout-sdk-java) [![Coverage Status](https://coveralls.io/repos/github/cashfree/cashfree-payout-sdk-java/badge.svg?branch=main)](https://coveralls.io/github/cashfree/cashfree-payout-sdk-java?branch=main)

The Cashfree PG Java SDK offers a convenient solution to access [Cashfree PG APIs](https://docs.cashfree.com/reference/pg-new-apis-endpoint) from a server-side Java applications.
The Cashfree Payout Java SDK offers a convenient solution to access [Cashfree Payout APIs](https://docs.cashfree.com/reference/version-2) from a server-side Java applications.



## Documentation

Cashfree's PG API Documentation - https://docs.cashfree.com/reference/pg-new-apis-endpoint
Cashfree's Payout API Documentation -https://docs.cashfree.com/reference/version-2

Learn and understand payment gateway workflows at Cashfree Payments [here](https://docs.cashfree.com/docs/payment-gateway)
Learn and understand payment gateway workflows at Cashfree Payouts [here](https://docs.cashfree.com/docs/payouts)

Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com/devstudio) !

Expand All @@ -18,14 +18,14 @@ Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com
### Installation
* Gradle Project
```bash
implementation `com.cashfree.payout.java:cashfree_payout:0.0.14`
implementation `com.cashfree.payout.java:cashfree_payout:2.0.1`
```
* Maven Project
```bash
<dependency>
<groupId>com.cashfree.payout.java</groupId>
<artifactId>cashfree_payout</artifactId>
<version>0.0.14</version>
<version>2.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -39,44 +39,17 @@ implementation `com.cashfree.payout.java:cashfree_payout:0.0.14`
```java
import com.cashfree.*;

Cashfree.XClientId = "<x-client-id>";
Cashfree.XClientSecret = "<x-client-secret>";
Cashfree.XEnvironment = Cashfree.SANDBOX;
CashfreePayout.XClientId = "<x-client-id>";
CashfreePayout.XClientSecret = "<x-client-secret>";
CashfreePayout.XEnvironment = CashfreePayout.SANDBOX;

Cashfree cashfree = new Cashfree();
String xApiVersion = "2022-09-01";
CashfreePayout cashfree = new CashfreePayout();
String xApiVersion = "2024-01-01";
```

Generate your API keys (x-client-id , x-client-secret) from [Cashfree Merchant Dashboard](https://merchant.cashfree.com/merchants/login)

### Basic Usage
Create Order
```java
CustomerDetails customerDetails = new CustomerDetails();
customerDetails.setCustomerId("walterwNrcMi");
customerDetails.setCustomerPhone("9999999999");

CreateOrderRequest request = new CreateOrderRequest();
request.setOrderAmount(1.0);
request.setOrderCurrency("INR");
request.setCustomerDetails(customerDetails);
try {
ApiResponse<OrderEntity> response = cashfree.PGCreateOrder(xApiVersion, request, null, null, null);
System.out.println(response.getData().getOrderId());
} catch (ApiException e) {
throw new RuntimeException(e);
}
```

Get Order
```java
try {
ApiResponse<OrderEntity> responseFetchOrder = cashfree.PGFetchOrder(xApiVersion, "<order_id>", null, null, null);
System.out.println(response.getData().getOrderId());
} catch (ApiException e) {
throw new RuntimeException(e);
}
```

## Licence

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

group = 'com.cashfree.payout.java'
version = '0.0.14'
version = '2.0.1'

buildscript {
repositories {
Expand Down Expand Up @@ -116,7 +116,7 @@ if(hasProperty('target') && target == 'android') {

groupId 'com.cashfree.payout.java'
artifactId 'cashfree_payout'
version '0.0.14'
version '2.0.1'

from components.java

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.cashfree.payout.java",
name := "cashfree_payout",
version := "0.0.14",
version := "2.0.1",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>cashfree_payout</artifactId>
<packaging>jar</packaging>
<name>cashfree_payout</name>
<version>0.0.14</version>
<version>2.0.1</version>
<url>https://github.com/cashfree/cashfree-payout-sdk-java</url>
<description>Java Framework for Cashfree Payout.</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cashfree/ApiException.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-11T15:05:20.896700Z[Etc/UTC]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-22T05:02:47.591666Z[Etc/UTC]")
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
Expand Down
Loading

0 comments on commit 9f24862

Please sign in to comment.