cb-hari / chargebee-java

Java API Client for integrating with ChargeBee

Home Page:https://apidocs.chargebee.com/docs/api?lang=java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chargebee Java Client Library - API V2

The java library for integrating with Chargebee Recurring Billing and Subscription Management solution.

Chargebee now supports two API versions - V1 and V2, of which V2 is the latest release and all future developments will happen in V2.

This library is for our API version V2. The library for V1 can be found in chargebee-v1 branch.

Installation

Maven users

Add the below dependency to your pom.xml:

<dependency>
  <groupId>com.chargebee</groupId>
  <artifactId>chargebee-java</artifactId>
  <version>[latest-2.x.x-release-version]</version>
</dependency>

To get the latest jar

ChargeBee java jar is distributed as part of the release under the dist directory. Just checkout the latest version for 2.x.x by git checkout [latest 2.x.x release tag]

or

Build the jar by running maven as follows in latest release tag for 2.x.x:

git checkout [latest 2.x.x release tag]
mvn clean package

Documentation

API Reference

Usage

You can also copy the below code snippet from our API Reference documentation. We have provided downloadable code for each API operation.

import java.io.IOException;
import com.chargebee.*;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;

public class Sample{

  public static void main(String args[]) throws IOException{
    Environment.configure("{site}","{site_api_key}");
    Result result = Subscription.create()
                      .id("HwxfyiHNUFzaiWO")
                      .planId("starter")
                      .customerEmail("john@user.com")
                      .customerFirstName("John")
                      .customerLastName("Wayne").request();
    Subscription subscription = result.subscription();
    Customer customer = result.customer();
    Card card = result.card();
    System.out.println(result);
  }
}

License

See the LICENSE file.

About

Java API Client for integrating with ChargeBee

https://apidocs.chargebee.com/docs/api?lang=java

License:MIT License


Languages

Language:Java 100.0%