Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.1 #2

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Trigger Tests on Pull Request.

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]


jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'

- name: Gradlew permission
run: chmod +x gradlew
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# exclude jar for gradle wrapper
!gradle/wrapper/*.jar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# build files
**/target
target
.gradle
build
api/
src/main/java/com/cashfree/client/
src/test/
docs/
README.md
23 changes: 23 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
380 changes: 380 additions & 0 deletions .openapi-generator/FILES

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.0.0
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
# Ref: https://docs.travis-ci.com/user/languages/java/
#
language: java
jdk:
- openjdk12
- openjdk11
- openjdk10
- openjdk9
- openjdk8
before_install:
# ensure gradlew has proper permission
- chmod a+x ./gradlew
script:
# test using maven
#- mvn test
# test using gradle
- gradle test
# test using sbt
# - sbt test
52 changes: 47 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Cashfree Verification Suite Java SDK
# Cashfree PG Java SDK
![GitHub](https://img.shields.io/github/license/cashfree/cashfree-verification-sdk-java) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-verification-sdk-java/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-verification-sdk-java?label=latest) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-verification-sdk-java) [![Coverage Status](https://coveralls.io/repos/github/cashfree/cashfree-verification-sdk-java/badge.svg?branch=main)](https://coveralls.io/github/cashfree/cashfree-verification-sdk-java?branch=main)

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



## Documentation

Cashfree's Verification Suite API Documentation - (https://docs.cashfree.com/reference/verification-api-overview)
Cashfree's PG API Documentation - https://docs.cashfree.com/reference/verification-new-apis-endpoint

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

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

Expand All @@ -16,14 +18,14 @@ Try out our interactive guides at [Cashfree Dev Studio](https://www.cashfree.com
### Installation
* Gradle Project
```bash
implementation `com.cashfree.verification.java:cashfree_verification:`
implementation `com.cashfree.verification.java:cashfree_verification:1.0.1`
```
* Maven Project
```bash
<dependency>
<groupId>com.cashfree.verification.java</groupId>
<artifactId>cashfree_verification</artifactId>
<version></version>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -34,8 +36,48 @@ implementation `com.cashfree.verification.java:cashfree_verification:`
```
### Configuration

```java
import com.cashfree.*;

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

Cashfree cashfree = new Cashfree();
String xApiVersion = "2022-09-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

Apache Licensed. See [LICENSE.md](LICENSE.md) for more details
Loading
Loading