Giter Club home page Giter Club logo

chargebee-java's People

Contributors

cb-alish avatar cb-ashik avatar cb-bharathvaj avatar cb-gaurav avatar cb-goutham avatar cb-karthikp avatar cb-khushbubibay avatar cb-navaneedhan avatar cb-nithins avatar cb-prajaktachavan avatar cb-sriramthiagarajan avatar cb-thiyagu avatar cb-thushitamariaselvan avatar cb-yateshmathuria avatar hellokps avatar karthi-cb avatar rraman avatar sangeethabaskaran avatar saravana-cb avatar vaibhav1510 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chargebee-java's Issues

Add enums of accepted values for fields like Country and Currency Code

while testing the API I've found that I cannot use "GBP" as a currency code and I cannot specify "United States" as a country (seems "US" is the expected value). The fields are both strings with no indication of how the format of the values should be. Perhaps it would be better to be able to use .billingAddressCountry(CountryCode.US) and .preferredCurrencyCode(CurrencyCode.USD).

please don't use reflection in ClazzUtil

The com.chargebee.internal.ClazzUtil class uses reflection to pick which class to return. This causes problems when using Graalvm to get a native build. Please consider changing that code to use a switch statement on the model type instead so that it works when compiling to a native binary.

Add subscriptions in ResultBase object

What problem does your feature request address?

We realized that some events (for example "Customer deleted") contains subscriptions field (collection of customer subscriptions).
However, the type com.chargebee.models.Event.content() which is the representation of event content does not provide a method to access this field.

Describe the desired solution

The desired solution would be to make subscriptions method available in ResultBase this possible:

Event event = // the instance of event
var subscriptions = event.content().subscriptions(); // This is not available 
var subscription = event.content().subscription(); // This is availabale

it would be great if we could add this method.

Alternatives considered

Currently, we access the list of subscriptions via parsing the JSONObject:

var subscriptions = this.optJSONObject("content").optJSONArray("subscriptions");

Additional context

The subscriptions field is mentioned in the documentation for customer_deleted event here

License problems of dependency org.json

Hi,
I want to use this library as Java API for Chargebee for a commercial product but when checking the dependencies of this library I found out that you are relying on org.json which is under "The JSON License".
That license is considered legally dangerous by quite some people in the opensource ecosystem due to the vague clause of "The Software shall be used for Good, not Evil." and in my case prevents me from using this library for interfacing with Chargebee for compliance reasons.

Similar issues also arose for other projects: fabric8io/docker-maven-plugin#1016

Could you consider replacing that dependency with an alternative to make compliance less of an issue please?

APIException constructor should not `throw Exception`

Dealing with the Chargebee API Excpetions is quite painful. Even though they are descendants of the RuntimeException and should not need to be checked, their constructor has a throws Exception annotation, defeating the purpose!

public APIException(int httpStatusCode,JSONObject jsonObj) throws Exception {
super(jsonObj.getString("message"));
this.jsonObj = jsonObj;
this.httpStatusCode = httpStatusCode;
this.apiErrorCode = jsonObj.getString("api_error_code");
this.type = jsonObj.optString("type");
this.param = jsonObj.optString("param");
this.httpCode = httpStatusCode;
this.code = jsonObj.getString("error_code");
this.message = jsonObj.getString("error_msg");
}

Could you please remove that throws Exception declaration?

And consequently also remove all the other unnecessary throws Exception declarations from your request methods?

Please update the source and target Java version to 7 or above

The pom specifies Java 5 which is out of support and with recent versions of Maven will result in:

[ERROR] Source option 5 is no longer supported. Use 7 or later.
[ERROR] Target option 5 is no longer supported. Use 7 or later.

Personally I feel 8 is the lowest anyone should support these days with Java 11 and above being ideal.

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.